diff --git a/C3d/Include/alg_dimension.h b/C3d/Include/alg_dimension.h index 56fe2f1..905e413 100644 --- a/C3d/Include/alg_dimension.h +++ b/C3d/Include/alg_dimension.h @@ -873,9 +873,9 @@ public: /// \ru Получить общий вектора поиска. \en Get general search direction. bool GetProjectionDirection( MbVector3D & dir, MbeSenseValue & orient ) const { + orient = projOrient; // KOMPAS-60343, KOMPAS-60407. if ( projDirection.Length() > LENGTH_EPSILON ) { dir = projDirection; - orient = projOrient; return true; } return false; diff --git a/C3d/Include/check_geometry.h b/C3d/Include/check_geometry.h index e47b05b..9703c36 100644 --- a/C3d/Include/check_geometry.h +++ b/C3d/Include/check_geometry.h @@ -542,12 +542,19 @@ bool CheckInexactEdges( const EdgesVector & allEdges, double mAcc, EdgesVector * if ( &v1 == &v2 ) { double mTol = v1.GetTolerance(); double mLen = allEdges[i]->GetLengthEvaluation(); - if ( mLen > METRIC_PRECISION && mLen > mTol + METRIC_PRECISION ) { - isInexactEdge = true; - if ( inexactEdges != nullptr ) - inexactEdges->push_back( allEdges[i] ); - else - break; + if ( mLen > METRIC_PRECISION && mLen > mTol + mAcc ) { + MbCartPoint3D p1, p2; + allEdges[i]->Point( 0.0, p1 ); + allEdges[i]->Point( 1.0, p2 ); + double mMinAcc = std_min( mAcc, mTol ); + + if ( !c3d::EqualPoints( p1, p2, mMinAcc ) ) { // SD#7353885 + isInexactEdge = true; + if ( inexactEdges != nullptr ) + inexactEdges->push_back( allEdges[i] ); + else + break; + } } } } diff --git a/C3d/Include/conv_model_exchange.h b/C3d/Include/conv_model_exchange.h index f4ea4ee..870386f 100644 --- a/C3d/Include/conv_model_exchange.h +++ b/C3d/Include/conv_model_exchange.h @@ -430,6 +430,21 @@ public: virtual ~IConvertor3D() {} public: + /** \brief \ru Установить обработчик для выбора конфигураций. + \en Set handler for selecting configurations. \~ + \details \ru Если обработчик установлен и в импортируемом файле + есть более одной конфигурации (исполнения), то в + процессе чтения будет вызван установленный обработчик + для выбора необходимой конфигурации. + \en If handler is set and imported file contains more than + one configuration (embodiment), then the handler will + be called for selection of needed configuration during + reading. \~ + \param[in] configuration_selector - \ru Указатель на устанавливаемый обработчик. + \en Pointer to handler to be set. \~ + */ + virtual void SetConfgiurationSelector( SPtr configuration_selector ) = 0; + /** \brief \ru Прочитать файл формата SAT. \en Read a file of SAT format. \~ \details \ru Прочитать файл формата SAT или указанный поток. diff --git a/C3d/Include/conv_requestor.h b/C3d/Include/conv_requestor.h index bcdcb6b..49ac239 100644 --- a/C3d/Include/conv_requestor.h +++ b/C3d/Include/conv_requestor.h @@ -28,6 +28,8 @@ class IConfigurationSelector : public MbRefItem { public: + IConfigurationSelector() = default; + virtual ~IConfigurationSelector() = default; virtual void AddConfiguration ( const c3d::string_t& configurationName ) = 0; virtual void SetActiveConfiguration ( const size_t index ) = 0; virtual size_t GetConfiguration () const = 0; diff --git a/C3d/Include/conv_topo_mesh.h b/C3d/Include/conv_topo_mesh.h index 678d39d..85acdf5 100644 --- a/C3d/Include/conv_topo_mesh.h +++ b/C3d/Include/conv_topo_mesh.h @@ -1,4 +1,4 @@ -//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// /** \file \brief Преобразователь сетки к форме, сохраняющей связи граней и полигонов. @@ -17,6 +17,7 @@ #include class MbGrid; +class MbFloatGrid; class MbMesh; class MbTriangle; @@ -113,5 +114,10 @@ namespace JTC { // --- CONV_FUNC( MbGrid* ) CreateGridByPolyonPoints( const std::vector>& polygonsAsPoints ); +//------------------------------------------------------------------------------ +// Создать номали сетки по умолчанию +// --- +void CreateDefaultNormals( MbFloatGrid & grid ); + #endif // !__CONV_TOPO_MESH_H diff --git a/C3d/Include/cur_contour_on_plane.h b/C3d/Include/cur_contour_on_plane.h index 449c604..a4cd38e 100644 --- a/C3d/Include/cur_contour_on_plane.h +++ b/C3d/Include/cur_contour_on_plane.h @@ -41,6 +41,8 @@ class MATH_CLASS MbContourOnPlane : public MbContourOnSurface { public : /// \ru Конструктор по плоскости, контуру и флагу использования оригинала контура. \en Constructor by plane, contour and flag of using original contour. MbContourOnPlane( const MbPlane &, const MbContour &, bool same ); + /// \ru Конструктор по плейсменту, контуру и флагу использования оригинала контура. \en Constructor by plane, contour and flag of using original contour. + MbContourOnPlane( const MbPlacement3D &, const MbContour &, bool same ); /// \ru Конструктор по плоскости и направлению обхода поверхности. \en Constructor by plane and traverse direction of surface. MbContourOnPlane( const MbPlane &, int sense ); /// \ru Конструктор по плоскости. \en Constructor by plane. diff --git a/C3d/Include/cur_line.h b/C3d/Include/cur_line.h index 37e6c7c..23f5051 100644 --- a/C3d/Include/cur_line.h +++ b/C3d/Include/cur_line.h @@ -83,7 +83,7 @@ public : void CalculateLocalGabarit( const MbMatrix & into, MbRect & local ) const override; // \ru Рассчитать габарит в локальной системы координат. \en Calculate bounding rectangle into local coordinate system. bool IsVisibleInRect( const MbRect &, bool exact = false ) const override; // \ru Виден ли объект в заданном прям-ке \en Whether the object is visible in the given rectangle - using MbCurve::IsVisibleInRect; + using MbCurve::IsVisibleInRect; double DistanceToPoint( const MbCartPoint & ) const override; // \ru Расстояние до точки \en Distance to a point bool DistanceToPointIfLess( const MbCartPoint & toP, double & d ) const override; // \ru Вычислить расстояние до точки, если оно меньше d. \en Calculate the distance to the point if it is less than d. /** \} */ diff --git a/C3d/Include/gce_api.h b/C3d/Include/gce_api.h index e8e008c..6a3876a 100644 --- a/C3d/Include/gce_api.h +++ b/C3d/Include/gce_api.h @@ -279,6 +279,86 @@ GCE_FUNC(geom_item) GCE_AddBoundedCurve( GCE_system gSys, geom_item curve, geom_ //--- GCE_FUNC(geom_item) GCE_AddOffsetCurve( GCE_system gSys, geom_item curve, double offset ); +//---------------------------------------------------------------------------------------- +/** \brief \ru Объявить паттерн с направлением вдоль прямой и заданным смещением или с центром в точке и заданным углом. + \en Declare a pattern with a direction along a line and a given offset or with the center at a point and a given angle. \~ + \param[in] gSys - \ru Система ограничений. + \en System of constraints. \~ + \param[in] geom - \ru Дескриптор точки или прямой. + \en Descriptor of line. \~ + \param[in] step - \ru Величина смещения паттерн. + \en Pattern offset. \~ + \return \ru Дескриптор зарегистрированного паттерна. + \en Descriptor of registered pattern. \~ + + \details \ru Метод создает паттерн. Если объект прямая или отрезок, то создается линейный паттерн с направлением + вдоль данной прямой или отрезком и шагом step. Если объект точка, окружность или эллипс, + то создается угловой паттерн с центром в данной точке или центре окружности или эллипса и углом step. + \en The method creates a pattern. If the object is a line or a segment, then a linear pattern + is created with the direction along this line or segment and a step. If the object is a point, + circle or ellipse, then an angular pattern is created with the center at the given point + or center of the circle or ellipse and the step angle. \~ +*/ +//--- +GCE_FUNC(pattern_item) GCE_AddPattern( GCE_system gSys, geom_item geom, double step ); + +//---------------------------------------------------------------------------------------- +/** \brief \ru Объявить линейный паттерн с шагом смещения, заданным вектором трансляции. + \en Declare a linear pattern with the step given by the translation vector. \~ + \param[in] gSys - \ru Система ограничений. + \en System of constraints. \~ + \param[in] trans - \ru Вектор трансляции. + \en Offset vector. \~ + \return \ru Дескриптор зарегистрированного паттерна. + \en Descriptor of registered pattern. \~ + + \details \ru Метод создает линейный паттерн со смещением, заданным данным вектором трансляции. + \en The method creates a linear pattern with the step given by this translation vector. \~ +*/ +//--- +GCE_FUNC(pattern_item) GCE_AddLinearPattern( GCE_system gSys, GCE_vec2d trans ); + +//---------------------------------------------------------------------------------------- +/** \brief \ru Объявить угловой паттерн c центром и углом. + \en Declare an angular pattern with a center and an angle. \~ + \param[in] gSys - \ru Система ограничений. + \en System of constraints. \~ + \param[in] point - \ru Точка - центр паттерна. + \en The point is the center of the pattern. \~ + \param[in] angle - \ru Угол поворота. + \en Angle of rotation. \~ + + \return \ru Дескриптор зарегистрированного паттерна. + \en Descriptor of registered pattern. \~ + + \details \ru Метод создает угловой паттерн, заданный центром и углом. + \en The method creates an angular pattern defined by a center and an angle. \~ +*/ +//--- +GCE_FUNC(pattern_item) GCE_AddAngularPattern( GCE_system gSys, GCE_point point, double angle ); + +//---------------------------------------------------------------------------------------- +/** \brief \ru Создать k-й экземпляр образца в данном паттерне. + \en Create k-th instance of the sample in a given pattern. \~ + \param[in] gSys - \ru Система ограничений. + \en System of constraints. \~ + \param[in] pItem - \ru Дескриптор паттерна. + \en Descriptor of pattern. \~ + \param[in] sample - \ru Дескриптор образца. + \en Descriptor of sample. \~ + \param[in] k - \ru Номер экземпляра. + \en Copy number. \~ + \return \ru Дескриптор зарегистрированного экземпляра. + \en Descriptor of registered instance. \~ + + \details \ru Метод создает k-й экземпляр образца в данном паттерне. + При k = 0 возвращает идентификатор образца. + \en The method creates the k-th instance of the sample in the given pattern. + It returns the sample descriptor if k = 0. \~ +*/ +//--- +GCE_FUNC(geom_item) GCE_AddInstance( GCE_system gSys, pattern_item pItem, geom_item sample, int k ); + //---------------------------------------------------------------------------------------- /** \brief \ru Добавить в систему жёсткое множество геометрических объектов. \en Add a rigid set of geometric objects to the system. \~ @@ -445,7 +525,7 @@ GCE_FUNC(bool) GCE_RemoveGeom( GCE_system gSys, geom_item g ); \en Control geometry object's lifetime by solver. \~ \param[in] gSys - \ru Система ограничений. \en System of constraints. \~ - \param[in] var - \ru Дескриптор геометрического. + \param[in] g - \ru Дескриптор геометрического объекта. \en Descriptor of geometric object. \~ */ //--- @@ -748,6 +828,20 @@ GCE_FUNC(geom_item) GCE_FixOffset( GCE_system gSys, geom_item curve ); //--- GCE_FUNC(bool) GCE_IsConstrainedGeom( GCE_system gSys, geom_item g ); +//---------------------------------------------------------------------------------------- +/** \brief \ru Функция отвечает на вопрос: Имеется ли хотя бы один экземпляр паттерна? + \en The function answers the question: Is there an instance of the pattern? \~ + \param[in] gSys - \ru Система ограничений. + \en System of constraints. \~ + \param[in] pattern - \ru Дескриптор паттерна. + \en Descriptor of pattern. \~ + \return \ru true, если для паттерна p существуют экземпляры какого-либо объекта. + \en true if there are instances of any object for pattern p. \~ + \sa GCE_RemovePattern, GCE_ReleasePattern +*/ +//--- +GCE_FUNC(bool) GCE_HasInstance( GCE_system gSys, pattern_item p ); + //---------------------------------------------------------------------------------------- /** \brief \ru Выполнить проверку удовлетворенности ограничения. \en Perform a check that a constraint is satisfied. \~ @@ -1361,6 +1455,28 @@ GCE_FUNC(constraint_item) GCE_AddDiameter( GCE_system gSys, geom_item cir, GCE_d //--- GCE_FUNC(constraint_item) GCE_AddLength( GCE_system gSys, geom_item curve, GCE_dim_pars dPar ); +//---------------------------------------------------------------------------------------- +/** \brief \ru Связать ограничением паттерна два геометрических объекта. + \en Bind two geometric objects by a pattern constraint. \~ + \param[in] gSys - \ru Система ограничений. + \en System of constraints. \~ + \param[in] pItem - \ru Дескриптор паттерна. + \en Descriptor of pattern. \~ + \param[in] sample - \ru Дескриптор образца. + \en Descriptor of sample. \~ + \param[in] instance - \ru Дескриптор экземпляра. + \en Descriptor of instance. \~ + \param[in] k - \ru Номер экземпляра. + \en Copy number. \~ + \return \ru Дескриптор зарегистрированного ограничения. + \en Descriptor of registered constrained. \~ + + \details \ru Метод связывает два объекта ограничением паттерна. + \en The method binds the two objects by a pattern constraint. \~ +*/ +//--- +GCE_FUNC(constraint_item) GCE_AddPatterned( GCE_system gSys, pattern_item pItem, geom_item sample, geom_item instance, int k ); + //---------------------------------------------------------------------------------------- /** \brief \ru Задать ограничение "Управляющий параметр" или "Фиксация переменной" \en Set the constraint "Driving parameter" or "Fixation of variable" \~ @@ -1430,6 +1546,24 @@ GCE_FUNC(constraint_item) GCE_FixLength( GCE_system gSys, geom_item ls ); // --- GCE_FUNC(constraint_item) GCE_FixRadius( GCE_system gSys, geom_item circ, coord_name cName = GCE_RADIUS ); +//---------------------------------------------------------------------------------------- +/** \brief \ru Задать фиксацию координаты параметрического объекта. + \en Specify fixation of a parametric object coordinate. \~ + \param[in] gSys - \ru Система ограничений. + \en System of constraints. \~ + \param[in] g - \ru Дескриптор объекта. + \en Descriptor of object. \~ + \param[in] cName - \ru Обозначение параметра объекта. + \en Denotation of object parameter. \~ + \return \ru Дескриптор зарегистрированного ограничения. + \en Descriptor of registered constrained. \~ + + \details \ru Задать фиксацию координаты параметрического объекта по типу координаты. + \en Set the fixation of the parametric object coordinate by coordinate type. \~ +*/ +//--- +GCE_FUNC(constraint_item) GCE_FixCoordValue( GCE_system gSys, geom_item g, coord_name cName ); + //---------------------------------------------------------------------------------------- /** \brief @@ -2016,7 +2150,8 @@ inline geom_item GCE_AddPoint( GCE_system gSys, GCE_point pVal, int ) \en An obsolete function. The call will be removed in one of the next versions. \~ */ //--- -GCE_FUNC(GCE_system) GCE_CreateSystem( void * ); +DEPRECATE_DECLARE +inline GCE_system GCE_CreateSystem(void*) { return nullptr; } //---------------------------------------------------------------------------------------- /** diff --git a/C3d/Include/gce_types.h b/C3d/Include/gce_types.h index 8483182..60e6613 100644 --- a/C3d/Include/gce_types.h +++ b/C3d/Include/gce_types.h @@ -56,6 +56,8 @@ typedef size_t geom_item; typedef size_t constraint_item; /// \ru Дескриптор переменной, зарегистрированной в решателе. \en Descriptor of a variable registered in the solver. typedef size_t var_item; +/// \ru Дескриптор паттерна, зарегистрированного в контексте решателя. \en Descriptor of pattern registered in the solver context. +typedef geom_item pattern_item; //---------------------------------------------------------------------------------------- // \ru Константы. \en Constants. @@ -67,7 +69,9 @@ const geom_item GCE_NULL_G = GCE_NULL; /// \ru Неопределенное значение дескриптора типа #var_item. \en Undefined value of #var_item type. const var_item GCE_NULL_V = GCE_NULL; /// \ru Неопределенное значение дескриптора типа #constraint_item. \en Undefined value of #constraint_item type. -const constraint_item GCE_NULL_C = GCE_NULL; +const constraint_item GCE_NULL_C = GCE_NULL; +/// \ru Неопределенное значение дескриптора типа #pattern_item. \en Undefined value of #pattern_item type. +const pattern_item GCE_NULL_P = GCE_NULL; /// \ru Не определенное значение числа double. \en An undefined value of double. const double GCE_UNDEFINED_DBL = UNDEFINED_DBL; @@ -91,16 +95,22 @@ typedef enum // \ru Дополнительные типы. \en Additional types. GCE_LINE_SEGMENT, ///< \ru Отрезок прямой. \en Line segment. GCE_SET, ///< \ru Подмножество геометрических объектов. \en Subset of geometric objects. + + // \ru Производные типы. \en Derived types. + GCE_INSTANCE, ///< \ru Экземпляр базового объекта. \en An instance of the base object. + GCE_PATTERN, ///< \ru Геометрический паттерн. \en A geometrical pattern. } geom_type; //---------------------------------------------------------------------------------------- -/** \brief \ru Варианты контрольных точек, запрашиваемых у геометрического объекта. - \en Variants of control point requested from a geometric object. - \details \ru Это перечисление применяется для запроса дескриптора характерных точке объекта, +/** \brief \ru Идентификаторы означающие контрольные точки и другие элементы, составляющие + запись (tuple) геометрического объекта. + \en IDs denoting control points and other elements that form a record (tuple) + of a geometric object. ~\ + \details \ru Это перечисление применяется для запроса дескриптора характерных точке объекта, таких как центр окружности, концевая точка кривой и т.д... \en This enum is used to request a descriptor of control point of an object, - such as center of circle, bounding point of a curve etc... + such as center of circle, bounding point of a curve etc... ~\ \see #GCE_PointOf */ //--- @@ -113,7 +123,7 @@ typedef enum , GCE_IMPROPER_POINT = 0 ///< \ru Точка, не принадлежащая объекту. \en Point not belonging to the object. , GCE_FIRST_END ///< \ru Первый конец ограниченной кривой. \en The first end of bounded curve. , GCE_SECOND_END ///< \ru Второй конец ограниченной кривой. \en The second end of bounded curve. - , GCE_CENTRE ///< \ru Центр окружности (дуги) или эллипса. \en Center of circle (arc) or ellipse. + , GCE_CENTRE ///< \ru Точка центра окружности, дуги или эллипса. \en Central point of circle, arc or ellipse. , GCE_PROPER_POINT ///< \ru Собственно точка. \en Proper point. , GCE_Q1 ///< \ru Квадрантная точка эллипса (3 часа). \en Quadrant point of ellipse (3 o'clock). , GCE_Q2 ///< \ru Квадрантная точка эллипса (12 часов). \en Quadrant point of ellipse (12 o'clock). @@ -124,7 +134,8 @@ typedef enum /* The values below are used only within the solver. */ - , GCE_DIRECTION ///< \ru Направляющий вектор эллипса (направление "большой" полуоси ). \en Vector of ellipse direction (direction of "major" semiaxis). + , GCE_DIRECTION ///< \ru Направляющий вектор эллипса (направление "большой" полуоси ) или паттерна. \en Vector of ellipse direction (direction of "major" semiaxis) or pattern. + , GCE_L_NORMAL ///< \ru Вектор нормали линейного объекта. \en Normal vector of a linear geometry entity. /** \brief \ru Единичный вектор ориентации: Нормаль прямой, направление "большой" полуоси эллипса. \en Unit vector of orientation: Normal of a line, direction of "major" semiaxis of ellipse. \~ */ @@ -154,6 +165,7 @@ typedef enum , GCE_MAJOR_RADIUS ///< \ru "Главная" полуось эллипса. \en "Major" semiaxis of ellipse. , GCE_MINOR_RADIUS ///< \ru "Малая" полуось эллипса. \en "Minor" semiaxis of ellipse. , GCE_OFFSET ///< \ru Смещение эквидистантной кривой. \en Offset of equidistant curve. + , GCE_STEP ///< \ru Линейное или угловое смещение паттерна. \en Linear or angular pattern shift. , GCE_NULL_CRD ///< \ru Пустая (несуществующая) координата. \en Empty (nonexistent) coordinate. } coord_name; @@ -170,10 +182,9 @@ typedef coord_name coord_type; typedef enum { // \ru Унарные геометрические ограничения: \en Unary geometric constraints: - GCE_FIX_GEOM + GCE_FIX_GEOM ///< \ru Фиксация геометрического объекта. \en Fixation of geometric object. , GCE_HORIZONTAL ///< \ru Горизонтальность прямой или отрезка. \en Horizontality of a linear object. , GCE_VERTICAL ///< \ru Вертикальность прямой или отрезка. \en Verticality of a linear object. - , GCE_LENGTH ///< \ru Фиксация длины отрезка. \en Fixation of length of a line segment. , GCE_ANGLE_OX // \ru Бинарные геометрические ограничения: "constr( geom1, geom2 )" \en Binary geometric constraints: "constr( geom1, geom2 )" @@ -195,10 +206,12 @@ typedef enum , GCE_SYMMETRIC ///< \ru Симметричность. \en Symmetry. , GCE_PERCENT_POINT ///< \ru \en , GCE_EQUATION ///< \ru Уравнение. \en Equation. + , GCE_PATTERNED ///< \ru Связать паттерном пару кривых. \en Bind a pair of curves in a pattern. // \ru Размерные геометрические ограничения. \en Dimensional geometric constraints. , GCE_DISTANCE , GCE_DIAMETER + , GCE_LENGTH ///< \ru Фиксация длины отрезка или дуги. \en Fixation of length of a line segment or arc. , GCE_RADIUS_DIM , GCE_OFFSET_DIM , GCE_ANGLE @@ -233,6 +246,7 @@ typedef enum GCE_RESULT_IsNotDrivingDimension = 14, ///< \ru Данное ограничение должно быть управляющим размером. \en Given constraint should be a driving dimension. GCE_RESULT_UnsupportedConstraint = 15, ///< \ru На геометрические объекты было наложено невозможное ограничение. \en An impossible constraint was set on geometric objects. GCE_RESULT_AnisotropicScaling = 16, ///< \ru Анизотропное масштабирование. \en Anisotropic scaling. + GCE_RESULT_OverconstrainedInstance = 17, ///< \ru Попытка подчинить экземпляр более, чем одному паттерну. \en An attempt to make an instance patterned on more than one pattern. } GCE_result; //---------------------------------------------------------------------------------------- @@ -287,7 +301,7 @@ typedef enum , GCE_STATUS_WellTreated = 1 // Ограничение принадлежит рабочей части системы ограничений без переопределений. , GCE_STATUS_WellConditioned = 2 // Ограничение принадлежит хорошо-обусловленной части уравнений. , GCE_STATUS_IllConditioned = 3 ///< /ru Ограничения из плохо-обусловленной части. /en A constraint of ill-condition - , GCE_STATUS_Redundant = 4 ///< /ru Ограничение игнорируется решателем по причине избыточности. // en A constraint is ignored by the solving process beacause of the redundancy. + , GCE_STATUS_Redundant = 4 ///< /ru Ограничение игнорируется решателем по причине избыточности. // en A constraint is ignored by the solving process because of the redundancy. /* Statuses resulting the evaluation (call GCE_Evaluate). diff --git a/C3d/Include/gcm_manager.h b/C3d/Include/gcm_manager.h index 3faf73d..38bb560 100644 --- a/C3d/Include/gcm_manager.h +++ b/C3d/Include/gcm_manager.h @@ -299,7 +299,7 @@ private: CNodeIterator * m_cIter; const MtConstraintSystem * m_gcSystem; -public: +public: ItConstraintIter(); ItConstraintIter( const ItConstraintIter & ); ItConstraintIter & operator = ( const ItConstraintIter & ); @@ -337,7 +337,7 @@ class MtBlackboxManager; // Internal implementation of Blackbox manager. //---------------------------------------------------------------------------------------- /** \brief \ru Геометрический решатель. \en Geometric constraint solver. \~ - \details \ru Интерфейс геометрического решателя. Клиентское приложение может + \details \ru Интерфейс геометрического решателя. Клиентское приложение может с работать любым количеством систем ограничений, для каждой из них заводится по одному экземпляру решателя с помощью вызова #CreateSolver. \en Interface of geometric solver. Client application can @@ -402,10 +402,7 @@ public: \en Add constraint of three geometric objects. \~ */ ItConstraintItem * AddConstraint ( MtMateType, MtArgument, MtArgument, MtArgument, - MtParVariant p1 = MtParVariant::undef, MtParVariant p2 = MtParVariant::undef ); - - /// \ru Добавить ограничение. \en Add constraint. - ItConstraintItem * AddConstraint( MtArgument, MtArgument, const GCM_c_params &, MtResultCode3D & ); + MtParVariant p1 = MtParVariant::undef, MtParVariant p2 = MtParVariant::undef ); /** \brief \ru Добавить черный ящик в систему ограничений. \en Add black box to the constraint system. \~ @@ -649,10 +646,11 @@ public: GCM_system System() const; // Not yet documented - void WriteSystem( TCHAR * fileName ); + void WriteSystem( TCHAR * fileName ); /// \ru Выдать ограничения. \en Get the constraints iterator. SPtr GetConstraintsEnum(); +public: /** \} \ru \name Устаревшие функции, которые будут удалены в будущей версии. @@ -661,33 +659,38 @@ public: */ /// \ru Функция будет удалена из API. Использовать ChangeDefinition(). \en The call is deprecated. Use ChangeDefinition() instead this. - MtResultCode3D ChangeAlignCondition( ItConstraintItem & ); - MtResultCode3D FixGeom( ItGeom & ); + DEPRECATE_DECLARE MtResultCode3D ChangeAlignCondition( ItConstraintItem & ); + DEPRECATE_DECLARE MtResultCode3D FixGeom( ItGeom & ); + DEPRECATE_DECLARE ItConstraintItem * AddConstraint( MtArgument, MtArgument, const GCM_c_params &, MtResultCode3D & ); + /// \ru Функция будет удалена из API. Использовать Evalute(). \en The call is deprecated. Use Evaluate() instead this. + DEPRECATE_DECLARE MtResultCode3D Solve( bool diagQuery ); /** \} */ -//protected: - /// \ru Функция будет удалена из API. Использовать Evalute(). \en The call is deprecated. Use Evaluate() instead this. - MtResultCode3D Solve( bool diagQuery ); // Internal use only - GCM_geom _QueryArgument( const MtArgument & gArg ); + GCM_geom _QueryArgument( const MtArgument & gArg ); protected: const ItGeom * _SetDependencyGeom( MtGeomId gId, const ItGeom * gItem ); -protected: - MtGeomSolver(); - ~MtGeomSolver(); +public: + // Constructor for internal use only. Use the call GCM_CreareSolver. + MtGeomSolver( SPtr ); + // Constructor for internal use only. Use the call GCM_GetSolver. + MtGeomSolver( GCM_system ); private: - MtConstraintManager * _Impl(); - const MtConstraintManager * _Impl() const; + ~MtGeomSolver(); + + MtConstraintManager * _Impl() { return myImpl; } + const MtConstraintManager * _Impl() const { return myImpl; } MtBlackboxManager * _BBoxMan(); const MtBlackboxManager * _BBoxMan() const; - MtBlackboxManager * myBBManager; + MtConstraintManager * myImpl; ///< \ru Внутренняя реализация экземпляра геометрического солвера. \en Internal implementation of the solver instance. + MtBlackboxManager * myBBManager; ///< \ru Менеджер черных ящиков. \en Manager of blackboxies. private: MtGeomSolver( const MtGeomSolver & ); @@ -695,26 +698,22 @@ private: }; //---------------------------------------------------------------------------------------- -/** \brief \ru Создать пустую систему ограничений. - \en Create an empty constraint system. \~ +/** \brief \ru Создать объектно-ориентированный интерфейс 3D солвера. + \en Create an object-oriented interface of 3D solver. \~ \details \ru Вызов создает пустую систему ограничений. Кроме того, в памяти создаются внутренние структуры данных геометрического решателя, обслуживающего - систему ограничений. Функция возвращает специальный дескриптор, по которому - система ограничений доступна для различных манипуляций: добавление или удаление - геометрических объектов, ограничений, варьирование размеров, драггинг - недоопределенных объектов и т.д. + систему ограничений. Функция возвращает экземпляр класса, представляющего + объектно-ориентированный интерфейс солвера. \en The call creates an empty constraint system. Besides, there are created internal data structures of geometric solver maintaining the system of constraints. - The function returns a special descriptor by which - the constraint system is available for various manipulations: addition and deletion - of geometric objects, constraints, variation of sizes, dragging - underdetermined objects etc. \~ + The function returns an instance of class representing an object-oriented interface + of the 3D solver. \~ - \return \ru Дескриптор системы ограничений. - \en Descriptor of constraint system. \~ + \return \ru Решатель геометрических ограничений. + \en A geometric constraint solver. \~ */ //--- -GCM_FUNC(GCM_system) GCM_CreateSystem( ItPositionManager * ); +GCM_FUNC(SPtr) GCM_CreateSolver( SPtr ); //---------------------------------------------------------------------------------------- /** \brief \ru Выдать решатель для данной системы геометрических ограничений. @@ -725,6 +724,24 @@ GCM_FUNC(SPtr) GCM_GetSolver( GCM_system gSys ); /** \} */ +//---------------------------------------------------------------------------------------- +// The call is for internal use only. +/* + Use method SPtr GCM_CreateSolver(ItPositionManager *) to cteate object-oriented + representation of the C3D Solver. Use call GCM_CreateSystem(void) to work with basic API + of the geometric solver (gce_api.h). +*/ +//--- +GCM_FUNC(GCM_system) GCM_CreateSystem( ItPositionManager * ); + +//---------------------------------------------------------------------------------------- +// Запрос на аргумент (создать впервые или найти имеющийся), основано на базовом API +/* + Internal use only. +*/ +//--- +GCM_geom GCM_QueryArgument( GCM_system gSys, const MtArgument & gArg ); + /* Deprecated typenames */ @@ -732,13 +749,13 @@ typedef MtGeomSolver IfGCManager; typedef MtRepositionMode MtTypeOfReposition; /// \ru Полно-заданное или фиксированное тело (нулевая степень свободы). \en Fully-specified or fixed solid (zero degree of freedom). -static const GCM_dof_result sof_Zero = GCM_DOF_RESULT_WellDefined; +static const GCM_dof_result sof_Zero = GCM_DOF_RESULT_WellDefined; /// \ru Полно-заданное или фиксированное тело (нулевая степень свободы). \en Fully-specified or fixed solid (zero degree of freedom). static const GCM_dof_result sof_WellConstrained = GCM_DOF_RESULT_WellDefined; /// \ru Недоопределенное тело, т.е. имеющее степень свободы. \en Underconstrained solid, i.e. having a degree of freedom. -static const GCM_dof_result sof_UnderConstrained = GCM_DOF_RESULT_UnderDefined; +static const GCM_dof_result sof_UnderConstrained = GCM_DOF_RESULT_UnderDefined; /// \ru Нет сведений о степени свободы. \en No information about the degree of freedom. -static const GCM_dof_result sof_Unknown = GCM_DOF_RESULT_Unknown; +static const GCM_dof_result sof_Unknown = GCM_DOF_RESULT_Unknown; #endif // __GCM_MANAGER_H diff --git a/C3d/Include/gcm_routines.h b/C3d/Include/gcm_routines.h index d002813..faa9044 100644 --- a/C3d/Include/gcm_routines.h +++ b/C3d/Include/gcm_routines.h @@ -304,7 +304,7 @@ GCM_FUNC(bool) IsCompatibleMatingGeometry( const ItConstraintItem & cItem ); \return \ru true, если функция выполнена успешно. \en true if the function is performed successfully. \~ - \par \ru Реализация + \par \ru Реализация \en Implementation \~ gPlaces[0] = gPlaces[2];\n gPlaces[0].Transform( gPlaces[3].GetMatrixInto() );\n @@ -429,7 +429,38 @@ GCM_FUNC(const ItGeom *) GCM_SetDependencyGeom( GCM_system gSys, MtGeomId, const GCM_FUNC(void) GCM_GetProperties( GCM_system gSys , MbProperties & props ); //---------------------------------------------------------------------------------------- -/** \brief \ru Импортировать систему геометрических ограничений в модель C3D +/** \brief \ru Специфическая диагностика объекта, зависимого от истории построения. + \en Specific diagnostics of a geometric object dependent on the construction history. \~ + \param[in] gSys - \ru Система геометрических ограничений, в которой вычисляется объект диагностики gPtr. + \en The system of geometric constraints in which the diagnostic object 'gPtr' is evaluated. \~ + \param[in] gPtr - \ru Указатель на геометрический объект CAD-модели, текущее состояние + которого вычислено в истории построения сборки САПР. + \en A pointer to a CAD model object whose current state is + computed in the build history of the CAD assembly. \~ + \result \ru Результирующий код ошибки в ситуации противоречия. + \en Resulting error code in the contradiction case. \~ + + \details \ru Вызов API нацелен на диагностику геометрического объекта, который одновременно + подчинен истории построения CAD-сборки и в то же время вычисляется в системе + ограничений. Алгоритм выявляет ситуацию, когда текущее состояние объекта истории + построения противоречит состоянию, вычисленному в системе ограничений. + Результатом работы является код ошибки, который раздается всем смежным ограничениям, + реализованным на стороне приложения в типе ItConstraintItem. + \en The API-call is aimed at diagnosing a geometric object which at the same time + subordinate to the CAD-assembly built history and at the same time evaluated in + the constraint system. The algorithm detects the situation when the current + state of the history-based object contradicts the state evaluated in the solver. + The result of the call is an error code that is distributed to all adjacent constraints + inherited from ItConstraintItem inside the application. \~ + \note \ru Корректный результат предполагается только после попытки решить систему + ограничений (т.е. вызов GCM_Evaluate или MtGeomSolver::Evaluate). + \en The correct result is assumed only after the evaluating call (ie GCM_Evaluate or MtGeomSolver::Evaluate). \~ +*/ +//--- +GCM_FUNC(GCM_result) GCM_DiagnoseHistoryDependent( GCM_system gSys, const ItGeom * gPtr ); + +//---------------------------------------------------------------------------------------- +/** \brief \ru Импортировать систему геометрических ограничений в модель C3D. \en Import the constraint system into C3D-model. \~ \details \ru Алгоритм импорта распознает каркасные структуры в системе ограничений и записывает их в файл формата C3D. Обнаруженные структуры конвертируются @@ -452,38 +483,31 @@ GCM_FUNC(size_t) VolumeOfAlignOption( const ItConstraintItem & ); /** \} */ // GCM_3D_Routines -//---------------------------------------------------------------------------------------- -/* - \ru Вызов устарел, будет удален в одной из последующих версий - \en This call is out of date, it will be removed in a future version (V17 or later) \~ -*/ -//--- -GCM_FUNC(MtGeomSolver &) Construct_GCMImp( ItPositionManager & ); - //---------------------------------------------------------------------------------------- // for internal use only +// \en This call is out of date, it will be removed in 2023. \~ //--- -GCM_FUNC(MtResultCode3D) AdHocDiagnose( MtGeomSolver *, const ItGeom * ); +DEPRECATE_DECLARE GCM_FUNC(MtResultCode3D) AdHocDiagnose(GCM_system, const ItGeom*); //---------------------------------------------------------------------------------------- // for testing only //--- -GCM_FUNC(bool) CheckSatisfaction( MtGeomSolver * ); +GCT_FUNC(bool) CheckSatisfaction( GCM_system ); //---------------------------------------------------------------------------------------- // for testing only //--- -GCM_FUNC(size_t) GetGeomsCount( MtGeomSolver * ); +GCT_FUNC(size_t) GetGeomsCount( GCM_system ); //---------------------------------------------------------------------------------------- // for testing only //--- -GCM_FUNC(size_t) GetConstraintsCount( MtGeomSolver * ); +GCT_FUNC(size_t) GetConstraintsCount( GCM_system ); //---------------------------------------------------------------------------------------- // Get a range to traverse constraints of the system //--- -GCM_FUNC(void) GCM_GetConstraints( GCM_system gSys, CNodeIterator & begIter, CNodeIterator & endIter ); +GCT_FUNC(void) GCM_GetConstraints( GCM_system gSys, CNodeIterator & begIter, CNodeIterator & endIter ); #endif // __GCM_ROUTINES_H diff --git a/C3d/Include/gcm_types.h b/C3d/Include/gcm_types.h index afca91f..e4d26fe 100644 --- a/C3d/Include/gcm_types.h +++ b/C3d/Include/gcm_types.h @@ -12,10 +12,11 @@ #include #include -class MtGeomSolver; -class MbPlacement3D; +class MbPlacement3D; // Local coordinate system that represents position and orientation of 3D object. +struct MtSystemHolder {}; // An internal data object that provides the constraint system. -#define GCM_ID_TYPE 1 // 1 - MtObjectId is a struct, 0 - MtObjectId is simple integer. +#define GCM_ID_TYPE 1 // 1 - MtObjectId is a pod struct, 0 - MtObjectId is simple integer. +#define GCM_SYSTEM_TYPE 1 // 1 - GCM_system is ptr , 0 - GCM_system is a ptr. #if ( GCM_ID_TYPE == 1 ) @@ -31,12 +32,20 @@ const MtObjectId _GCM_GROUND = 0; #endif // GCM_ID_TYPE + + /** \addtogroup GCM_3D_API \{ */ - +#if ( GCM_SYSTEM_TYPE == 1 ) +class MtRefItem; /// \ru Система геометрических ограничений. \en System of geometric constraints. \~ -typedef MtGeomSolver* GCM_system; +typedef MtRefItem* GCM_system; +#else // GCM_SYSTEM_TYPE +/// \ru Система геометрических ограничений. \en System of geometric constraints. \~ +typedef struct MtSystemHolder* GCM_system; +#endif // GCM_SYSTEM_TYPE + /// \ru Дескриптор геометрического объекта, зарегистрированного в контексте решателя. \en Descriptor of geometrical object registered in the constraint system. typedef MtObjectId GCM_object; /// \ru Дескриптор геометрического объекта, зарегистрированного в контексте решателя. \en Descriptor of geometrical object registered in the constraint system. diff --git a/C3d/Include/heal_imported.h b/C3d/Include/heal_imported.h new file mode 100644 index 0000000..cd79c2c --- /dev/null +++ b/C3d/Include/heal_imported.h @@ -0,0 +1,43 @@ +//////////////////////////////////////////////////////////////////////////////// +/** + \file + \brief \ru Постобработка импортированных тел. + \en Pospprocessing of imported solids. \~ + \details \ru Установка характеристик и геометрии в соответствие с критериями C3D Modeler. + \en Tuning characteristric and geometry of solids according to the C3D Modeler criteria. \~ +*/ +//////////////////////////////////////////////////////////////////////////////// + +#ifndef __HEAL_IMPORTED_H +#define __HEAL_IMPORTED_H + +#include +class MbSolid; + +/** \brief \ru Скорректировать тип кривых пересечения в рёбрах. + \en Set the right type of intersecion curves in edges. \~ +\param[out] solid - \ru Тело для обработки. + \en Solid to be processed. \~ +\details \ru В кривых пересечения, построенных по точкам и объявленных cbt_Tolerant проводится +проверка нормалей поверхностей на колинеарность. В случае, если нормали не колинеарны, +тип меняется на cbt_Specific. + \en In curves built by points and classified as cbt_Toleranc the check if the surfaces' normals are + colinear is performed. In case the nornals are not colinear the type is switched to the cbt_Specific. \~ +\ingroup Data_Exchange +*/ +CONV_FUNC( void ) AdjustIntersectionCurvesType( MbSolid& solid ); + + +/** \brief \ru Установить точки вершин по рёбрам. + \en Set the verticis' poins by edges. \~ +\param[out] solid - \ru Тело для обработки. + \en Solid to be processed. \~ +\details \ru В качестве точки вершины устанавливается средняя точка концов кривых в рёбрах + примыкающих к врешине. + \en The location of the vertes is set as the average value of end points of the curves of adjacent edges. \~ +\ingroup Data_Exchange +*/ +CONV_FUNC( void ) AdjustVerticisGeometryByEdges( MbSolid& solid ); + + +#endif // __HEAL_IMPORTED_H diff --git a/C3d/Include/io_tape.h b/C3d/Include/io_tape.h index 603c003..ea668dc 100644 --- a/C3d/Include/io_tape.h +++ b/C3d/Include/io_tape.h @@ -1876,6 +1876,7 @@ ClassDescriptor TapeClassForNewObjects::GetPackedClassNameForWrite( long version // \ru Удаление пробелов, записей перед пробелами, символов "<" и ">". // \en Deleting of spaces, records before spaces, symbols "<" and ">". \~ // \ingroup Base_Tools_IO +DEPRECATE_DECLARE MATH_FUNC( const char * ) pureTemplateName( const char * name ); //---------------------------------------------------------------------------------------- @@ -1908,27 +1909,7 @@ MATH_FUNC( const char * ) pureTemplateName( const char * name ); // \ru Например, для имени "class ClassX" функция возвращает "ClassXClassAClassB". // \ru For example, for the name "class ClassX" the function returns "ClassXClassAClassB". // --- -inline const char * pureName( const char * name ) -{ - if ( name && *name ) { - if ( name[strlen(name) - 1] == '>' ) { - return pureTemplateName( name ); - } - -#ifdef _MSC_VER - // \ru убираем ключевые слова "class", "struct" и т.д. в начале строки \en remove the keywords "class", "struct" and so on at the beginning of the string - ptrdiff_t i = strlen( name ) - 1; - for ( ; i >= 0 && name[i] != ' '; i-- ); - return ( (i >= 0) && (name[i] == ' ') ) ? &(name[i + 1]) : name; -#else // _MSC_VER - // \ru убираем длину имени в начале строки \en remove the name length at the beginning of the string - for ( size_t i = 0, c = strlen(name); i < c; i++ ) - if ( !(name[i] >= '0' && name[i] <= '9') ) - return &( name[i] ); -#endif // _MSC_VER - } - return name; -} +MATH_FUNC( const char * ) pureName( const char * name ); //---------------------------------------------------------------------------------------- /// \ru Упаковать строку(имя класса) в uint16. \en Pack the string (class name) into uint16. \~ \ingroup Base_Tools_IO diff --git a/C3d/Include/mb_operation_result.h b/C3d/Include/mb_operation_result.h index 634c99b..a917644 100644 --- a/C3d/Include/mb_operation_result.h +++ b/C3d/Include/mb_operation_result.h @@ -276,6 +276,7 @@ enum MbResultType { rt_CurveClosedAtStart, ///< \ru Кривая замкнулась в начале. \en The curve has been closed at start point. rt_CurveClosedAtEnd, ///< \ru Кривая замкнулась в конце. \en The curve has been closed at end point. rt_CurveClosedBothSides, ///< \ru Кривая замкнулась с двух сторон. \en The curve has been closed at both sides. + rt_BeyondLimitsExtension, ///< \ru Продленная поверхностная кривая вышла за границы поверхности. \en Extended surface curve abandons surface boundary. // \ru !!! СТРОКИ ВСТАВЛЯТЬ СТРОГО ПЕРЕД ЭТОЙ СТРОКОЙ !!!! \en !!! INSERT LINES STRICTLY BEFORE THIS LINE !!!! rt_ErrorTotal // \ru НИЖЕ НЕ ДОБАВЛЯТЬ! \en DON'T ADD BELOW! diff --git a/C3d/Include/mb_oriented_box.h b/C3d/Include/mb_oriented_box.h index 542202e..ea575e8 100644 --- a/C3d/Include/mb_oriented_box.h +++ b/C3d/Include/mb_oriented_box.h @@ -31,7 +31,7 @@ class MATH_CLASS MbOrientedBox { private: - static constexpr size_t vertNb = 8; ///< \ru Количество вершин параллелепипеда. \en. Number of vertices of the box.\~ + static constexpr size_t vertNb = 8; ///< \ru Количество вершин параллелепипеда. \en. Number of vertices of the box.\~ MbCartPoint3D m_center; ///< \ru Центр параллелепипеда. \en Center of the parallelepiped.\~ MbVector3D m_xAxis, m_yAxis, m_zAxis; ///< \ru Ортогонормированная тройка векторов ориентации. \en The orthogonormal triplet of orientation vectors.\~ diff --git a/C3d/Include/mb_property_title.h b/C3d/Include/mb_property_title.h index 53bd405..b8570c2 100644 --- a/C3d/Include/mb_property_title.h +++ b/C3d/Include/mb_property_title.h @@ -1244,6 +1244,7 @@ enum MbePrompt IDS_PROP_1155, // "СК паттерн." IDS_PROP_1156, // "Координата СК паттерна." IDS_PROP_1157, // "Опция масштабируемости паттерна GCM_scale." + IDS_PROP_1158, // "Паттерн для пары кривых" IDS_PROP_1199, // The last id for C3D Solver // \ru Новые описания без группировки \en New unsorted descriptions diff --git a/C3d/Include/model_tree.h b/C3d/Include/model_tree.h index 2584772..7e36f52 100644 --- a/C3d/Include/model_tree.h +++ b/C3d/Include/model_tree.h @@ -148,7 +148,7 @@ public: private: MbEmbodimentNode(); - MbEmbodimentNode( const MbEmbodimentNode * emb ); + MbEmbodimentNode( const MbEmbodimentNode & emb ); }; //---------------------------------------------------------------------------------------- diff --git a/C3d/Include/op_shell_parameter.h b/C3d/Include/op_shell_parameter.h index b639325..3d2a925 100644 --- a/C3d/Include/op_shell_parameter.h +++ b/C3d/Include/op_shell_parameter.h @@ -991,8 +991,6 @@ public: MbCurveMate( const MbEdge &, const MbMatrix3D & ); /// \ru Конструктор копирования. \en Copy constructor. MbCurveMate( const MbCurveMate & other, MbRegDuplicate * ireg ); - /// \ru Конструктор копирования. \en Copy cConstructor. - MbCurveMate( const MbCurveMate & ); /// \ru Деструктор. \en Destructor. virtual ~MbCurveMate(); @@ -1040,6 +1038,7 @@ private: // \ru Инициализация сопряжения. \en Mating initialization. void InitMating( const MbPatchMating & other ); +OBVIOUS_PRIVATE_COPY( MbCurveMate ) DECLARE_PERSISTENT_CLASS( MbCurveMate ) }; diff --git a/C3d/Include/surface.h b/C3d/Include/surface.h index 3cd0e98..3257e85 100644 --- a/C3d/Include/surface.h +++ b/C3d/Include/surface.h @@ -46,24 +46,34 @@ struct MbNurbsParameters; class MATH_CLASS MbSurface; namespace c3d // namespace C3D { -typedef SPtr SurfaceSPtr; -typedef SPtr ConstSurfaceSPtr; +typedef SPtr SurfaceSPtr; +typedef SPtr ConstSurfaceSPtr; -typedef std::vector SurfacesVector; -typedef std::vector ConstSurfacesVector; +typedef std::vector SurfacesVector; +typedef std::vector ConstSurfacesVector; +typedef std::set SurfacesSet; +typedef std::set ConstSurfacesSet; -typedef std::vector SurfacesSPtrVector; -typedef std::vector ConstSurfacesSPtrVector; +typedef std::vector SurfacesSPtrVector; +typedef std::vector ConstSurfacesSPtrVector; +typedef std::set SurfacesSPtrSet; +typedef std::set ConstSurfacesSPtrSet; -typedef std::set SurfacesSet; -typedef SurfacesSet::iterator SurfacesSetIt; -typedef SurfacesSet::const_iterator SurfacesSetConstIt; -typedef std::pair SurfacesSetRet; +typedef SurfacesSet::iterator SurfacesSetIt; +typedef SurfacesSet::const_iterator SurfacesSetConstIt; +typedef std::pair SurfacesSetRet; -typedef std::set ConstSurfacesSet; -typedef ConstSurfacesSet::iterator ConstSurfacesSetIt; -typedef ConstSurfacesSet::const_iterator ConstSurfacesSetConstIt; -typedef std::pair ConstSurfacesSetRet; +typedef ConstSurfacesSet::iterator ConstSurfacesSetIt; +typedef ConstSurfacesSet::const_iterator ConstSurfacesSetConstIt; +typedef std::pair ConstSurfacesSetRet; + +typedef SurfacesSPtrSet::iterator SurfacesSPtrSetIt; +typedef SurfacesSPtrSet::const_iterator SurfacesSPtrSetConstIt; +typedef std::pair SurfacesSPtrSetRet; + +typedef ConstSurfacesSPtrSet::iterator ConstSurfacesSPtrSetIt; +typedef ConstSurfacesSPtrSet::const_iterator ConstSurfacesSPtrSetConstIt; +typedef std::pair ConstSurfacesSPtrSetRet; } diff --git a/C3d/Include/templ_csp_array.h b/C3d/Include/templ_csp_array.h index 8dd90a1..5430818 100644 --- a/C3d/Include/templ_csp_array.h +++ b/C3d/Include/templ_csp_array.h @@ -70,8 +70,16 @@ public: using SPArray::SetSize; using SPArray::GetLast; + using SPArray::empty; + using SPArray::size; + using SPArray::reserve; + using SPArray::capacity; using SPArray::begin; - + using SPArray::end; + using SPArray::front; + using SPArray::back; + using SPArray::clear; + using SPArray::shrink_to_fit; /// \ru Задать метод выбора удаляемого элемента из двух одинаковых. \en Set the selection method of the item to remove from the two identical. void SetLessFunc( LessFuncPtr func ) { m_lessFunc = func; } /// \ru Добавить массив без сортировки. \en Add array without sorting. diff --git a/C3d/Include/templ_css_array.h b/C3d/Include/templ_css_array.h index 4ea0f52..d5e4d32 100644 --- a/C3d/Include/templ_css_array.h +++ b/C3d/Include/templ_css_array.h @@ -92,9 +92,13 @@ public: using SSArray::empty; using SSArray::size; using SSArray::reserve; + using SSArray::capacity; + using SSArray::front; + using SSArray::back; using SSArray::clear; using SSArray::begin; + using SSArray::end; void AddNoSort( const Type & ent ) { SSArray::AddSimple( ent ); m_sort = false; } ///< \ru Добавить элемент без сортировки. \en Add element without sorting. Type * Add ( const Type & ); ///< \ru Добавить элемент с упорядочиванием по массиву. \en Add element with sorting. diff --git a/C3d/Include/templ_ifc_array.h b/C3d/Include/templ_ifc_array.h index e8f141d..e1dbc16 100644 --- a/C3d/Include/templ_ifc_array.h +++ b/C3d/Include/templ_ifc_array.h @@ -133,6 +133,8 @@ public: // \ru Стандартные функции контейнерного using RPArray::begin; //const stored_type * begin() const { return RPArray::begin(); } ///< \ru Получить указатель на участок памяти после массива. \en Get the pointer to the piece of memory after the array. using RPArray::end; //const stored_type * end() const { return RPArray::end(); } + using RPArray::front; + using RPArray::back; public: // \ru Функции для упрощения перехода на std::vector>. \en Functions to replace this class to std::vector>. void push_back( const SPtr & elem ) { Add(elem.get()); } diff --git a/C3d/Include/templ_im_array.h b/C3d/Include/templ_im_array.h index f55e029..cd802ea 100644 --- a/C3d/Include/templ_im_array.h +++ b/C3d/Include/templ_im_array.h @@ -59,6 +59,16 @@ public: using SArray::Reserve; using SArray::SetSize; + using SArray::empty; + using SArray::size; + using SArray::reserve; + using SArray::capacity; + using SArray::begin; + using SArray::end; + using SArray::front; + using SArray::back; + using SArray::clear; + Type * Add( size_t ind, size_t * ); // \ru добавить элемент с упорядочиванием по массиву \en add element with sorting size_t Add( Type * ent, size_t * ); // \ru добавить элемент с упорядочиванием по массиву \en add element with sorting diff --git a/C3d/Include/templ_sfdp_array.h b/C3d/Include/templ_sfdp_array.h index fcd39b1..9d47f0b 100644 --- a/C3d/Include/templ_sfdp_array.h +++ b/C3d/Include/templ_sfdp_array.h @@ -64,6 +64,8 @@ using FDPArray::clear; using RPArray::empty; using RPArray::size; +using RPArray::reserve; +using RPArray::capacity; using RPArray::begin; using RPArray::end; using RPArray::cbegin; diff --git a/C3d/Include/templ_sfp_array.h b/C3d/Include/templ_sfp_array.h index 8dfee8f..30319b4 100644 --- a/C3d/Include/templ_sfp_array.h +++ b/C3d/Include/templ_sfp_array.h @@ -75,6 +75,16 @@ public : using PArray::SetSize; using PArray::GetLast; + using PArray::empty; + using PArray::size; + using PArray::reserve; + using PArray::capacity; + using PArray::begin; + using PArray::end; + using PArray::front; + using PArray::back; + using PArray::clear; + Type * Add( Type * ); // \ru добавить элемент с упорядочиванием по массиву \en add element with sorting Type * Add( Type *, size_t & indexEnt );// \ru добавить элемент с упорядочиванием по массиву, возвращает индекс \en add element with sorting, returns index of the element. void AddSimple( Type * ent ) { m_sort = false; PArray::Add( ent ); } // \ru Доступ к функции базового класса - добавить элемент в конец массива \en An access to the function of the base class - add an element to the end of the array diff --git a/C3d/Include/templ_sp_array.h b/C3d/Include/templ_sp_array.h index 25848ae..25fb2e0 100644 --- a/C3d/Include/templ_sp_array.h +++ b/C3d/Include/templ_sp_array.h @@ -50,6 +50,16 @@ public : using PArray::GetLast; using PArray::FindIt; + using PArray::empty; + using PArray::size; + using PArray::reserve; + using PArray::capacity; + using PArray::begin; + using PArray::end; + using PArray::front; + using PArray::back; + using PArray::clear; + Type * Add( Type * ); // \ru добавить элемент с упорядочиванием по массиву \en add element with sorting Type * Add( Type *, size_t & indexEnt );// \ru добавить элемент с упорядочиванием по массиву, возвращает индекс \en add element with sorting, returns index of the element diff --git a/C3d/Include/templ_sptr.h b/C3d/Include/templ_sptr.h index e5da539..782505f 100644 --- a/C3d/Include/templ_sptr.h +++ b/C3d/Include/templ_sptr.h @@ -143,6 +143,12 @@ public: src.m_pI = tmp; return *this; } + + /// \ru Преобразовать к SPtr на другой класс. \en Cast to SPtr to another class. + template + SPtr static_cast_to() { + return SPtr { static_cast(get()) }; + } }; diff --git a/C3d/Include/templ_ss_array.h b/C3d/Include/templ_ss_array.h index 7c6cc2a..7b521e5 100644 --- a/C3d/Include/templ_ss_array.h +++ b/C3d/Include/templ_ss_array.h @@ -56,14 +56,19 @@ public: using SArray::SetSize; using SArray::SetMaxDelta; + using SArray::empty; using SArray::size; using SArray::reserve; - using SArray::front; - using SArray::back; + using SArray::capacity; using SArray::begin; using SArray::end; - using SArray::erase; + using SArray::cbegin; + using SArray::cend; + using SArray::front; + using SArray::back; using SArray::clear; + using SArray::erase; + using SArray::shrink_to_fit; Type * Add ( const Type & ); // \ru добавить элемент с упорядочиванием по массиву \en add element with sorting Type * Add ( const Type &, size_t & indexEnt ); // \ru добавить элемент с упорядочиванием по массиву, возвращает индекс \en add element with sorting, returns index of the element diff --git a/C3d/Include/tool_mutex.h b/C3d/Include/tool_mutex.h index 241541e..9f1dab0 100644 --- a/C3d/Include/tool_mutex.h +++ b/C3d/Include/tool_mutex.h @@ -582,7 +582,9 @@ public: \en Get a pointer to the mutex object. */ CommonRecursiveMutex * GetLock() const; - +protected: + MbPersistentNestSyncItem( const MbPersistentNestSyncItem & ); + MbPersistentNestSyncItem & operator = ( const MbPersistentNestSyncItem & ); }; diff --git a/C3d/Include/tool_progress_indicator.h b/C3d/Include/tool_progress_indicator.h index 68f8cc3..7af0e43 100644 --- a/C3d/Include/tool_progress_indicator.h +++ b/C3d/Include/tool_progress_indicator.h @@ -10,6 +10,7 @@ #ifndef __TOOL_PROGRESS_INDICATOR_H #define __TOOL_PROGRESS_INDICATOR_H +#include //------------------------------------------------------------------------------ /** \brief \ru Индикатор прогресса выполнения. diff --git a/C3d/Lib/x32/Debug/c3d.lib b/C3d/Lib/x32/Debug/c3d.lib index 64a4a81..7eb61ff 100644 Binary files a/C3d/Lib/x32/Debug/c3d.lib and b/C3d/Lib/x32/Debug/c3d.lib differ diff --git a/C3d/Lib/x32/Release/c3d.lib b/C3d/Lib/x32/Release/c3d.lib index 58732fb..3877236 100644 Binary files a/C3d/Lib/x32/Release/c3d.lib and b/C3d/Lib/x32/Release/c3d.lib differ diff --git a/C3d/Lib/x64/Debug/c3d.lib b/C3d/Lib/x64/Debug/c3d.lib index 83a6bea..fd8b9ee 100644 Binary files a/C3d/Lib/x64/Debug/c3d.lib and b/C3d/Lib/x64/Debug/c3d.lib differ diff --git a/C3d/Lib/x64/Release/c3d.lib b/C3d/Lib/x64/Release/c3d.lib index 622e189..7abdee0 100644 Binary files a/C3d/Lib/x64/Release/c3d.lib and b/C3d/Lib/x64/Release/c3d.lib differ