- C3d aggiornamento delle librerie ( 117994).
This commit is contained in:
SaraP
2024-06-05 09:47:32 +02:00
parent 827b79f766
commit 09a338b565
48 changed files with 891 additions and 464 deletions
+6 -2
View File
@@ -398,10 +398,14 @@ public:
\en Fix torus radii. \~
\details \ru Зафиксировать радиусы тора.
Можно зафиксировать большой и малый радиусы тора (только один их них или сразу оба).
Значения должны быть положительными (=0 - значение не зафиксировано).
Малый радиус должен быть положительным (=0 - значение не зафиксировано).
Большой радиус может быть отрицательным для торов типа "лимон" (=0 - значение не зафиксировано).
Большой радиус (центров) должен быть больше малого радиуса (трубки), взятого с обратным знаком: majorRadius>minorRadius.
\en Fix torus radii.
There may be fixed the major radius (_size1) or the minor radius (_size2) of a torus (one or both of them).
The values have to be positive (=0 - value is not fixed). \~
The minor radius has to be positive (=0 - value is not fixed).
The major radius may be negative if a torus is of "lemon" type (=0 - value is not fixed).
The major radius (of centers) has to be greater than the opposite of the minor radius (of a tube): majorRadius>minorRadius. \~
\param[in] majorRadius - \ru Большой радиус тора.
\en Major torus radius. \~
\param[in] minorRadius - \ru Малый радиус тора.
+92
View File
@@ -770,4 +770,96 @@ MATH_FUNC( MbResultType ) AlignObjects( const MbItem & fixed,
const MbObjectAlignmentParams & params,
MbObjectAlignmentResult & result );
//------------------------------------------------------------------------------
/** \brief \ru Класс для драпировки оболочки тканью.
\en Class for shell draping. \~
\details \ru Класс для драпировки оболочки тканью. \n
\en Class for shell draping. \n \~
\ingroup Polygonal_Objects
\warning \ru В разработке.
\en Under development. \~
*/
// ---
class MATH_CLASS MbDrapMaker
{
protected:
MbDrapMaker() {}
public:
/** \brief \ru Создать экземпляр класса по параметрам развертки и размеру ячейки.
\en Create class instance by parameters and cell size. \~
\details \ru Создать экземпляр класса по параметрам развертки и размеру ячейки. Пользователь должен сам удалить объект.
\en Create class instance by parameters and cell size. User must delete created object. \~
\param[in] params - \ru Параметры развертки. \n
\en Unwrapping parameters. \~
\param[in] cellSize - \ru Размер ячейки ткани. \n
\en Fiber cell size. \~
\return \ru Возвращает указатель на созданный объект.
\en Returns pointer to created object. \~
*/
static MbDrapMaker * Create( const MbMeshUnwrapParams & params, double cellSize );
/// \ru Деструктор. \en Destructor.
virtual ~MbDrapMaker() {}
/** \brief \ru Получить грань-развертку.
\en Get unwrapped face. \~
\details \ru Получить грань-развертку.
Ее контур получается путем аппроксимации границы сеточной развертки.
\en Get unwrapped face.
It's contour is calculated by approximation of the unwrapped mesh border.
\param[in] tolApprox - \ru Точность аппроксимации.
\en Approximation tolerance. \~
\param[out] unwrapped - \ru Грань-развертка.
\en Unwrapped face. \~
*/
virtual void GetUnwrapped( double tolApprox, c3d::FaceSPtr & unwrapped ) const = 0;
/** \brief \ru Получить полилинии для главной нити основы.
\en Get polyline for main warp thread. \~
\details \ru Получить полилинии для главной нити основы.
Эти полилинии идут от точки приложения в положительном и отрицательном направлении
оси Х локальной системы координат.
\en Get polyline for main warp thread.
Polylines go in the positive and negative direction of the local coordinate system X-axis.
\param[out] warpPlus - \ru Полилиния в положительном направлении.
\en Polyline in the positive direction. \~
\param[out] warpMinus - \ru Полилиния в отрицательном направлении.
\en Polyline in the negative direction. \~
*/
virtual void GetWarp( c3d::SpacePointsVector & warpPlus, c3d::SpacePointsVector & warpMinus ) const = 0;
/** \brief \ru Получить полилинии для главной нити утка.
\en Get polyline for main weft thread. \~
\details \ru Получить полилинии для главной нити утка.
Эти полилинии идут от точки приложения в положительном и отрицательном направлении
оси Y локальной системы координат.
\en Get polyline for main weft thread.
Polylines go in the positive and negative direction of the local coordinate system Y-axis.
\param[out] weftPlus - \ru Полилиния в положительном направлении.
\en Polyline in the positive direction. \~
\param[out] weftMinus - \ru Полилиния в отрицательном направлении.
\en Polyline in the negative direction. \~
*/
virtual void GetWeft( c3d::SpacePointsVector & weftPlus, c3d::SpacePointsVector & weftMinus ) const = 0;
/// \ru Получить количество сторон ячеек. \en Get cell sides count.
virtual size_t GetCellSidesCount() const = 0;
/// \ru Получить полилинию для стороны ячейки. \en Get cell side polyline.
virtual void GetCellSidePolyline( size_t iSide, c3d::SpacePointsVector & poly ) const = 0;
/// \ru Получить угол для стороны ячейки. \en Get cell side angle.
virtual double GetCellSideAngle( size_t iSide ) const = 0;
/** \brief \ru Получить полилинию разреза ткани на поверхности оболочки.
\en Get fiber cut polyline on the shell surface. \~
\details \ru Получить полилинию разреза ткани на поверхности оболочки.
\en Get fiber cut polyline on the shell surface.
\param[in] uv - \ru Начало прямой - линии разреза.
\en Beginning of the cut line. \~
\param[in] dir - \ru Направление прямой - линии разреза.
\en Direction of the cut line. \~
\param[out] polys - \ru Полилинии - отображение линии разреза на оболочку.
\en Polylines - line mapping to the shell. \~
*/
virtual void GetSplitPolylines( const MbCartPoint & uv, const MbVector & dir, std::vector<c3d::SpacePointsVector> & polys ) const = 0;
OBVIOUS_PRIVATE_COPY( MbDrapMaker );
};
#endif // __ACTION_MESH_H
+25
View File
@@ -765,9 +765,11 @@ MATH_FUNC (MbResultType) ElementaryShell( const MbSurface & surface,
/** \brief \ru Построить тело на базе поверхности.
\en Create a solid given a surface. \~
\details \ru Построить тело, состоящее из одной грани, на базе исходной поверхности.
Создаваемая грань использует переданную поверхность, не создавая ее копии.
Поверхность должна быть без самопересечений, с корректной ориентацией
ограничивающих кривых в случае поверхности MbCurveBoundedSurface. \n
\en Create a solid which consists of a face with the specified underlying surface.
The face uses the sent surface without creating a copy of it.
The surface should have no self-intersections,
the bounding curves should be correctly oriented in case of surface MbCurveBoundedSurface. \n \~
\param[in] surface - \ru Поверхность.
@@ -781,11 +783,34 @@ MATH_FUNC (MbResultType) ElementaryShell( const MbSurface & surface,
\ingroup Shell_Modeling
*/
// ---
// DEPRECATE_DECLARE_REPLACE( SurfaceShell with MbSurfaceShellParams )
MATH_FUNC (MbResultType) SurfaceShell( const MbSurface & surface,
const MbSNameMaker & names,
MbSolid *& result );
//------------------------------------------------------------------------------
/** \brief \ru Построить тело на базе поверхности.
\en Create a solid given a surface. \~
\details \ru Построить тело, состоящее из одной грани, на базе исходной поверхности.
Поверхность должна быть без самопересечений, с корректной ориентацией
ограничивающих кривых в случае поверхности MbCurveBoundedSurface. \n
\en Create a solid which consists of a face with the specified underlying surface.
The surface should have no self-intersections,
the bounding curves should be correctly oriented in case of surface MbCurveBoundedSurface. \n \~
\param[in] params - \ru Параметры построения оболочки по поверхности.
\en Parameters for creating the shell by a surface. \~
\param[out] result - \ru Построенная оболочка.
\en The resultant shell. \~
\return \ru Возвращает код результата операции.
\en Returns operation result code. \~
\ingroup Shell_Modeling
*/
// ---
MATH_FUNC (MbResultType) SurfaceShell( const MbSurfaceShellParams & params,
c3d::SolidSPtr & result );
//------------------------------------------------------------------------------
/** \brief \ru Разрезать тело силуэтным контуром.
\en Cut a solid by a silhouette contour. \~
+11 -2
View File
@@ -514,9 +514,18 @@ MATH_FUNC (MbResultType) ExtrusionSolid( const MbSweptData & sweptData
\param[in] axis - \ru Ось вращения.
\en Rotation axis. \~
\param[in, out] params - \ru Параметры вращения.
Возвращают информацию для построения элементов массива операций до поверхности.
Возвращают информацию для построения элементов массива операций до поверхности. \n
При построении операции вращения до конструктивной плоскости с вырожденной областью определения
оболочка будет построена до ближайшего пересечения с указанной плоскостью.
В случае, если плоскость имеет не вырожденные границы, часть плоскости, до которой будет построено вращение,
определяется по положению центра тяжести контура, ограничивающего плоскость, относительно проекции оси вращения на плоскость.
\en The revolution parameters.
Returns the information for construction of the up-to-surface operation array elements. \~
Returns the information for construction of the up-to-surface operation array elements. \n
When constructing a rotation operation to a constructive plane with a degenerate domain of definition
the shell will be constructed to the nearest intersection with the specified plane.
If the plane has non-degenerate boundaries, the part of the plane up to which the rotation will be constructed is
is selected according to the position of the center of gravity of the contour limiting the plane relative to the
projection of the axis of rotation onto the plane. \~
\param[in] operNames - \ru Именователь операции.
\en An object defining names generation in the operation. \~
\param[in] contoursNames - \ru Именователи сегментов образующего контура.
+64 -4
View File
@@ -1,8 +1,8 @@
////////////////////////////////////////////////////////////////////////////////
/**
\file
\brief \ru Геометрический атрибут.
\en Geometric attribute. \~
\brief \ru Атрибуты геометрического и ссылочного объектов.
\en Geometric object and reference-counted object attributes. \~
*/
////////////////////////////////////////////////////////////////////////////////
@@ -27,7 +27,7 @@ class MbRegDuplicate;
//------------------------------------------------------------------------------
/** \brief \ru Геометрический атрибут.
\en Geometric attribute. \~
\details \ru Геометрический атрибут. \n
\details \ru Атрибут геометрического объекта. \n
\en Geometric attribute. \n \~
\ingroup Model_Attributes
*/
@@ -72,11 +72,12 @@ public:
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 Дать геометрический объект. \en Get geometric object.
const MbSpaceItem * GetSpaceItem() const { return spaceItem; }
MbSpaceItem * SetSpaceItem() { return spaceItem; }
/// \ru Заменить геометрический объект. \en Replace geometric object.
void ChangeSpaceItem( MbSpaceItem & init );
void ChangeSpaceItem( const MbSpaceItem & init );
/// \ru Дать тип операции. \en Get operation type.
MbeCreatorType GetOperationType() const { return type; }
@@ -86,4 +87,63 @@ OBVIOUS_PRIVATE_COPY( MbGeomAttribute )
IMPL_PERSISTENT_OPS( MbGeomAttribute )
//------------------------------------------------------------------------------
/** \brief \ru Атрибут ссылочного объекта.
\en Reference-counted object attribute. \~
\details \ru Атрибут объекта со счетчиком ссылок. \n
\en Reference-counted object attribute. \n \~
\ingroup Model_Attributes
*/
class MATH_CLASS MbRefItemAttribute : public MbCommonAttribute {
protected:
MbRefItem * _refItem; ///< \ru Объект со ссылками. \en Reference-counted object.
mutable bool _isTemporal; ///< \ru Временный объект (без сериализации, даже есть она возможна). \en Temporary object (without serialization, even if it is possible).
private:
// \ru Конструктор копирования. \en Copy constructor.
MbRefItemAttribute( const MbRefItemAttribute & init, MbRegDuplicate * iReg );
public:
/// \ru Конструктор. \en Constructor.
MbRefItemAttribute( const MbRefItem & item );
/// \ru Конструктор. \en Constructor.
MbRefItemAttribute( const MbRefItem & item, const c3d::string_t & itemPrompt );
/// \ru Деструктор. \en Destructor.
virtual ~MbRefItemAttribute();
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;
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 Дать ссылочный объект. \en Get reference-counted object.
const MbRefItem * GetRefItem() const { return _refItem; }
/// \ru Дать ссылочный объект. \en Get reference-counted object.
MbRefItem * SetRefItem() { return _refItem; }
/// \ru Заменить ссылочный объект. \en Replace reference-counted object.
bool ChangeRefItem( const MbRefItem & init );
/// \ru Является ли объект временным. \en Whether the object is temporary.
bool IsTemporal() const { return _isTemporal; }
/// \ru Является ли объект временным. \en Whether the object is temporary.
void SetTemporal( bool isTemp ) { _isTemporal = isTemp; }
/// \ru Можно ли сериализовать этот атрибут с содержимым. \en Whether object contents can be serialized?
const TapeBase * CanBeSerialized() const;
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbRefItemAttribute )
OBVIOUS_PRIVATE_COPY( MbRefItemAttribute )
};
IMPL_PERSISTENT_OPS( MbRefItemAttribute )
#endif // __ATTR_GEOMETRIC_ATTRIBUTE_H
+16 -4
View File
@@ -113,8 +113,16 @@ public:
/** \ru \name Общие функции над атрибутами
\en \name Common functions of attributes
\{ */
/// \ru Сдублировать атрибуты присланного объекта, свои отпустить. \en Duplicate attributes of a given object, release existing attributes.
void AttributesAssign( const MbAttributeContainer & );
/** \brief \ru Дублировать атрибуты присланного объекта, свои отпустить.
\en Duplicate attributes of a given object, release existing attributes. \~
\details \ru Дублировать атрибуты присланного объекта, свои отпустить. \n
\en Duplicate attributes of a given object, release existing attributes. \n \~
\param[in] src - \ru Присланный контейнер атрибутов для копирования.
\en Attribute container for copying to this attribute container . \~
\param[in] forcedAssign - \ru Если флаг равен false, то обобщенный атрибут не будет добавлен, если в настройках его поведения есть запрет на размножение.
\en If the flag is false, then the generic attribute will not be added if its behavior settings prohibit replication. \~
*/
void AttributesAssign( const MbAttributeContainer & src, bool forcedAssign = true );
/// \ru Выдать количество объектов. \en Get the number of objects.
size_t AttributesCount() const { return attributes.Count(); }
/// \ru Удалить все атрибуты из контейнера. \en Delete all attributes from container.
@@ -132,10 +140,12 @@ public:
\en Attribute. \~
\param[in] checkSame - \ru Флаг поиска такого же по содержанию атрибута в контейнере. Атрибут не будет добавлен, если найден такой же.
\en Search flag for an attribute containing the same content. Attribute will not be added if the same attribute is found. \~
\param[in] forcedAssign - \ru Если флаг равен false, то обобщенный атрибут не будет добавлен, если в настройках его поведения есть запрет на размножение.
\en If the flag is false, then the generic attribute will not be added if its behavior settings prohibit replication. \~
\return \ru Возвращает указатель на добавленный атрибут или нулевой указатель.
\en Returns a pointer to the added attribute or null pointer. \~
*/
MbAttribute * AddAttribute( MbAttribute * attr, bool checkSame = true );
MbAttribute * AddAttribute( MbAttribute * attr, bool checkSame = true, bool forcedAssign = true );
/** \brief \ru Добавить атрибут в контейнер (добавляет копию атрибута, если его можно добавить).
\en Add attribute in container (adds a copy of the attribute if it can be added). \~
@@ -147,10 +157,12 @@ public:
\en Attribute. \~
\param[in] checkSame - \ru Флаг поиска такого же по содержанию атрибута в контейнере. Атрибут не будет добавлен, если найден такой же.
\en Search flag for an attribute containing the same content. Attribute will not be added if the same attribute is found. \~
\param[in] forcedAssign - \ru Если флаг равен false, то обобщенный атрибут не будет добавлен, если в настройках его поведения есть запрет на размножение.
\en If the flag is false, then the generic attribute will not be added if its behavior settings prohibit replication. \~
\return \ru Возвращает указатель на добавленный атрибут или нулевой указатель.
\en Returns a pointer to the added attribute or null pointer. \~
*/
MbAttribute * AddAttribute( const MbAttribute & attr, bool checkSame = true );
MbAttribute * AddAttribute( const MbAttribute & attr, bool checkSame = true, bool forcedAssign = true );
/** \brief \ru Выдать атрибуты заданного типа или семейства.
\en Get attributes of a given type or family. \~
+1
View File
@@ -92,6 +92,7 @@ enum MbeAttributeType
at_HotPointAttribute = 216, ///< \ru Атрибут простой хот-точки. \en Attribute of the simple hot-point. \n
at_CompHotPointAttribute = 217, ///< \ru Композитный атрибут хот-точки. \en Composite attribute of the hot-point. \n
at_DoubleRangeAttribute = 218, ///< \ru Атрибут диапазона действительных чисел типа double. \en Double precision range attribute.
at_RefItemAttribute = 219, ///< \ru Атрибут ссылочного объекта. \en Reference-counted object attribute. \n
at_CommonLast = 300, ///< \ru Обобщенные атрибуты вставлять перед этим значением. \en Common attributes should be inserted before this value. \n
// \ru Типы связующих атрибутов. \en Types of linking attributes.
+46 -52
View File
@@ -10,12 +10,11 @@
#define __CDET_DATA_H
#include <templ_sptr.h>
#include <mb_cart_point.h>
#include <mb_matrix3d.h>
#include <topology.h>
#include <set>
#include <map>
class MbHRepSolid;
class CdSceneItem;
/**
\addtogroup Collision_Detection
@@ -50,7 +49,7 @@ enum CDM_result
//----------------------------------------------------------------------------------------
/// \ru Объект из набора контроля столкновений. \en Object from the set of collision detection.
//---
typedef const MbHRepSolid * cdet_item;
typedef const CdSceneItem * cdet_item;
typedef CDM_result cdet_result; ///< \ru Код результата контроля столкновений. \en Result code of collision queries.
//----------------------------------------------------------------------------------------
@@ -389,98 +388,93 @@ typedef CDM_exam_status (*CDM_exam_func)( cdet_query *, const CDM_item_data &, c
/** \} */ // Collision_Detection
class TapeBase;
class MbFace;
//----------------------------------------------------------------------------------------
/* \brief \ru Грань столкновения. \en A face of collision. \~
/** \brief \ru Грань столкновения. \en Face of collision. \~
*/
// ---
class MATH_CLASS MbCollisionFace
class MATH_CLASS CdCollisionFace
{
cdet_item item; // The instance to witch the face belongs.
const MbFace * mathFace; // The topological face identified in the collision detection or proximity query.
TapeBase * partFace; // The face of the application representation.
cdet_item item; // The instance to witch the face belongs.
SPtr<const MbFace> mathFace; // The topological face identified in the collision detection or proximity query.
TapeBase* partFace; // The face of the application representation.
public:
MbCollisionFace( const MbFace & f )
CdCollisionFace();
CdCollisionFace(const MbFace& face)
: item( CDET_NULL )
, mathFace( &f )
, mathFace( &face )
, partFace( nullptr )
{}
const MbFace & Face() const { return *mathFace; }
cdet_item Item() const { return item; }
const MbFace & GetMathFace() const { return *mathFace; }
{}
CdCollisionFace(const CdCollisionFace&) = default;
CdCollisionFace(CdCollisionFace&& other);
public:
const MbFace& Face() const { return *mathFace; }
cdet_item Item() const { return item; }
const MbFace& GetMathFace() const { return Face(); }
// \ru Установка объекта модели. \en Setting an object of model.
void SetCollisionFaceObject( TapeBase * _partFace ) { partFace = _partFace; }
void SetCollisionFaceObject(TapeBase* _partFace) { partFace = _partFace; }
// \ru Выдача объекта модели. \en Getting an object of model.
TapeBase * GetCollisionFaceObject() const { return partFace; }
// \ru Задать грань и компонент-вставку, которой принадлежит. \en Set a face and its component-instance.
MbCollisionFace & SetFace( const MbFace * f, cdet_item inst )
CdCollisionFace & SetFace( const MbFace * f, cdet_item inst )
{
mathFace = f;
item = inst;
return *this;
}
MbCollisionFace & operator = ( const MbCollisionFace & other )
CdCollisionFace & operator = ( const CdCollisionFace & other )
{
item = other.item;
mathFace = other.mathFace;
partFace = other.partFace;
return *this;
}
bool operator > ( const MbCollisionFace & other ) const { return mathFace > other.mathFace; }
bool operator < ( const MbCollisionFace & other ) const { return mathFace < other.mathFace; }
bool operator == ( const MbCollisionFace & other ) const { return mathFace == other.mathFace; }
bool operator != ( const MbCollisionFace & other ) const { return !(*this == other); }
bool operator > ( const CdCollisionFace & other ) const { return mathFace > other.mathFace; }
bool operator < ( const CdCollisionFace & other ) const { return mathFace < other.mathFace; }
bool operator == ( const CdCollisionFace & other ) const { return mathFace == other.mathFace; }
bool operator != ( const CdCollisionFace & other ) const { return !(*this == other); }
private:
MbCollisionFace( const MbCollisionFace & ); // not implemented
};
//----------------------------------------------------------------------------------------
// \ru Параметры (характеристика) близости двух объектов. \en Parameters (characteristic) of proximity of two objects.
/** \brief \ru Параметры запроса и результат измерения расстояния между двух объектов.
\en Parameters and the result of the query to measure distance between geometric objects. \~
*/
// ---
class MATH_CLASS MbProximityParameters
class MATH_CLASS CdProximityParameters
{
MbCollisionFace * theFace1;
MbCollisionFace * theFace2;
SPtr<const MbFace> plane;
CdCollisionFace m_face1;
CdCollisionFace m_face2;
public:
MbCartPoint3D fstPnt, sndPnt; // \ru Пара точек близости, принадлежащие триангуляционным сеткам. \en The points of the proximity belonging to the triangulation grids.
MbCartPoint thePar1, thePar2; // \ru Пара точек близости, заданная в поверхностных координатах граней. \en The points of the proximity specified in the surface coordinates of the faces.
double theDistance; // \ru Расстояние. \en Distance.
double upperDist; // \ru Верхняя оценка для поиска минимальной дистанции. \en The upper bound of the minimal distance estimation.
public:
MbProximityParameters();
~MbProximityParameters();
protected:
MbProximityParameters( const MbFace & topoFace1
, const MbFace & topoFace2
, MbCartPoint & par1
, MbCartPoint & par2
, double dist );
CdProximityParameters();
CdProximityParameters(const CdProximityParameters&) = default;
CdProximityParameters(CdProximityParameters&&) = default;
CdProximityParameters& operator = (const CdProximityParameters&) = default;
~CdProximityParameters();
public:
const MbCollisionFace & FaceOne() const { return *theFace1; }
const MbCollisionFace & FaceTwo() const { return *theFace2; }
const CdCollisionFace & FaceOne() const { return m_face1; }
const CdCollisionFace & FaceTwo() const { return m_face2; }
void SetFacePair( const MbFace &, const MbFace & );
void SetFacePair( const MbFace *, cdet_item, const MbFace *, cdet_item );
private:
MbProximityParameters( const MbProximityParameters & ); // not implemented
MbProximityParameters & operator = ( const MbProximityParameters & ); // not implemented
protected:
CdProximityParameters(const MbFace&, const MbFace&, const MbCartPoint& uv1, const MbCartPoint& uv2, double dist);
};
// deprecated typenames.
using MbHRepSolid = CdSceneItem;
using MbCollisionFace = CdCollisionFace;
using MbProximityParameters = CdProximityParameters;
#endif // __CDET_DATA_H
// eof
+51 -27
View File
@@ -10,6 +10,9 @@
#define __CDET_UTILITY_H
#include <cdet_data.h>
#include <conv_res_type.h>
#include <tool_cstring.h>
class MtRefItem;
class MbItem;
@@ -17,7 +20,7 @@ class MbSolid;
class MbMesh;
class MbAssembly;
struct MbLumpAndFaces;
class MbCollisionDetector;
class CdCollisionManager; // Internal implementation of the collision detection module.
/**
\addtogroup Collision_Detection
@@ -25,8 +28,8 @@ class MbCollisionDetector;
*/
//----------------------------------------------------------------------------------------
/** \brief \ru Утилита расчета параметров пересечения и близости тел.
\en Utility for calculation of intersection and proximity parameters of solids. \~
/** \brief \ru Утилита для поиска столкновений и запросов на измерения расстояний.
\en Collision search and distance measurement query utility. \~
\details \ru Предоставляет функциональность Collision Detection для взаимодействия
с приложением САПР.
\en Provides facilities of The Collision Detection to interact with the CAD
@@ -40,13 +43,13 @@ class MbCollisionDetector;
state, i.e. from the beginning. \~
*/
// ---
class MATH_CLASS MbCollisionDetectionUtility
class MATH_CLASS CdCollisionDetection
{
MbCollisionDetector & detector;
CdCollisionManager& detector;
public:
MbCollisionDetectionUtility();
~MbCollisionDetectionUtility();
CdCollisionDetection();
~CdCollisionDetection();
public:
/**
@@ -60,16 +63,15 @@ public:
\en Add a ray with given vertex, direction and placement to the collision detection set. \~
\return \ru Дескриптор объекта для контроля столкновений. \en Descriptor of object for collision detection. \~
*/
cdet_item AddRay( const MbCartPoint3D & vertex, const MbVector3D & direction, const MbPlacement3D & place, cdet_app_item appItem = CDET_APP_NULL );
cdet_item AddRay( const MbCartPoint3D & vertex, const MbVector3D & direction,
const MbPlacement3D & place, cdet_app_item appItem = CDET_APP_NULL );
/**
\brief \ru Добавить полигональный объект с заданным положением в набор для контроля столкновений.
\en Add a poligonal object with given placement to the collision detection set. \~
\return \ru Дескриптор объекта для контроля столкновений. \en Descriptor of object for collision detection. \~
*/
cdet_item AddMesh( const MbMesh & mesh
, const MbPlacement3D & place
, cdet_app_item appItem = CDET_APP_NULL
, double gap = 0. );
cdet_item AddMesh( const MbMesh & mesh, const MbPlacement3D & place
, cdet_app_item appItem = CDET_APP_NULL, double gap = 0. );
/**
\brief \ru Добавить новый компонент контроля соударений и параметров близости.
\en Add a new component to track collisions and proximity parameters. \~
@@ -83,7 +85,7 @@ public:
\param[in] compItem - \ru Компонент, которому будет принадлежать экземпляр.
\en A component to witch the instance will belong.
\param[in] solidItem - \ru Оригинальное тело, добавленное методом #AddSolid, по которому изготавливается экземпляр.
\en An original solid added by the method #AddSolid by witch the instance is made.
\en An original solid added by the method #AddSolid by which the instance is made.
\param[in] place - \ru Положение, которое занимает тело экземпляра в глобальной СК.
\en The placement that the instance solid takes in global space.
\return \ru Новый экземпляр тела, зарегистрированный в аппарате контроля соударений.
@@ -94,6 +96,25 @@ public:
instance does not belong to any component.
*/
cdet_item AddInstance( cdet_item compItem, cdet_item solidItem, const MbPlacement3D & place );
/**
\brief \ru Добавить новый экземпляр тела по образцу в компонент контроля соударений.
\en Add a new instance of a reused solid into the component. \~
\param[in] compItem - \ru Компонент, которому будет принадлежать экземпляр.
\en A component to witch the instance will belong.
\param[in] mbItem - \ru Оригинальное тело, по которому изготавливается экземпляр.
\en An original solid by which the instance is made.
\param[in] place - \ru Положение, которое занимает тело экземпляра в глобальной СК.
\en The placement that the instance solid takes in global space.
\param[in] appItem - \ru Геометрический объект пользователя. \en User geometric item.
\return \ru Новый экземпляр тела, зарегистрированный в сцене контроля соударений.
\en The new solid instance registered in the detector.
\note \ru Значение compItem может быть нулевым. Значит просто вставка не будет
принадлежать ни одному компоненту.
\en The value compItem can be CDET_NULL. This just means that the
instance does not belong to any component.
*/
cdet_item AddInstance( cdet_item compItem, const MbItem* mbItem
, const MbPlacement3D & place, cdet_app_item appItem = CDET_APP_NULL );
/**
\brief \ru Удалить геометрический объект из набора для контроля столкновений.
\en Remove a geometric object from the set of collision detection. \~
@@ -142,13 +163,13 @@ public: // the functions below can be deprecated in future version.
/// \ru Номер твердотельной модели или луча, зарегистрированной в детекторе. \en An index of solid model or ray registered in the detector.
size_t SolidIndex( cdet_item cItem ) const;
/// \ru Вычисление минимального расстояния между объектами (см.функцию #SetDistanceTracking) \en Calculation of minimal distance between objects (see the function #SetDistanceTracking)
cdet_result DistanceQuery( MbProximityParameters & ) const;
cdet_result DistanceQuery( CdProximityParameters & ) const;
/// \ru Вычисление минимального расстояния между объектами
cdet_result DistanceQuery( cdet_item, cdet_item, MbProximityParameters & ) const;
cdet_result DistanceQuery( cdet_item, cdet_item, CdProximityParameters & ) const;
/// \ru Выключить из рассмотрения все модели. \en Exclude all models from consideration.
void FlushSolids();
/// \ru Выдать иерархическое представление тела (CDET_NULL = отсутствие такового в списке). \en Get the hierarchical representation of the solid (CDET_NULL means that the solid is not in the list).
cdet_item GetHRepSolid ( const MbLumpAndFaces & ) const;
cdet_item GetHRepSolid( const MbLumpAndFaces & ) const;
/// \ru Задать барьер для отличия касания от пересечения. \en Set the barrier for the difference between the touch and the intersection.
void SetTouchTolerance( double lTol );
/// \ru Вкл./выкл. приближенного вычисления пересечений тел \en On/off approximated calculation of intersections of solids
@@ -159,24 +180,23 @@ public: // the functions below can be deprecated in future version.
void SetDistanceTracking( const MbLumpAndFaces &, const MbLumpAndFaces & );
/// \ru Обновить текущее положение тела или луча с индексом solIdx. \en Update current placement of solid or ray with index solIdx.
void SetPlacement( size_t solIdx, const MbPlacement3D & );
// \ru Объявление конструктора копирования и оператора присваивания без реализации, чтобы не было присваивания по умолчанию. \en The declaration without implementation of the copy-constructor and assignment operator to prevent an assignment by default.
OBVIOUS_PRIVATE_COPY( MbCollisionDetectionUtility );
/// \ru Экспортировать сцену поиска столкновений в модель C3D. \en Export collision detection scene into C3D model.
MbeConvResType ExportToC3D(const TCHAR * c3dFile);
public: /*
Deprecated and testing functions
*/
void SetCallback( CDM_exam_func );
void SetCallback( CDM_exam_func );
// Use AppItem() insead this
/*DEPRECATE_DECLARE*/ cdet_app_item Component(size_t solIdx) const; // It in use yet.
// The func is deprecated. Instead, use CheckCollisions
DEPRECATE_DECLARE cdet_result InterferenceDetect( void * formalPar = nullptr ) const;
// The func is deprecated. Use SetDistanceTracking instead.
void SetDistanceComputationObjects( const MbLumpAndFaces &, const MbLumpAndFaces & );
void SetDistanceComputationObjects( const MbLumpAndFaces &, const MbLumpAndFaces & );
// The func is deprecated. Use AddSolid/AddItem instead.
size_t AddLump( const MbLumpAndFaces & );
size_t AddLump( const MbLumpAndFaces & );
// For testing purposes
bool IsEmpty( cdet_item ) const;
bool IsEmpty( cdet_item ) const;
// For testing purposes
const MtRefItem * _ComputeBVTree( cdet_item );
@@ -187,16 +207,17 @@ private:
\en Add an object of geometric model to the set of collision detection control. \~
\return \ru Объект в наборе для контроля столкновений. \en Object of the set of collision detection. \~
*/
cdet_item AddItem( const MbItem & );
cdet_item AddItem( const MbItem & );
// Set an assembly to detect collisions between its elements
void SetAssembly( const MbAssembly & );
void UpdateGeometry();
void SetAssembly( const MbAssembly & );
void UpdateGeometry();
OBVIOUS_PRIVATE_COPY( CdCollisionDetection );
};
//----------------------------------------------------------------------------------------
// Default implemention of the call CheckCollisions.
//---
inline cdet_result MbCollisionDetectionUtility::CheckCollisions()
inline cdet_result CdCollisionDetection::CheckCollisions()
{
cdet_query_result defaultQuery;
return CheckCollisions( defaultQuery );
@@ -224,6 +245,9 @@ MATH_FUNC(cdet_bvt_pair) BvtSubNodes( cdet_item, cdet_bvt_node );
//---
MATH_FUNC(void) GetOrientedBox( cdet_item, cdet_bvt_node, MbMatrix3D & );
// deprecated typename.
using MbCollisionDetectionUtility = CdCollisionDetection;
#endif // __CDET_UTILITY_H
/** \} */
+2 -2
View File
@@ -357,7 +357,7 @@ struct C3DConverterDebugSettings {
\en Demanded for export to formats having one string field for product inetifier. \~
\ingroup Exchange_Interface
*/
struct IProductIdMaker : public MbRefItem
struct CONV_CLASS IProductIdMaker : public MbRefItem
{
virtual c3d::string_t operator()( const MbProductInfo& ) const = 0;
};
@@ -521,7 +521,7 @@ public:
virtual SPtr<IC3DCharEncodingTransformer> GetUserCharEncodingTransformer() const { return SPtr<IC3DCharEncodingTransformer>( nullptr ); }
/// \ru Создавать раскрашенные копии компонент при импорте. \en Create colored replicas of components on import.
DEPRECATE_DECLARE virtual bool ImportComponentsWithColoredReplica() { return false; }
virtual bool ImportComponentsWithColoredReplica() { return false; }
}; // IConvertorProperty3D
+6 -5
View File
@@ -12,6 +12,7 @@
#include <reference_item.h>
#include <math_define.h>
#include <tool_cstring.h>
@@ -23,7 +24,7 @@
\en Called on import once if the model contains contains more than one configurations. \~
*/
// ---
class IConfigurationSelector : public MbRefItem
class CONV_CLASS IConfigurationSelector : public MbRefItem
{
public:
// \ru Конструктор по умолчанию. \en Default constructor.
@@ -61,7 +62,7 @@ public:
\en EXPEREIMENTAL. \~
*/
// ---
class IAttributeNamesCollector : public MbRefItem
class CONV_CLASS IAttributeNamesCollector : public MbRefItem
{
public:
virtual void AddAttributeName( const c3d::string_t& configurationName ) = 0;
@@ -80,7 +81,7 @@ public:
\en Using methods of the IConvertorProperty3D interface recommended. \~
*/
// ---
class IScaleRequestor : public MbRefItem
class CONV_CLASS IScaleRequestor : public MbRefItem
{
public:
virtual double ScaleRequest() = 0;
@@ -97,7 +98,7 @@ public:
\en Using methods of the IConvertorProperty3D interface recommended. \~
*/
// ---
class IStitchRequestor : public MbRefItem
class CONV_CLASS IStitchRequestor : public MbRefItem
{
public:
virtual bool StitchRequest() = 0;
@@ -123,7 +124,7 @@ public:
\en Metadata transfer. \~
*/
// ---
class IConverterMetadataReceiver : public MbRefItem
class CONV_CLASS IConverterMetadataReceiver : public MbRefItem
{
public:
virtual bool InitMetadataForItem(const c3d::string_t& category, const c3d::string_t& nameInCategory, const c3d::string_t& contentType) = 0;
+2 -2
View File
@@ -59,8 +59,8 @@ public:
bool IsSimilar( const MbSpineData & ) const; ///< \ru Являются ли объекты подобными \en Whether the objects are similar
bool SetEqual ( const MbSpineData & ); ///< \ru Сделать равным \en Make equal
/// \ru Перестроить объект по журналу построения. Для перестроения проволочного каркаса. \en Rebuild object according to the history tree. For rebuilding the wire frame.
void RebuildItem();
/// \ru Перестроить объект по журналу построения. Для перестроения проволочного каркаса. Вернуть true в случае успешного перестроения. \en Rebuild object according to the history tree. For rebuilding the wire frame. Return true if rebuild has been finished successfully. \~
bool RebuildItem();
/// \ru Получить направляющую кривую. \en Get the spine curve. \~
const MbCurve3D * GetSpineCurve() const { return _spineCurve; }
+14 -2
View File
@@ -127,11 +127,13 @@ MATH_FUNC (MbCreator *) CreateExtensionShell( MbFaceShell * solid
Может быть удлинена на заданное расстояние указанная грань.
К указанной грани может быть добавлена гладко стыкующаяся с ней грань.
К указанной грани может быть добавлена грань, полученная выдавливанием крайнего ребра в заданном направлении.
Если у исходной оболочки ошибочно флаг замкнутости равен true, то в ходе операции его значение будет изменено на false.
Одновременно с построением оболочки функция создаёт её строитель.\n
\en Construct the extended face of a shell. An extension can be performed in the following ways:
The specified faces can be extended on the given distance.
A smoothly connected face can be added to the given face.
A face obtained by extrusion of a boundary edge in the given direction can be added to the specified face.
If the original shell mistakenly has the closure flag set to true, then its value will be changed to false during the operation.
The function simultaneously creates the shell and its constructor.\n \~
\param[in] solid - \ru Исходная оболочка.
\en The initial shell. \~
@@ -139,8 +141,18 @@ MATH_FUNC (MbCreator *) CreateExtensionShell( MbFaceShell * solid
\en Mode of copying the initial shell. \~
\param[in] parameters - \ru Параметры построения.
\en Parameters of a shell creation. \~
\param[out] res - \ru Код результата операции.
\en Operation result code. \~
\param[out] res - \ru Код результата операции возвращает:
rt_SolidError, если исходная оболочка замкнута или пустая.
rt_PrepareError, если заданы ошибочные параметры операции.
rt_TooSmallExtension, если величина удлинения слишком мала.
rt_VertexExtensionError, если не удалось продлить до вершины из-за малой величины продления.
rt_SurfaceExtensionError, если не удалось продлить до поверхности из-за малой величины продления. \~
\en Operation result code return:
rt_SolidError, if the original shell is closed or empty.
rt_PrepareError, if incorrect operation parameters are set.
rt_TooSmallExtension, if the extension value is too small.
rt_VertexExtensionError, if it was not possible to extend to the vertex due to the small amount of extension.
rt_SurfaceExtensionError, if it was not possible to extend to the surface due to the small amount of extension. \~
\param[out] shell - \ru Построенная оболочка.
\en The resultant shell. \~
\result \ru Возвращает строитель оболочки.
+2 -1
View File
@@ -305,7 +305,8 @@ public :
\en The number of cross points. \~
*/
template <class ParamsVector>
size_t SegmentIntersection( const MbLineSegment & lineSegment, double xEps, double yEps, ParamsVector & ttPolyline, ParamsVector & ttSegment ) const;
MATH_FUNC( size_t ) SegmentIntersection( const MbLineSegment & lineSegment, double xEps, double yEps, ParamsVector & ttPolyline, ParamsVector & ttSegment ) const;
/// \ru Определить положение точки относительно кривой при известном индексе ближайшего сегмента. \en Define the point position relative to the curve when the nearest segment index is known.
bool PointRelative( const MbCartPoint & pnt, ptrdiff_t nearestSegmentIndex, double eps, MbeItemLocation & iLoc ) const;
/// \ru Определить номер сегмента (или пару номеров сегментов) по параметру на ломаной. \en Define segment index (or pair of segment indices) by parameter on polyline.
+1 -11
View File
@@ -96,7 +96,7 @@ private:
struct GCM_CLASS ItConstraintItem
{
public: /*
Constraint data inquiries
Constraint data inquiries.
*/
/// \ru Условие выравнивания \en Condition of alignment
virtual GCM_alignment AlignType() const = 0;
@@ -230,11 +230,8 @@ private: // (!) The members below will be removed in a future version (V17 or la
typedef GCM_angle_type EnAngleType;
private: // (!) The members below will be removed in a future version (V17 or later).
virtual ItGeomPtr GeomOne() const { return GeomItem(1); }
virtual ItGeomPtr GeomTwo() const { return GeomItem(2); }
virtual MbVector3D AxisOf3DAngleType() const = 0;
virtual void SetAxisOf3DAngleType( const MbVector3D & ) = 0;
MtGeomVariant GeomArgument( int geomN ) const; // Use SubGeom() instead.
private: // (!) The constants below will be removed in a future version (V17 or later).
static const GCM_angle_type at_Planar = GCM_2D_ANGLE;
@@ -254,13 +251,6 @@ private:
OBVIOUS_PRIVATE_COPY( ItConstraintItem );
};
//----------------------------------------------------------------------------------------
// \ru Геометрический аргумент ограничения \en Geometric argument of the constraint
//---
inline MtGeomVariant ItConstraintItem::GeomArgument( int geomNb ) const
{
return _LinkageItem( geomNb );
}
//----------------------------------------------------------------------------------------
// Number of geoms involved in the constraint
+53 -41
View File
@@ -37,34 +37,27 @@ typedef GCM_c_type MtMateType;
//----------------------------------------------------------------------------------------
/** \brief \ru Геометрический объект. \en Geometrical object. \~
\details \ru Геометрический объект этого типа данных, характеризуется матрицей
трансформации, которая переводит его в настоящее положение из некоторого стандартного
положения. Подразумевается, что для каждого типа объекта имеется
стандартное положение, которое, как правило, совпадает с мировой системой
координат.\n
Например, если экземпляром ItGeom является точка, то матрица TransMatrix()
задаст положение точки, как преобразование начала координат в некоторое
произвольное место пространства.\n
Если экземпляром ItGeom является жесткое тело в пространстве, то матрица TransMatrix()
\details \ru Геометрический объект, характеризуется матрицей трансформации,
которая переводит его в текущее положение из стандартного положения, совпадающего
с мировой системой координат.\n
Например, если экземпляр ItGeom представляет `точку`, то матрица TransMatrix()
выдаст перенос в текущее положение точку начала (0,0,0).\n
Если экземпляром `ItGeom` является жесткое тело в пространстве, то матрица TransMatrix()
будет служить в качестве ЛСК этого тела и задавать его положение в пространстве
моделирования.
\en Geometric object of this data type is described by a matrix
of transformation which transforms this object to real position from some
standard position. The implication is that each type of object has
a standard position which usually coincides with the global system
of coordinates. \n
of transformation which transforms this object to real position from a standard position
which coincides with the global coord system.\n
For example, if ItGeom is a point, then the matrix TransMatrix()
sets the position of a point as the transformation of the origin to some
arbitrary place of the space.\n
If ItGeom is rigid solid in the space, then the matrix TransMatrix()
can be used as LCS of this solid and set its position in the space
of modeling. \~
is translation to the current location from the origin (0,0,0).\n
If `ItGeom` is rigid solid in the space, then the matrix TransMatrix()
can be used as LCS of this solid and set its position in the space of modeling. \~
\ingroup GCM_3D_ObjectAPI
*/
//---
struct GCM_CLASS ItGeom
{
mutable MtGeomId objectId; // (!) Будет закрыто
mutable MtGeomId objectId; // a cach for internal use only.
ItGeom() : objectId( GCM_NULL ) {}
/// \ru Тип геометрического объекта. \en Type of geometric object. \~
virtual GCM_g_type GeomType() const { return GCM_LCS; }
@@ -132,13 +125,17 @@ class MtParGeom;
class GCM_CLASS MtGeomVariant
{
public:
MtGeomVariant() : m_value( nullptr ) {}
MtGeomVariant( const MbCartPoint3D & );
MtGeomVariant( const MtUnifiedGeom & );
MtGeomVariant() : m_value( nullptr ) {} // Default constructor.
MtGeomVariant( const MtGeomVariant & );
MtGeomVariant( MtGeomVariant && gVar ) noexcept : m_value( nullptr ) { TakeOn( gVar.m_value ); gVar.m_value = nullptr; }
MtGeomVariant( MtGeomVariant && gVar ) noexcept : m_value( nullptr ) { TakeOn( gVar.m_value ); gVar.m_value = nullptr; }
MtGeomVariant( const MbCartPoint3D & ); // Point constructor.
MtGeomVariant( const MbAxis3D & );
MtGeomVariant( const MtUnifiedGeom & );
MtGeomVariant( const MtParGeom & g ) : m_value( nullptr ) { Assign(g); }
MtGeomVariant( const GCM_g_type );
MtGeomVariant( const GCM_g_type );
// Constructs rotation surface: cylinder, cone, torus, sphere.
MtGeomVariant( const GCM_g_type gType, const MbCartPoint3D& org, const MbVector3D& axis, double radius );
MtGeomVariant & operator = ( const MtGeomVariant & gVar ) { return Assign( gVar ); }
/// \ru Переносное присвоение. \en Moving assignment.
MtGeomVariant & operator = ( MtGeomVariant && gVar ) noexcept { TakeOn( gVar.m_value ); gVar.m_value = nullptr; return *this; }
@@ -154,27 +151,33 @@ public:
/// \ru Выдать положение детали в виде ортонормированной ЛСК. \en Get position of part as orthonormalized LCS.
MbPlacement3D & GetPlacement( MbPlacement3D & pl ) const;
/// \ru Является ли объект пустым. \en Get logic value whether the object is empty.
bool IsNull() const;
bool IsNull() const;
/// \ru Проверить равны ли объекты геометрическию. \en Check if objects are geometrically equal.
bool IsEqualTo( const MtGeomVariant &, const MbGeomTol & ) const;
bool IsEqualTo( const MtGeomVariant &, const MbGeomTol & ) const;
/// \ru Проверить равны ли структуры геометрической записи (gType,O,Z,X,Y,R1,R2). \en Check if corresponding elements of geometric records are equal (gType,O,Z,X,Y,R1,R2).
bool IsEqualTuples( const MtGeomVariant & gVar, const MbGeomTol & gTol ) const;
bool IsEqualTuples( const MtGeomVariant & gVar, const MbGeomTol & gTol ) const;
/// \ru Выдать ось вращения, если она свойственна геометрическому объекту (цилиндр, тор, конус). \en Output the axis of rotation for geometry such as cylinder, torus, cone.
MbAxis3D Axis() const;
/// \ru Радиус сферы, цилиндра или "большой" радиус тора или конуса. \en Radius of the sphere, cylinder, major radius of the tori or cone.
double RadiusA() const;
/// \ru "Малый" радиус тора или конуса. \en Minor radius of the tori or cone.
double RadiusB() const;
public: /* Assigning methods.
*/
MtGeomVariant & Assign( const MtGeomVariant & );
MtGeomVariant & Assign( const MtParGeom & );
MtGeomVariant & Assign( GCM_g_type, const MbCartPoint3D & org, const MbVector3D & zAxis
, const MbVector3D & xAxis, double r1 = 0.0, double r2 = 0.0 );
MtGeomVariant & Assign( const MtGeomVariant & );
MtGeomVariant & Assign( const MtParGeom & );
MtGeomVariant & Assign( GCM_g_type, const MbCartPoint3D & org, const MbVector3D & zAxis
, const MbVector3D & xAxis, double r1 = 0.0, double r2 = 0.0 );
template<class GeomDS>
MtGeomVariant & Assign( const GeomDS * );
MtGeomVariant & Reset(); ///< \ru Задать как тип GCM_NULL_GTYPE. \ru Set as GCM_NULL_GTYPE type. \~
MtGeomVariant & SetAsPoint( const MbCartPoint3D & );
MtGeomVariant & SetAsLine( const MbCartPoint3D & org, const MbVector3D & dir );
MtGeomVariant & SetAsPlane( const MbCartPoint3D & org, const MbVector3D & normal );
MtGeomVariant & SetAsPlane( const MbPlacement3D & );
MtGeomVariant & SetAsMarker( const MbCartPoint3D & org, const MbVector3D & zAxis, const MbVector3D & xAxis );
MtGeomVariant & Transform( const MbMatrix3D & );
MtGeomVariant & Assign( const GeomDS * );
MtGeomVariant & Reset(); ///< \ru Задать как тип GCM_NULL_GTYPE. \ru Set as GCM_NULL_GTYPE type. \~
MtGeomVariant & SetAsPoint( const MbCartPoint3D & );
MtGeomVariant & SetAsLine( const MbCartPoint3D & org, const MbVector3D & dir );
MtGeomVariant & SetAsPlane( const MbCartPoint3D & org, const MbVector3D & normal );
MtGeomVariant & SetAsPlane( const MbPlacement3D & );
MtGeomVariant & SetAsMarker( const MbCartPoint3D & org, const MbVector3D & zAxis, const MbVector3D & xAxis );
MtGeomVariant & Transform( const MbMatrix3D & );
public: /* Methods for internal use.
*/
@@ -451,14 +454,23 @@ inline void MtMatingGeometry::SetNull()
\en Get a geometric object of type GCM_geom from type of ItGeom *. \~
*/
//--
GCM_FUNC( GCM_geom ) GCM_GeomId( GCM_system gSys, const ItGeom * gPtr );
GCM_FUNC(GCM_geom) GCM_GeomId(GCM_system gSys, const ItGeom* gPtr);
//----------------------------------------------------------------------------------------
/** \brief \ru Получить интерфейс геометрического объекта 'ItGeom' по дескриптору.
\en Get an interface object ItGeom of geometric entity by the descriptor. \~
\note Internal use only
*/
//--
GCM_FUNC(ItGeom*) GCM_GeomItem(GCM_system gSys, GCM_geom geomId);
//----------------------------------------------------------------------------------------
/** \brief \ru Получить запись геометрического объекта по типу MtGeomVariant.
\en Get the geometric record of the variant data type.
*/
// ---
GCM_FUNC( GCM_g_record ) GCM_GeomRecord( const MtGeomVariant & );
GCM_FUNC( GCM_g_record ) GCM_GeomRecord(const MtGeomVariant&);
//----------------------------------------------------------------------------------------
/** \brief \ru Конвертировать структуру MtMatingGeometry в аргумент ограничения.
+21 -52
View File
@@ -212,11 +212,11 @@ class GCM_CLASS MtArgument
public:
/// \ru Конструктор аргумента, как геометрический объект. \en Constructor of argument as geometric object.
MtArgument();
MtArgument( const MtArgument & );
MtArgument(const MtArgument&);
/** \brief \ru Конструктор аргумента, как геометрический объект.
\en Constructor of argument as geometric object. \~
*/
MtArgument( ItGeom * );
MtArgument(ItGeom*);
/** \brief \ru Конструктор аргумента, как "геометрический объект в кластере".
\en Constructor of argument as "geometric object in the cluster". \~
@@ -248,27 +248,29 @@ public:
Note that if G = I - the identity matrix, then a geometric object
has "standard position". \~
*/
MtArgument( ItGeom * cluster, MtGeomVariant refGeom );
MtArgument(ItGeomPtr cluster, MtGeomVariant refGeom);
~MtArgument();
public:
/// \ru Геометрический объект, вычисляемый в системе ограничений. \en Geometric object calculated in the constraint system.
const ItGeom * Geom() const { return m_geom; }
ItGeomPtr NonConstGeom() { return m_geom; } // For internal use only.
ItGeomPtr Geom() const { return m_geom; }
/** \brief \ru Геометрическое значение аргумента, заданное в ЛСК объекта ItGeom * Geom().
\en Geometric value of the argument specified in the LCS of the object ItGeom * Geom().
*/
MtGeomVariant RefGeom() const;
MtGeomVariant SubGeom() const;
/// \ru Тип геометрии. \en Geometry type.
MtGeomType GeomType() const;
MtGeomType GeomType() const;
/// \ru Простой аргумент - не задан, как часть кластера. \en A simple argument, i.e. is not given as part of a cluster. \~
bool Simple() const;
bool Simple() const;
/// \ru Выдать положение геометрического объекта в виде ЛСК. \en Get a position of geometric object as its LSC.
void GetPlacement( MbPlacement3D & ) const;
void GetPlacement( MbPlacement3D & ) const;
/// \ru Оператор присваивания. \en Assignment operator.
MtArgument & operator = ( const MtArgument & );
MtArgument& operator = ( const MtArgument & );
/// \ru Оператор равенства. \en Equality operator.
inline bool operator == ( const ItGeom * ) const;
inline bool operator == ( const ItGeom * ) const;
public:
MtGeomVariant RefGeom() const; // deprecated. use SubGeom().
private:
SPtr<ItGeom> m_geom; // Geometric object of the constraint system (often, it is a rigid body).
@@ -289,39 +291,6 @@ inline bool MtArgument::operator == ( const ItGeom * geom ) const
class MtConstraintSystem;
//----------------------------------------------------------------------------------------
/// \ru Итератор, обходящий систему ограничений. \en Iterator traversing the constraint system.
//---
/*
class GCM_CLASS ItConstraintIter
{
private:
CNodeIterator * m_cIter;
const MtConstraintSystem * m_gcSystem;
public:
ItConstraintIter();
ItConstraintIter( const ItConstraintIter & );
ItConstraintIter & operator = ( const ItConstraintIter & );
~ItConstraintIter();
public:
ItConstraintItem * Get() const;
ItConstraintIter & Set( const MtConstraintSystem *, CNodeIterator & );
const ItConstraintIter & Next();
bool EqualTo( const ItConstraintIter & ) const;
public:
//operator CNodeIterator& () { return *impl; }
ItConstraintItem * operator*() const { return Get(); }
// prefix operator
const ItConstraintIter & operator++() { return Next(); }
bool operator ==( const ItConstraintIter & iter ) const { return EqualTo( iter ); }
bool operator !=( const ItConstraintIter & iter ) const { return !EqualTo( iter ); }
}; // MtConstraintIter
*/
//----------------------------------------------------------------------------------------
//
// ---
@@ -337,12 +306,12 @@ class MtBlackboxManager; // Internal implementation of Blackbox manager.
//----------------------------------------------------------------------------------------
/** \brief \ru Геометрический решатель.
\en Geometric constraint solver. \~
\details \ru Интерфейс геометрического решателя. Клиентское приложение может с
работать любым количеством систем ограничений, для каждой из них заводится по
одному экземпляру решателя с помощью вызова #CreateSolver.
\en Interface of geometric solver. Client application can
run any count of constraint systems, for each of them is put
one copy of the solver by calling #CreateSolver. \~
\details \ru Интерфейс геометрического решателя. Клиентское приложение может работать
с любым количеством систем ограничений, для каждой из них заводится по одному экземпляру
решателя с помощью вызова #GCM_CreateSolver.
\en Interface of geometric solver. Client application can run any number
of constraint systems, for each of them is put one copy of the solver
by calling #GCM_CreateSolver. \~
\ingroup GCM_3D_ObjectAPI
*/
@@ -350,8 +319,8 @@ class MtBlackboxManager; // Internal implementation of Blackbox manager.
class GCM_CLASS MtGeomSolver: public MtRefItem
{
/**
\ru \name Функции задания системы сопряжений
\en \name Definition functions of the constraint system
\ru \name Функции задания системы сопряжений.
\en \name Definition functions of the constraint system.
\{
*/
public:
+14 -14
View File
@@ -132,29 +132,29 @@ class GCM_CLASS MtBoxConstraint : public MtRefItem
, public ItConstraintItem
{
using MateMarker = MtTestBox::MateMarker;
SPtr<MtTestBox> box1; // \ru Кирпич 1. \en Box 1.
SPtr<MtTestBox> box2; // \ru Кирпич 2. \en Box 2.
MtTestBox::MateMarker side1; // \ru Маркер сопряжения 1. \en Marker of mate 1.
MtTestBox::MateMarker side2; // \ru Маркер сопряжения 2. \en Marker of mate 2.
GCM_alignment m_alignType; // \ru Условие выравнивания. \en Condition of alignment.
MtMateType m_cType; // \ru Тип сопряжения. \en The mate type.
double m_dValue; // \ru Расстояние. \en Distance.
MtResultCode3D m_resCode; // Error code of the mate.
SPtr<MtTestBox> box1; // \ru Кирпич 1. \en Box 1.
SPtr<MtTestBox> box2; // \ru Кирпич 2. \en Box 2.
MateMarker side1; // \ru Маркер сопряжения 1. \en Marker of mate 1.
MateMarker side2; // \ru Маркер сопряжения 2. \en Marker of mate 2.
GCM_alignment m_alignType; // \ru Условие выравнивания. \en Condition of alignment.
MtMateType m_cType; // \ru Тип сопряжения. \en The mate type.
double m_dValue; // \ru Расстояние. \en Distance.
GCM_result m_errCode; // Error code of the mate.
public:
MtBoxConstraint( MtTestBox & b1, MateMarker s1, MtTestBox & b2, MateMarker s2, TMParameters );
public: // \ru Запросы (const-методы) \en Requests (const-methods).
virtual GCM_alignment AlignType() const { return m_alignType; } // \ru Выдать параметр условия выравнивания \en Get the parameter of alignment condition
virtual GCM_alignment AlignType() const { return m_alignType; } // \ru Выдать параметр условия выравнивания \en Get the parameter of alignment condition
virtual GCM_angle_type AngleType() const { return GCM_NONE_ANGLE; } // \ru Выдать тип угла (3D или планарный) \en Get the angle type (3D or planar)
virtual GCM_geom_axis AxisOfPlanarAngle() const { return GCM_geom_axis(); } // \ru Выдать ось для планарного углового сопряжения, заданную в ЛСК некоторого тела \en Get the axis for planar angular mate. Axis is given in the LCS of some solid
virtual MbVector3D AxisOf3DAngleType() const { return MbVector3D::zero; } // \ru Взять ось для планарного углового сопряжения \en Get the axis for planar angular mate
virtual MtMateType ConstraintType() const { return m_cType; } // \ru Выдать тип сопряжения \en Get the mate type
virtual ItGeomPtr GeomItem( int nb ) const { return (nb==1)? box1.get(): box2.get(); } // \ru Выдать первый сопрягаемый объект \en Get the first mating object
virtual double DimParameter() const { return m_dValue; } // \ru Выдать вещественный параметр \en Get the real parameter
virtual ItGeomPtr GeomItem( int nb ) const { return (nb==1)? box1.get(): box2.get(); } // \ru Выдать первый сопрягаемый объект \en Get the first mating object
virtual double DimParameter() const { return m_dValue; } // \ru Выдать вещественный параметр \en Get the real parameter
virtual GCM_tan_choice TangencyChoice() const { return GCM_TAN_NONE; } // \ru Выдать вариант касания \en Get the tangency choice
/// \ru Диагностический код ошибки, прикрепленный к данному ограничению. \en Diagnostic error code attached to this constraint.
virtual MtResultCode3D ErrorCode() const { return m_resCode; }
virtual GCM_result ErrorCode() const { return m_errCode; }
virtual VERSION Version() const { return GetCurrentMathFileVersion(); } // \ru Выдать версию сопряжения, которая совпадает с версией потока \en Get the mate version which same as the stream version
public:
@@ -162,11 +162,11 @@ public:
public: // \ru Методы для обратной связи (задающие) \en Callback methods
/// \ru Задать код ошибки для неудовлетворенного сопряжения \en Set the error code for unsatisfied mate
virtual void SetErrorCode( MtResultCode3D res ) { m_resCode = res; }
virtual void SetErrorCode( MtResultCode3D res ) { m_errCode = res; }
/// \ru Задать ось для углового сопряжения с трехмерным типом измерения; \en Set axis for angular mate with three-dimensional type of dimension;
virtual void SetAxisOf3DAngleType( const MbVector3D & /*axis*/ ) { /*planarang.axis = axis;*/ }
public: // \ru Методы для Smart-указателей \en The methods for Smart-pointers
public: // \ru Методы для Smart-указателей \en The methods for Smart-pointers.
virtual refcount_t AddRef() const { return MtRefItem::AddRef(); }
virtual refcount_t Release() const { return MtRefItem::Release(); }
+2 -1
View File
@@ -127,7 +127,7 @@ typedef enum
, GCM_CONCENTRIC = 4 ///< \ru Концентричность двух объектов, имеющих ось или центр. \en Concentricity of two objects having a center or an axis.
, GCM_DISTANCE = 5 ///< \ru Линейное размер между объектами. \en Linear dimension between objects.
, GCM_ANGLE = 6 ///< \ru Угловой размер между векторными объектами. \en Angular dimension between directed objects (vectors).
, GCM_TRANSMITTION = 9 ///< \ru Механическая передача. \en Mechanical transmission.
, GCM_TRANSMISSION = 9 ///< \ru Механическая передача. \en Mechanical transmission.
, GCM_CAM_MECHANISM = 10 ///< \ru Кулачковый механизм. \en Cam mechanism.
, GCM_SYMMETRIC = 11 ///< \ru Симметричность. \en Symmetry.
, GCM_DEPENDENT = 14 ///< \ru Зависимый объект. \en Dependent object.
@@ -661,6 +661,7 @@ typedef GCM_alignment MtAlignType;
typedef GCM_g_type MtGeometryType;
typedef GCM_result MtResultCode3D;
static const GCM_c_type GCM_TRANSMITTION = GCM_TRANSMISSION;
static const GCM_result mtResCode_Ok = GCM_RESULT_Ok;
static const GCM_result mtResCode_SystemError = GCM_RESULT_Error;
static const GCM_result mtResCode_Error = GCM_RESULT_Error;
+199 -200
View File
@@ -391,206 +391,6 @@ struct static_pair: public static_array<Elem,2>
}
};
//----------------------------------------------------------------------------------------
/**
\brief \ru Динамический контейнер для хранения элементов упорядоченного множества.
\en Dynamic container for storing elements of an ordered set.
\details
\ru Тип элемента контейнера должен иметь операторы порядка. Не стоит путать этот
тип контейнера с set или map. Он вовсе не обязан всегда поддерживаться в отсортированном
состоянии, а только тогда, когда это закажут (с кэшированием алгоритма сортировки).
Гарантируется, что вектор отсортирован сразу после вызова функций get_sorted или sort.
Константные методы, а также метод erase не нарушают сортировки.\n
\en Type of container element must have order operators. Do not confuse this
type of container with a set or map. It is not obliged always be supported in a sorted
state, and only when it is needed (with caching of sorting algorithm). It is guaranteed
that the vector is sorted immediately after the function call get_sorted or sort.
Const methods and the erase method does not break sorting. \n \~
\par \ru Про эффективность
Часто сортированный вектор оказывается более эффективным, чем std::map или std::set,
особенно если добавление/удаление элементов массива осуществляется серийно и достаточно
редко перемежаются, с запросами быстрого (бинарного) поиска элемента или его места по
порядку. В отличие от map или set минимально дефрагментируется память и не требуется
избыточной информации для хранения указателей (может занимать в 4 раза меньше памяти).
Для быстрых запросов можно применять стандартные алгоритмы, такие
как std::binary_search, std::lower_bound и т.п.
\en About efficiency
Often sorted vector is more effective than
std::map or std::set especially when adding/removing elements
of the array is standard and is rarely interspersed
with queries quickly (binary) search of element or its place by
the order. In contrast to the map or set minimal defragmented
memory and does not require excess information for storage of pointers
(can occupy memory in less than 4 times).
For fast queries, can use standard algorithms such
as std::binary_search, std::lower_bound etc. \~
*/
//---
template<class KeyType, class _Pr = std::less<KeyType> > // \ru KeyType - тип элемента с операторами порядка "<" \en KeyType - the element type with the operators of order "<"
class sorting_array
{
public:
typedef std::vector<KeyType> container_type;
typedef typename container_type::value_type value_type;
typedef typename container_type::size_type size_type;
typedef typename container_type::const_iterator iterator;
typedef typename container_type::iterator _iterator;
typedef std::pair<iterator,iterator> iter_range;
typedef _Pr key_compare; // \ru отношение порядка (предикат) \en order relation (predicate)
public:
sorting_array() : m_vector(), m_sorted( true ) {}
public:
iter_range get_sorted() { sort(); return iter_range(m_vector.begin(), m_vector.end()); }
iter_range range() const { return iter_range(m_vector.begin(), m_vector.end()); }
const KeyType & sorted_back() { sort(); return m_vector.back(); }
bool empty() const { return m_vector.empty(); }
iterator begin() const { return m_vector.begin(); }
iterator end() const { return m_vector.end(); }
_iterator _begin() { return m_vector.begin(); }
_iterator _end() { return m_vector.end(); }
const KeyType & front() const { return m_vector.front(); }
const KeyType & back() const { return m_vector.back(); }
void erase( iterator );
void erase( iterator f, iterator l );
bool is_sorted() const { return m_sorted; }
iterator insert( iterator _whereItr, const KeyType & val ); // \ru вставить элемент перед позицией whereItr \en insert element before position whereItr
template <class InputIterator>
void insert( iterator position, InputIterator first, InputIterator last )
{
m_vector.insert( position, first, last );
m_sorted = false;
}
template <class InputIterator>
void assign ( InputIterator first, InputIterator last )
{
m_vector.assign( first, last );
m_sorted = false;
}
void resize( size_t n, const KeyType & val );
void reserve ( size_t n ) { m_vector.reserve( n ); }
void push_back( const KeyType & val );
void sort()
{
if ( !m_sorted )
{
std::sort( m_vector.begin(), m_vector.end(), _Pr() );
m_sorted = true;
}
}
void clear() { m_vector.clear(); }
size_t size() const { return m_vector.size(); }
KeyType & operator[] ( size_t n ) { PRECONDITION( n < m_vector.size() ); return m_vector[n]; }
const KeyType & operator[] ( size_t n ) const { PRECONDITION( n < m_vector.size() ); return m_vector[n]; }
private:
container_type m_vector;
bool m_sorted;
private:
sorting_array( const sorting_array & ); // \ru реализовать по необходимости \en implement if necessary
sorting_array & operator = ( const sorting_array & ); // \ru реализовать по необходимости \en implement if necessary
};
//----------------------------------------------------------------------------------------
//
// ---
template<class KeyType, class _Pr >
void sorting_array<KeyType,_Pr>::push_back( const KeyType & val )
{
m_sorted = m_vector.empty() ? true : m_sorted && _Pr()( m_vector.back(), val );
m_vector.push_back( val );
}
//----------------------------------------------------------------------------------------
//
//---
template<class KeyType, class _Pr >
void sorting_array<KeyType,_Pr>::erase( iterator ersItr )
{
m_vector.erase( m_vector.begin() + (ersItr - begin()) );
}
//----------------------------------------------------------------------------------------
//
//---
template<class KeyType, class _Pr >
void sorting_array<KeyType,_Pr>::erase( iterator f, iterator l )
{
typename container_type::iterator first, last;
first = last = m_vector.begin();
std::advance( first, std::distance(begin(),f) ); // convert from const-iterator to non-const
std::advance( last, std::distance(begin(),l) );
m_vector.erase( first, last );
}
//----------------------------------------------------------------------------------------
// \ru Вставить элемент перед позицией whereItr \en Insert element before position whereItr
//---
template<class KeyType, class _Pr >
typename sorting_array<KeyType,_Pr>::iterator
sorting_array<KeyType,_Pr>::insert( iterator _whereItr, const KeyType & val )
{
typename container_type::iterator whereItr = m_vector.begin();
std::advance( whereItr, std::distance(begin(),_whereItr) ); // \ru перевод из конст-итератора в неконст \en convert from const-iterator to non-const
// \ru Далее проверяем не нарушает ли новая вставка упорядоченности массива \en Next, whether new insert does not break ordering of the array
if ( m_sorted && (_whereItr != m_vector.end()) )
{
m_sorted = ! key_compare()( *_whereItr, val );
if ( m_sorted ) // val <= _where
{
m_sorted = ( _whereItr == m_vector.begin() ) || !key_compare()( val, *(--_whereItr) );
}
}
// \ru Вставка \en Insert
return m_vector.insert( whereItr, val );
}
//----------------------------------------------------------------------------------------
//
//---
template<class KeyType, class _Pr >
void sorting_array<KeyType,_Pr>::resize( size_t n, const KeyType & val )
{
if ( m_sorted && (m_vector.size() < n) && !m_vector.empty() )
{
m_sorted = !key_compare()( val, m_vector.back() ); // m_vector.back() <= val
}
m_vector.resize( n, val );
}
//----------------------------------------------------------------------------------------
/// \ru Проверка упорядоченности массива \en Check for ordering array
//---
template<class SortedArray>
bool check_ordering( const SortedArray & arr )
{
if ( arr.is_sorted() && !arr.empty() )
{
typename SortedArray::value_type prev( *arr.begin() );
typename SortedArray::iterator first = arr.begin()+1;
typename SortedArray::iterator last = arr.end();
for( ; first!=last; ++first )
{
if ( (*first) < prev )
{
return false; // \ru нарушен порядок следования \en order has been broken
}
prev = *first;
}
}
return true;
}
//----------------------------------------------------------------------------------------
/// \ru Обнулить структуру данных (использовать осторожно!). \en Reset the data structure (use with caution!).
//---
@@ -1226,6 +1026,205 @@ tie( Type1 & iter1, Type2 & iter2 )
}; // namespace c3d
//----------------------------------------------------------------------------------------
/**
\brief \ru Динамический контейнер для хранения элементов упорядоченного множества.
\en Dynamic container for storing elements of an ordered set.
\details
\ru Тип элемента контейнера должен иметь операторы порядка. Не стоит путать этот
тип контейнера с set или map. Он вовсе не обязан всегда поддерживаться в отсортированном
состоянии, а только тогда, когда это закажут (с кэшированием алгоритма сортировки).
Гарантируется, что вектор отсортирован сразу после вызова функций get_sorted или sort.
Константные методы, а также метод erase не нарушают сортировки.\n
\en Type of container element must have order operators. Do not confuse this
type of container with a set or map. It is not obliged always be supported in a sorted
state, and only when it is needed (with caching of sorting algorithm). It is guaranteed
that the vector is sorted immediately after the function call get_sorted or sort.
Const methods and the erase method does not break sorting. \n \~
\par \ru Про эффективность
Часто сортированный вектор оказывается более эффективным, чем std::map или std::set,
особенно если добавление/удаление элементов массива осуществляется серийно и достаточно
редко перемежаются, с запросами быстрого (бинарного) поиска элемента или его места по
порядку. В отличие от map или set минимально дефрагментируется память и не требуется
избыточной информации для хранения указателей (может занимать в 4 раза меньше памяти).
Для быстрых запросов можно применять стандартные алгоритмы, такие
как std::binary_search, std::lower_bound и т.п.
\en About efficiency
Often sorted vector is more effective than
std::map or std::set especially when adding/removing elements
of the array is standard and is rarely interspersed
with queries quickly (binary) search of element or its place by
the order. In contrast to the map or set minimal defragmented
memory and does not require excess information for storage of pointers
(can occupy memory in less than 4 times).
For fast queries, can use standard algorithms such
as std::binary_search, std::lower_bound etc. \~
*/
//---
template<class KeyType, class _Pr = std::less<KeyType> > // \ru KeyType - тип элемента с операторами порядка "<" \en KeyType - the element type with the operators of order "<"
class sorting_array
{
public:
typedef std::vector<KeyType> container_type;
typedef typename container_type::value_type value_type;
typedef typename container_type::size_type size_type;
typedef typename container_type::const_iterator iterator;
typedef typename container_type::iterator _iterator;
typedef c3d::range<iterator> iter_range;
typedef _Pr key_compare; // \ru отношение порядка (предикат) \en order relation (predicate)
public:
sorting_array() : m_vector(), m_sorted( true ) {}
sorting_array(const sorting_array&) = default;
sorting_array & operator= (const sorting_array&) = default;
public:
iter_range get_sorted() { sort(); return iter_range(m_vector.begin(), m_vector.end()); }
iter_range range() const { return iter_range(m_vector.begin(), m_vector.end()); }
const KeyType & sorted_back() { sort(); return m_vector.back(); }
bool empty() const { return m_vector.empty(); }
iterator begin() const { return m_vector.begin(); }
iterator end() const { return m_vector.end(); }
_iterator _begin() { return m_vector.begin(); }
_iterator _end() { return m_vector.end(); }
const KeyType & front() const { return m_vector.front(); }
const KeyType & back() const { return m_vector.back(); }
void erase( iterator );
void erase( iterator f, iterator l );
bool is_sorted() const { return m_sorted; }
iterator insert( iterator _whereItr, const KeyType & val ); // \ru вставить элемент перед позицией whereItr \en insert element before position whereItr
template <class InputIterator>
void insert( iterator position, InputIterator first, InputIterator last )
{
m_vector.insert( position, first, last );
m_sorted = false;
}
template <class InputIterator>
void assign ( InputIterator first, InputIterator last )
{
m_vector.assign( first, last );
m_sorted = false;
}
void resize( size_t n, const KeyType & val );
void reserve ( size_t n ) { m_vector.reserve( n ); }
void push_back( const KeyType & val );
void sort()
{
if ( !m_sorted )
{
std::sort( m_vector.begin(), m_vector.end(), _Pr() );
m_sorted = true;
}
}
void clear() { m_vector.clear(); }
size_t size() const { return m_vector.size(); }
KeyType & operator[] ( size_t n ) { PRECONDITION( n < m_vector.size() ); return m_vector[n]; }
const KeyType & operator[] ( size_t n ) const { PRECONDITION( n < m_vector.size() ); return m_vector[n]; }
private:
container_type m_vector;
bool m_sorted;
};
//----------------------------------------------------------------------------------------
//
// ---
template<class KeyType, class _Pr >
void sorting_array<KeyType,_Pr>::push_back( const KeyType & val )
{
m_sorted = m_vector.empty() ? true : m_sorted && _Pr()( m_vector.back(), val );
m_vector.push_back( val );
}
//----------------------------------------------------------------------------------------
//
//---
template<class KeyType, class _Pr >
void sorting_array<KeyType,_Pr>::erase( iterator ersItr )
{
m_vector.erase( m_vector.begin() + (ersItr - begin()) );
}
//----------------------------------------------------------------------------------------
//
//---
template<class KeyType, class _Pr >
void sorting_array<KeyType,_Pr>::erase( iterator f, iterator l )
{
typename container_type::iterator first, last;
first = last = m_vector.begin();
std::advance( first, std::distance(begin(),f) ); // convert from const-iterator to non-const
std::advance( last, std::distance(begin(),l) );
m_vector.erase( first, last );
}
//----------------------------------------------------------------------------------------
// \ru Вставить элемент перед позицией whereItr \en Insert element before position whereItr
//---
template<class KeyType, class _Pr >
typename sorting_array<KeyType,_Pr>::iterator
sorting_array<KeyType,_Pr>::insert( iterator _whereItr, const KeyType & val )
{
typename container_type::iterator whereItr = m_vector.begin();
std::advance( whereItr, std::distance(begin(),_whereItr) ); // \ru перевод из конст-итератора в неконст \en convert from const-iterator to non-const
// \ru Далее проверяем не нарушает ли новая вставка упорядоченности массива \en Next, whether new insert does not break ordering of the array
if ( m_sorted && (_whereItr != m_vector.end()) )
{
m_sorted = ! key_compare()( *_whereItr, val );
if ( m_sorted ) // val <= _where
{
m_sorted = ( _whereItr == m_vector.begin() ) || !key_compare()( val, *(--_whereItr) );
}
}
// \ru Вставка \en Insert
return m_vector.insert( whereItr, val );
}
//----------------------------------------------------------------------------------------
//
//---
template<class KeyType, class _Pr >
void sorting_array<KeyType,_Pr>::resize( size_t n, const KeyType & val )
{
if ( m_sorted && (m_vector.size() < n) && !m_vector.empty() )
{
m_sorted = !key_compare()( val, m_vector.back() ); // m_vector.back() <= val
}
m_vector.resize( n, val );
}
//----------------------------------------------------------------------------------------
/// \ru Проверка упорядоченности массива \en Check for ordering array
//---
template<class SortedArray>
bool check_ordering( const SortedArray & arr )
{
if ( arr.is_sorted() && !arr.empty() )
{
typename SortedArray::value_type prev( *arr.begin() );
typename SortedArray::iterator first = arr.begin()+1;
typename SortedArray::iterator last = arr.end();
for( ; first!=last; ++first )
{
if ( (*first) < prev )
{
return false; // \ru нарушен порядок следования \en order has been broken
}
prev = *first;
}
}
return true;
}
#endif // __GENERIC_UTILITY_H
// eof
+9 -9
View File
@@ -137,7 +137,7 @@ public:
C3D_UNUSED_PARAMETER( g );
PRECONDITION( m_graph == &g );
PRECONDITION( num[u] < num[v] );
PRECONDITION( father[v] != Graph::NullVertex() );
PRECONDITION( father[v] != g.NullVertex() );
if ( u != father[v] )
{
// Здесь vu - есть обратное ребро входящее в вершину u, которая выше, чем v в d-дереве.
@@ -146,7 +146,7 @@ public:
}
}
/// Посещение вершины: Вызывается один раз для каждой вершины, когда она впервые начинает просматриваться
/// Посещение вершины: Вызывается один раз для каждой вершины, когда она впервые начинает просматриваться.
void DiscoverNode(vertex v, const Graph& g)
{
C3D_UNUSED_PARAMETER( g );
@@ -156,14 +156,14 @@ public:
num[v] = lval[v] = m_dfsCounter++;
}
/// Вершина рассмотрена: Означает, что все исходящие ребра вершины рассмотрены
/// Вершина рассмотрена: Означает, что все исходящие ребра вершины рассмотрены.
void FinishNode(vertex u, const Graph& g)
{
PRECONDITION( m_graph == &g );
vertex v = father[u];
// СЛУЧАЙ 1: Вершина v - корневая, завершен обход fds-дерева.
if ( v == Graph::NullVertex() )
if ( v == g.NullVertex() )
{
// Оценить является ли u - точкой сочленения
// Сколько раз стартовая вершина стала папой (столько же в ней стыкуется блоков)
@@ -192,7 +192,7 @@ public:
// (!) Если вершина v не корень d-дерева, то можно утверждать, что она - есть точка сочленения;
// См. теорему 8.2. [М.О.Асанов]
if ( father[v] != Graph::NullVertex() ) // если v корневая вершина, то оценки для неё делаются в конце обхода дерева
if ( father[v] != g.NullVertex() ) // если v корневая вершина, то оценки для неё делаются в конце обхода дерева
{
m_bicompVis.CutNode( v, *m_graph );
}
@@ -239,7 +239,7 @@ public:
{
C3D_UNUSED_PARAMETER( v );
InitVisitor( g );
PRECONDITION( father[v] == Graph::NullVertex() );
PRECONDITION( father[v] == g.NullVertex() );
PRECONDITION( num[v] == 0 && lval[v] == 0 );
}
@@ -248,7 +248,7 @@ public:
{
C3D_UNUSED_PARAMETER( g );
PRECONDITION( m_graph == &g );
PRECONDITION( father[u] == Graph::NullVertex() );
PRECONDITION( father[u] == g.NullVertex() );
m_stackEdges.push_back( edge(v,u) ); // Вставить ребро vu;
father[u] = v; // зафиксируем отца для вершины u;
}
@@ -274,7 +274,7 @@ private:
m_graph = &graph;
m_dfsCounter = 1;
InitPropertyMap(num, graph, 0);
InitPropertyMap(father, graph, Graph::NullVertex());
InitPropertyMap(father, graph, graph.NullVertex());
InitPropertyMap(lval, graph, 0);
m_stackEdges.clear();
}
@@ -938,7 +938,7 @@ void MtStrongComponents<Graph,Vis,VPropMap>::StrongSearch( vertex rootVert, std:
const size_t wNum = num[w];
if ( wNum < num[topElem->node] && wNum < lval[topElem->node] ) // <v,w> - "поперечная" или "обратная" дуга.
{
// Предположение: В стеке лежат вершины, из которых вершина vx достижима;
// Предположение: В стеке лежат вершины, из которых вершина vx достижима.
if ( std::find(comStack.rbegin(), comStack.rend(), w) != comStack.rend() )
{
lval[topElem->node] = wNum;
+1 -1
View File
@@ -163,7 +163,7 @@ public:
\en Polygons of invisible lines of smooth edges. \~
\param[in] sag - \ru Угловая толерантность.
\en An angular tolerance. \~
\param[in] annotations - \ru Набор аннатационных объектов.
\param[in] annotations - \ru Набор аннотационных объектов.
\en A set of annotation objects. \~
\param[in] place - \ru Проекционная плоскость.
\en A projection plane. \~
+8 -8
View File
@@ -59,7 +59,7 @@ public:
\details \ru Добавить контур в массив контуров, если массив не нулевой.\n
\en Add a contour to the array of contours, if the array isn't null.\n \~
\param[in] contour - \ru Контур.
\en A countour. \~
\en A contour. \~
*/
void Add( MbContour * contour );
@@ -83,7 +83,7 @@ public:
/** \brief \ru Удалить контуры.
\en Remove contours. \~
\details \ru Очистить массив с конутрами, если он не нулевой.
\details \ru Очистить массив с контурами, если он не нулевой.
\en Clear the array of contours if it isn't null. \~
*/
void DetachContours() {
@@ -130,9 +130,9 @@ public:
public:
/** \brief \ru Зарезирвировать место под оболочки.
/** \brief \ru Зарезервировать место под оболочки.
\en Reserve a place for shells. \~
\details \ru Зарезирвировать место под отображаемые оболочки.
\details \ru Зарезервировать место под отображаемые оболочки.
\en Reserve a place for mapping shells. \~
\param[in] count - \ru Количество мест для резервирования.
\en A number of places for reservation. \~
@@ -225,7 +225,7 @@ public:
/** \brief \ru Преобразовать.
\en Transform. \~
\details \ru Преобразовать объект по марице.
\details \ru Преобразовать объект по матрице.
\en Transform the object by a matrix. \~
\param[in] matr - \ru Матрица преобразования.
\en A transformation matrix. \~
@@ -256,16 +256,16 @@ public:
/** \brief \ru Установить хранилище.
\en Set a storage. \~
\details \ru Установить хранилище аннатационных объектов.\n
\details \ru Установить хранилище аннотационных объектов.\n
Отцепить старое хранилище, захватить новое.
\en Set a storage of annotation objects.\n
Detach the old storage and catch a new one. \~
\param[out] objStore - \ru Новое хранилище аннатационных объектов.
\param[out] objStore - \ru Новое хранилище аннотационных объектов.
\en A new storage of annotation objects. \~
*/
void SetAnnObjectStore( ItAnnObjectStore * objStore );
/// \ru Получить хранилище аннатационных объектов. \en Get the storage of annotation objects.
/// \ru Получить хранилище аннотационных объектов. \en Get the storage of annotation objects.
ItAnnObjectStore * GetAnnObjectStore() const { return annObjStore; }
/** \brief \ru Получить условные обозначения.
+3 -3
View File
@@ -36,7 +36,7 @@ struct MATH_CLASS MbSectionMapIteratorAbs {
/// \ru Удалить. \en Remove.
virtual void Release() = 0;
/// \ru Сбросить итератор в начало. \en Set the iterator to the begining.
/// \ru Сбросить итератор в начало. \en Set the iterator to the beginning.
virtual void Reset() = 0;
/// \ru Есть ли еще итерации. \en Whether there are any iteration.
virtual bool More() const = 0;
@@ -53,7 +53,7 @@ struct MATH_CLASS MbSectionMapIteratorAbs {
/// \ru Результат последнего действия (итерации). \en The last iteration result.
virtual MbResultType GetLastResult() const = 0;
/// \ru Установить интерфейс хранилища аннатационных объектов. \en Set the interface of the annotation objects storage.
/// \ru Установить интерфейс хранилища аннотационных объектов. \en Set the interface of the annotation objects storage.
virtual void SetAnnObjectStore ( ItAnnObjectStore * ) = 0;
/// \ru Установить условные обозначения. \en Set conventional notations.
virtual void SetSymbolObjects ( RPArray<MbSymbol> & ) = 0;
@@ -140,7 +140,7 @@ public:
- has no self-intersections,\n
- consists of segments,\n
- if an each segment has a bounding box with the length and width which are greater than the tolerance. \~
\return \ru Код разельтата.
\return \ru Код результата.
\en A result code. \~
*/
static MbResultType ContourValidityCheck( const MbContour & contour );
+3 -3
View File
@@ -68,7 +68,7 @@ public:
\en The classification of a planar mapping. \n \~
*/
enum Type {
vt_None, ///< \ru Тип неопределен. \en A type is undefined.
vt_None, ///< \ru Тип не определён. \en A type is undefined.
vt_SmoothEdge, ///< \ru Линия перехода (гладкое ребро). \en A transition line (smooth edge).
vt_Edge, ///< \ru Отображение ребра или линия очерка поверхности. \en Mapping of edge or isocline curve of surface.
vt_SectionLine, ///< \ru Линия разреза (ребра тела, полученные сечением). \en A cutaway line (section edges).
@@ -90,7 +90,7 @@ public:
\en The classifier of annotative edges subtypes. \n \~
*/
enum SubType {
vst_None = 0, ///< \ru Подтип неопределен. \en A subtype is undefined.
vst_None = 0, ///< \ru Подтип не определен. \en A subtype is undefined.
vst_BaseBeg, ///< \ru Основной начальный. \en A base initial type.
vst_BaseEnd, ///< \ru Основной конечный. \en A base final type.
vst_ButtBeg, ///< \ru Торцевой начальный. \en A butt initial type.
@@ -751,7 +751,7 @@ protected:
\en A component. \~
\param[in] otherIdent - \ru Идентификатор нити.
\en A thread identifier. \~
\param[in] otherItem - \ru Полигоанльный объект.
\param[in] otherItem - \ru Полигональный объект.
\en A polygonal object. \~
*/
MbFaceVestige( uint otherComp, size_t otherIdent, const MbGrid & grid )
+1 -1
View File
@@ -688,7 +688,7 @@ inline bool MbCubeTree<Type, Cube, Point, Vector>::InitTree( std::vector<ItemInd
branchCube = gabarit;
if ( (tier < treeDepth) && (iCount > leafMinCount) ) {
if ( (tier < (int)treeDepth) && (iCount > leafMinCount) ) {
// если ось указана, то следующее разделение должно выполниться по другой оси
switch ( a ) {
+24
View File
@@ -56,6 +56,12 @@ public:
/// \ru Добавить тэг, если он не пустой. \en Add a non-empty tag.
void AddTag( const c3d::string_t& tag );
/// \ru Принять посетителя. \en Accept a visitior.
virtual void Accept( Visitor & ) = 0;
/// \ru Принять посетителя. \en Accept a visitior.
virtual void Accept( Visitor & ) const = 0;
protected:
/// \ru Пользователские тэги, не предназначенные для сериализации. \en User tags not for serialization.
@@ -229,6 +235,15 @@ public:
/// \ru Являются ли объекты равными. \en Are the objects equal.
bool IsSame( const MbTextItem & to, double accuracy ) const final;
VISITING_CLASS( MbTextLiteral )
void Accept( Visitor & visitor ) const override
{
auto * impl = dynamic_cast<VisitorImpl<const MbTextLiteral> *>(&visitor);
if( impl )
impl->Visit( *this );
}
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbTextLiteral )
OBVIOUS_PRIVATE_COPY( MbTextLiteral )
};
@@ -270,6 +285,15 @@ public:
SPtr<MbTextItem> Clone( MbRegDuplicate * = nullptr ) const final;
/// \ru Являются ли объекты равными. \en Are the objects equal.
bool IsSame( const MbTextItem & to, double accuracy ) const final;
VISITING_CLASS( MbCompositeText )
void Accept( Visitor & visitor ) const override
{
auto * impl = dynamic_cast<VisitorImpl<const MbCompositeText> *>(&visitor);
if( impl )
impl->Visit( *this );
}
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbCompositeText )
OBVIOUS_PRIVATE_COPY( MbCompositeText )
+1
View File
@@ -463,6 +463,7 @@ enum MbePrompt
IDS_ITEM_0794, ///< \ru Атрибут массив действительных чисел типа double. \en Array of real (double) values attribute.
IDS_ITEM_0795, ///< \ru Атрибут хот-точки. \en Attribute of hot-point.
IDS_ITEM_0796, ///< \ru Атрибут диапазона действительных чисел типа double. \en Double precision range attribute.
IDS_ITEM_0797, ///< \ru Атрибут ссылочного объекта. \en Reference-counted object attribute.
// \ru Сообщения. \en Messages.
+1 -1
View File
@@ -25,7 +25,7 @@
\note It is used as an ancestor class for ATS-interfaces.
\attention \ru Данный класс имеет консервативную реализацию подсчета ссылок,
т.е. требует особых мер для работы в многопоточном режиме.
Другой клас с аналогичными функциями #MbRefItem предусматривает
Другой класс с аналогичными функциями #MbRefItem предусматривает
обращение из разных потоков.
\en This class has a conservative implementation of reference counting,
i.e. requires special tricks to work in multi-threaded mode.
+2
View File
@@ -12,6 +12,7 @@
#include <cur_contour.h>
#include <map>
#include <mb_operation_result.h>
@@ -53,6 +54,7 @@ private:
void AddChild( const MbContour &, const RPArray<MbContour> &, size_t, double eps, bool contoursEqual, VERSION version ); // \ru добавить элемент в дерево \en add element to the tree
bool IsExistContour( const MbContour & ) const; // \ru существует в дереве такой контур \en whether there is such a contour in the tree
void GetCountInOneNode( const MbNamedContoursTree & tCont, size_t & countTmp ) const;
void SortTree( const std::map<const MbContour *, size_t> & contoursIndexes );
private:
MbNamedContoursTree( const MbNamedContoursTree & ); // \ru не реализовано \en not implemented
void operator = ( const MbNamedContoursTree & ); // \ru не реализовано \en not implemented
+1 -1
View File
@@ -359,7 +359,7 @@ public:
/// \ru Выдать значения запрошенного типа. \en Get the values of the requested type.
template<class DMValues>
std::shared_ptr<DMValues> GetValues() const;
MATH_FUNC( std::shared_ptr<DMValues> ) GetValues() const;
/** \brief \ru Валидны ли созданные параметры.
\en Whether the created parameters are valid.\~
+7 -3
View File
@@ -654,7 +654,7 @@ public:
/// \ru Являются ли объекты равными? \en Determine whether an object is equal?
bool IsSame( const MbMeshUnwrapParams & that, double accuracy ) const;
/// \ru Инициализировать базовую сетку по оболочке. \en Initialize base mesh by shell.
bool InitBaseMesh( const MbFaceShell & shell, const MbStepData & stepData );
bool InitBaseMesh( const MbFaceShell & shell, const MbStepData & stepData, bool bParameterize = true );
/// \ru Инициализировать ремешированную сетку с заданным размером треугольника (если triangleSize < 0, размер будет оценен автоматически). \en Initialize remeshed mesh with defined triangle size. If triangleSize < 0, then it will be estimated automatically.
bool InitRemeshedMesh( double triangleSize, bool bReparam = false );
@@ -1090,10 +1090,14 @@ public:
\en Fix torus radii. \~
\details \ru Зафиксировать радиусы тора.
Можно зафиксировать большой и малый радиусы тора (только один их них или сразу оба).
Значения должны быть положительными (=0 - значение не зафиксировано).
Малый радиус должен быть положительным (=0 - значение не зафиксировано).
Большой радиус может быть отрицательным для торов типа "лимон" (=0 - значение не зафиксировано).
Большой радиус (центров) должен быть больше малого радиуса (трубки), взятого с обратным знаком: majorRadius>minorRadius.
\en Fix torus radii.
There may be fixed the major radius (_size1) or the minor radius (_size2) of a torus (one or both of them).
The values have to be positive (=0 - value is not fixed). \~
The minor radius has to be positive (=0 - value is not fixed).
The major radius may be negative if a torus is of "lemon" type (=0 - value is not fixed).
The major radius (of centers) has to be greater than the opposite of the minor radius (of a tube): majorRadius>minorRadius. \~
\param[in] majorRadius - \ru Большой радиус тора.
\en Major torus radius. \~
\param[in] minorRadius - \ru Малый радиус тора.
+31
View File
@@ -7452,4 +7452,35 @@ public:
};
//------------------------------------------------------------------------------
/** \brief \ru Параметры построения оболочки по поверхности.
\en Parameters for creating the shell by a surface. \~
\details \ru Параметры построения оболочки по поверхности.
\en Parameters for creating the shell by a surface. \~
\ingroup Shell_Building_Parameters
*/
// ---
struct MATH_CLASS MbSurfaceShellParams
{
public:
const MbSurface & _surface; ///< \ru Передаваемая поверхность. \en The surface.
SPtr<MbSNameMaker> _operNames; ///< \ru Именователь операции. \en An object defining names generation in the operation.
bool _sameSurface; ///< \ru Использовать копию поверхности, если параметр равен false. \en Use a copy of the surface if the flag is false.
public:
/// \ru Конструктор по умолчанию. \en Default constructor.
MbSurfaceShellParams( const MbSurface & surface, const MbSNameMaker & operNames, bool sameSurface )
: _surface ( surface )
, _operNames ( &operNames.Duplicate() )
, _sameSurface ( sameSurface ) {};
/// \ru Получить именователь операции. \en Get the object defining names generation in the operation.
const MbSNameMaker & GetNameMaker() const { return *_operNames; }
/// \ru Получить переданную поверхность. \en Get the surface.
const MbSurface & GetSurface() const { return _surface; }
/// \ru Использовать поверхность или ее копию. \en. Use the surface or a copy of it.
bool IsSameSurface() const { return _sameSurface; }
OBVIOUS_PRIVATE_COPY( MbSurfaceShellParams )
};
#endif // __OP_SHELL_PARAMETERS_H
+12 -3
View File
@@ -309,8 +309,8 @@ public:
/// \ru Выдать тело для изменения. \en Get the solid for editing.
MbSolid * SetSolid() const { return solid; }
/// \ru Перестроить объект по журналу построения. Для перестроения проволочного каркаса. \en Rebuild object according to the history tree. For rebuilding the wire frame.
void RebuildItem();
/// \ru Перестроить объект по журналу построения. Для перестроения проволочного каркаса. Вернуть true в случае успешного перестроения. \en Rebuild object according to the history tree. For rebuilding the wire frame. Return true if rebuild has been finished successfully. \~
bool RebuildItem();
/** \brief \ru Выдать двумерные контуры с поверхностью или трехмерные контуры, полученные с проволочного каркаса.
\en Get two-dimensional contours with a surface or three-dimensional contours obtained from a wireframe. \~
@@ -1026,7 +1026,16 @@ public:
/** \brief \ru Параметры операции вращения.
\en The parameters of revolution operation. \~
\details \ru Параметры операции вращения кривых с опциями по направлениям. \n
\en The parameters of revolution operation of curves with options along directions. \n \~
При построении операции вращения до конструктивной плоскости с вырожденной областью определения
оболочка будет построена до ближайшего пересечения с указанной плоскостью.
В случае, если плоскость имеет не вырожденные границы, часть плоскости, до которой будет построено вращение,
определяется по положению центра тяжести контура, ограничивающего плоскость, относительно проекции оси вращения на плоскость.
\en The parameters of revolution operation of curves with options along directions. \n
When constructing a rotation operation to a constructive plane with a degenerate domain of definition
the shell will be constructed to the nearest intersection with the specified plane.
If the plane has non-degenerate boundaries, the part of the plane up to which the rotation will be constructed is
is selected according to the position of the center of gravity of the contour limiting the plane relative to the
projection of the axis of rotation onto the plane. \~
\ingroup Shell_Building_Parameters
*/
// ---
+6 -2
View File
@@ -1253,7 +1253,7 @@ class MATH_CLASS BTreeOperation : public BTreeNode
private:
PceOperationType opCode; ///< \ru Код операции. \en Code of operation.
BTreeNode * op1; ///< \ru Первый операнд. \en The first operand.
BTreeNode * op2; ///< \ru Второй операнд. \en The second operand.
BTreeNode * op2; ///< \ru Второй операнд. \en The second operand.
static SArray<DerivesValues> varsDerives; ///< \ru Производные аргументов для вычисления производных показательно-степенной функции \en Derivatives of arguments for calculation of derivatives of exponential-power function
static std::unique_ptr<MbUserFunc> deriveFunc; ///< \ru Функция для вычисления производной показательно-степенной функции \en Function for calculation of derivative of the exponential-power function
@@ -1307,6 +1307,9 @@ public:
void ReplaceParVariable( const c3d::string_t & varName, ItTreeVariable & newVar ) override;
void ReplaceParVariable( const ItTreeVariable & var, const BTreeNode & subTree ) override;
/// \ru Заменить операнд. \en Replace the operand.
BTreeNode * ReplaceSubNode( BTreeNode & newNode, size_t opNum );
/** \} */
/**\ru \name Функции доступа к данным.
\en \name Functions for access to data.
@@ -1374,7 +1377,8 @@ private:
void operator = ( const BTreeOperation & ); // \ru не реализовано \en not implemented
EquTreeResCode GetValue( double par1, double par2, double & value ) const;
// \ru Вычисление значения функции строковых переменных. \en Get value of a function for string variables.
EquTreeResCode GetValue( c3d::string_t & par1, c3d::string_t & par2, double & value ) const;
EquTreeResCode GetValue( const c3d::string_t & par1, const c3d::string_t & par2, double & value ) const;
EquTreeResCode GetValue( const c3d::string_t & par1, const c3d::string_t & par2, c3d::string_t & sValue ) const;
virtual bool GetCharacterPoints( std::vector<CharacterPointInfo> &, const ItTreeVariable & ) const;
// \ru Только для внутреннего использования! \en For internal use only!
size_t GetPseudoOrderByVar( ItTreeVariable & var ) const override;
+1 -1
View File
@@ -25,7 +25,7 @@
\ingroup Parser
*/
// ---
class MbCoord : public ItCoord
class MATH_CLASS MbCoord : public ItCoord
{
private:
double m_coord; // \ru Значение координаты. \en A value of coordinate.
+2
View File
@@ -25,6 +25,8 @@ struct ItIntervalTreeVariable;
constexpr size_t MAX_VARIABLE_NAME_LENGTH = 512;
/// \ru Максимальная длина выражения. \en Maximum length of expression.
constexpr size_t MAX_EQU_LENGTH = 8192; // C3D-5977.
/// \ru Максимальная высота дерева. \en Maximum height of tree.
constexpr size_t MAX_TREE_HEIGHT = 2047; // C3D-8352.
//-------------------------------------------------------------------------------
+111 -3
View File
@@ -233,20 +233,107 @@ protected:
RegionOperationType operType; ///< \ru Тип булевой операции. \en А Boolean operation type.
bool allowSelfTouch; ///< \ru Допустимость самокасаний в результате. \en Admissibility of self-touches as a result..
bool mergeCurves; ///< \ru Объединять подобные сегменты кривых. \en Merge similar segments of curves.
double xAcc; ///< \ru Погрешность вдоль оси x. \en Accuracy along x-axis.
double yAcc; ///< \ru Погрешность вдоль оси y. \en Accuracy along y-axis.
double angleAcc; ///< \ru Угловая погрешность. \en Angular accuracy.
public:
MbRegionBooleanParams( RegionOperationType type, bool selfTouch = true, bool mergeCrvs = true ) : operType( type ), allowSelfTouch( selfTouch ), mergeCurves( mergeCrvs ) {}
MbRegionBooleanParams( const MbRegionBooleanParams & p ) : operType( p.operType ), allowSelfTouch( p.allowSelfTouch ), mergeCurves( p.mergeCurves ) {}
/** \brief \ru Конструктор.
\en Constructor. \~
\details \ru Конструктор по типу операции и флагам допустимости самокасаний и объединения подобных сегментов.
\en Constructor by a operation type and flags for self-touches and similar segments merging. \~
\deprecated \ru Метод устарел. \en The method is deprecated. \~
\param[in] type - \ru Тип булевой операции.
\en А Boolean operation type. \~
\param[in] allowSelfTouch - \ru Флаг допустимости самокасаний.
\en The flag of self-touching acceptability. \~
\param[in] mergeCurves - \ru Флаг объединения подобных сегментов.
\en The flag of similar segments merging. \~
*/
DEPRECATE_DECLARE_REPLACE( MbRegionBooleanParams with accuracy )
MbRegionBooleanParams( RegionOperationType type, bool selfTouch = true, bool mergeCrvs = true )
: operType( type )
, allowSelfTouch( selfTouch )
, mergeCurves( mergeCrvs )
, xAcc( Math::LengthEps )
, yAcc( Math::LengthEps )
, angleAcc( Math::AngleEps )
{}
/** \brief \ru Конструктор.
\en Constructor. \~
\details \ru Конструктор по типу операции, флагам допустимости самокасаний и объединения подобных сегментов и погрешностями.
\en Constructor by a operation type, flags for self-touches and similar segments merging and accuracies \~
\param[in] type - \ru Тип булевой операции.
\en А Boolean operation type. \~
\param[in] allowSelfTouch - \ru Флаг допустимости самокасаний.
\en The flag of self-touching acceptability. \~
\param[in] mergeCurves - \ru Флаг объединения подобных сегментов.
\en The flag of similar segments merging. \~
\param[in] xAcc - \ru Погрешность вдоль оси x.
\en Accuracy along x-axis. \~
\param[in] xAcc - \ru Погрешность вдоль оси y.
\en Accuracy along y-axis. \~
\param[in] angleAcc - \ru Угловая погрешность.
\en Angular accuracy. \~
*/
MbRegionBooleanParams( RegionOperationType type, bool selfTouch, bool mergeCrvs, double xAcc, double yAcc, double angleAcc )
: operType( type )
, allowSelfTouch( selfTouch )
, mergeCurves( mergeCrvs )
, xAcc( xAcc )
, yAcc( yAcc )
, angleAcc( angleAcc )
{}
/// \ru Конструктор копирования. \en Copy-constructor.
MbRegionBooleanParams( const MbRegionBooleanParams & p )
: operType( p.operType )
, allowSelfTouch( p.allowSelfTouch )
, mergeCurves( p.mergeCurves )
, xAcc( p.xAcc )
, yAcc( p.yAcc )
, angleAcc( p.angleAcc )
{}
public:
/// \ru Получить тип булевой операции. \en Get a boolean operation type.
RegionOperationType OperationType() const { return operType; }
/// \ru Установить тип булевой операции. \en Set a boolean operation type.
void OperationType( RegionOperationType type ) { operType = type; }
/// \ru Получить флаг объединения подобных сегментов. \en Get the flag of similar segments merging.
bool MergeCurves() const { return mergeCurves; }
/// \ru Установить флаг объединения подобных сегментов. \en Set the flag of similar segments merging.
void MergeCurves( bool b ) { mergeCurves = b; }
/// \ru Получить флаг допустимости самокасаний. \en Get the flag of self-touching acceptability.
bool AllowSelfTouch() const { return allowSelfTouch; }
/// \ru Установить флаг допустимости самокасаний. \en Set the flag of self-touching acceptability.
void AllowSelfTouch( bool b ) { allowSelfTouch = b; }
const MbRegionBooleanParams & operator = ( const MbRegionBooleanParams & p ) { operType = p.operType; allowSelfTouch = p.allowSelfTouch; mergeCurves = p.mergeCurves; return *this; }
/// \ru Получить точность вдоль оси x. \en Get accuracy along x-axis
double GetXAcc() const { return xAcc; }
/// \ru Установить точность вдоль оси x. \en Set accuracy along x-axis
void SetXAcc( double xa ) { xAcc = xa; }
/// \ru Получить точность вдоль оси y. \en Get accuracy along y-axis
double GetYAcc() const { return yAcc; }
/// \ru Установить точность вдоль оси y. \en Set accuracy along y-axis
void SetYAcc( double ya ) { yAcc = ya; }
/// \ru Получить угловую точность. \en Get angular accuracy.
double GetAngleAcc() const { return angleAcc; }
/// \ru Установить угловую точность. \en Set angular accuracy.
void SetAngleAcc( double aa ) { angleAcc = aa; }
/// \ru Оператор присваивания. \en An assignment operator.
const MbRegionBooleanParams & operator = ( const MbRegionBooleanParams & p )
{
operType = p.operType;
allowSelfTouch = p.allowSelfTouch;
mergeCurves = p.mergeCurves;
xAcc = p.xAcc;
yAcc = p.yAcc;
angleAcc = p.angleAcc;
return *this;
}
private:
MbRegionBooleanParams();
};
@@ -309,6 +396,8 @@ MATH_FUNC (bool) CreateBooleanResultRegions( MbRegion & region1, MbRegion & regi
\en Perform union of regions. \~
\details \ru Выполнить объединение регионов.
\en Perform union of regions. \~
\deprecated \ru Функция устарела, взамен использовать #MakeUnionRegions с набором параметров #MbRegionBooleanParams.
\en The function is deprecated, instead use #MakeUnionRegions with the parameter list #MbRegionBooleanParams. \~
\param[in,out] regions - \ru Начальные и конечные регионы.
\en Initial and resulting regions. \~
\param[in] allowSelfTouch - \ru Допустимость самокасаний в результате.
@@ -320,7 +409,26 @@ MATH_FUNC (bool) CreateBooleanResultRegions( MbRegion & region1, MbRegion & regi
\ingroup Algorithms_2D
*/
// ---
DEPRECATE_DECLARE_REPLACE( MakeUnionRegions with MbRegionBooleanParams )
MATH_FUNC (bool) MakeUnionRegions( RPArray<MbRegion> & regions, bool allowSelfTouch = true, bool mergeCurves = true );
//-------------------------------------------------------------------------------
/** \brief \ru Выполнить объединение регионов.
\en Perform union of regions. \~
\details \ru Выполнить объединение регионов.
\en Perform union of regions. \~
\param[in,out] regions - \ru Начальные и конечные регионы.
\en Initial and resulting regions. \~
\param[in] operParams - \ru Параметры булевой операции.
\en A Boolean operation parameters. \~
\return \ru true, если какие-то регионы были объединены.
\en Returns true if a pair of regions has been united. \~
\ingroup Algorithms_2D
*/
// ---
//-------------------------------------------------------------------------------
// ---
MATH_FUNC( bool ) MakeUnionRegions( std::vector<SPtr<MbRegion>> & regions, const MbRegionBooleanParams & operParams );
#endif // __REGION_H
+1 -1
View File
@@ -248,7 +248,7 @@ namespace c3d
size_t GetPointsCount() const;
/// \ru Получить точку по индексу. \en Get point by index.
double GetPoint( size_t index ) const;
size_t GetPoint( size_t index ) const;
/// \ru Создать ломаную. \en Create polyline.
static std::shared_ptr<SePolylineCurve> Create(
+23
View File
@@ -166,6 +166,29 @@ namespace c3d
SePlacement3D( size_t thisId, size_t origin, size_t axisZ, size_t axisX );
};
//------------------------------------------------------------------------------
/** \brief \ru Ось STEP.
\en STEP axis. \~
\note \ru ЭКСПЕРИМЕНТАЛЬНАЯ.
\en EXPEREIMENTAL. \~
*/
class CONV_CLASS SeAxis : public SeBase
{
size_t m_axis; ///< \ru Ось z. \en Z axis.
public:
/// \ru Создать локальную систему координат. \en Create a placement.
static std::shared_ptr<SeAxis> Create( size_t thisId, size_t axis );
/// \ru Получить ось. \en Get axis.
size_t GetAxis() const;
VISITING_CLASS( SeAxis )
private:
/// \ru Конструктор. \en Constructor.
SeAxis( size_t thisId, size_t axis );
};
}
};
-1
View File
@@ -48,7 +48,6 @@ enum MbeMeshSurfaceVersion {
msv_Ver3, ///< \ru Третья версия. \en The third version.
msv_Ver4, ///< \ru Четвертая версия. \en The fourth version.
msv_Ver5, ///< \ru Пятая версия. \en The fifth version.
msv_Ver6, ///< \ru Шестая версия. \en The sixth version.
msv_Count ///< \ru Количество версий. \en Count of versions.
};
+1
View File
@@ -231,6 +231,7 @@ SignedType abs_t( const SignedType x ) { return ((x >= 0) ? x : -x); }
// http://support.microsoft.com/kb/134980/ru
//#pragma warning(disable: 4275) //AP non dll-interface class '1' used as base for dll-interface class '2' (deriving exported from non-exported)
#pragma warning(disable: 4251) //AP class '1' needs to have dll-interface to be used by clients of class '2' (using non-exported in exported)
#pragma warning(disable: 4505) //'SomeFunctionName': unreferenced local function has been removed
// have to be disabled
//#pragma warning(disable: 4018) // W3: comparison : signed/unsigned mismatch
+3 -1
View File
@@ -10,6 +10,8 @@
#ifndef __TEMPL_VISITOR_H
#define __TEMPL_VISITOR_H
#include <math_define.h>
//------------------------------------------------------------------------------
/** \brief \ru Абстрактный базовый класс посетителя.
@@ -21,7 +23,7 @@
\ingroup Base_Tools
*/
// ---
class Visitor
class MATH_CLASS Visitor
{
public:
virtual ~Visitor(){}; ///< \ru Деструктор. \en Destructor.
+11
View File
@@ -112,6 +112,17 @@ extern "C" MATH_FUNC (bool) IsMathCollisionEnable();
extern "C" MATH_FUNC (bool) IsMathFairCurveEnable();
//------------------------------------------------------------------------------
/** \brief \ru Проверить контроллер защиты модуля проецирования.
\en Check the controller of the Mapping. \~
\details \ru Проверить контроллер защиты модуля проецирования.
\en Check the controller of the Mapping. \~
\ingroup Base_Tools
*/
// ---
extern "C" MATH_FUNC (bool) IsMathMappingEnable();
//------------------------------------------------------------------------------
/** \brief \ru Отпустить контролера работы модулей ядра.
\en Free the controller of the kernel modules work. \~
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.