diff --git a/C3d/Include/action_b_shaper.h b/C3d/Include/action_b_shaper.h index 8dd9538..3854fab 100644 --- a/C3d/Include/action_b_shaper.h +++ b/C3d/Include/action_b_shaper.h @@ -122,8 +122,8 @@ public: MbeCreateBRepMode bMode = cbm_Default ) : useRelativeTolerance( useRelTol ) , smoothBoundaryEdges ( smoothBoundary ) - , tolerance ( tol ) , bAngle ( angle ) + , tolerance ( tol ) , surfReconstructMode ( reconMode ) , brepCreationMode ( bMode ) {} @@ -491,4 +491,5 @@ MATH_FUNC( MbResultType ) ConvertCollectionToShell( MbCollection & collection, M */ // --- MATH_FUNC( MbResultType ) FitSurfaceToGrid( const MbGrid & grid, const MbSurfaceFitToGridParameters & params, MbSurfaceFitToGridResults & results ); + #endif // __ACTION_B_SHAPER_H diff --git a/C3d/Include/action_curve3d.h b/C3d/Include/action_curve3d.h index dba3c39..f369fc9 100644 --- a/C3d/Include/action_curve3d.h +++ b/C3d/Include/action_curve3d.h @@ -217,12 +217,12 @@ MATH_FUNC (MbResultType) NurbsCurve( const SArray & pointList, \ingroup Curve3D_Modeling */ // --- -MATH_FUNC (double) NurbsFitting( const std::vector & pointList, - bool curveClosed, - size_t degree, - size_t mode, - double & accuracy, - MbCurve3D *& result ); +DEPRECATE_DECLARE MATH_FUNC (double) NurbsFitting( const std::vector & pointList, + bool curveClosed, + size_t degree, + size_t mode, + double & accuracy, + MbCurve3D *& result ); //------------------------------------------------------------------------------ diff --git a/C3d/Include/action_polymesh.h b/C3d/Include/action_polymesh.h index 46d869d..a2d6730 100644 --- a/C3d/Include/action_polymesh.h +++ b/C3d/Include/action_polymesh.h @@ -315,11 +315,10 @@ MATH_FUNC( MbResultType ) DrapeShell( const MbDrapeShellParams & params, MbDrape \en Merging parameters. \~ \param[in-out] meshTo - \ru Полигональный объект, который аккумулирует результат объединения. \en A polygonal object, accumulating merged objects. \~ - \return \ru Код результата операции, rt_Success если объекты успешно объединены. + \return \ru Код результата операции, rt_Success, если объекты успешно объединены. \en Returns the operation result code, rt_Success if the objects are successfully merged. \n \warning \ru В разработке. \en Under development.\~ */ // --- MATH_FUNC( MbResultType ) MergePolymeshes( const MbPolymesh & meshFrom, const MbMergePolymeshParams & params, MbPolymesh & meshTo ); - #endif // __ACTION_POLYMESH_H diff --git a/C3d/Include/action_wireframe.h b/C3d/Include/action_wireframe.h index f9e620c..3579cff 100644 --- a/C3d/Include/action_wireframe.h +++ b/C3d/Include/action_wireframe.h @@ -19,6 +19,7 @@ class MbNurbsWireFrameParams; class MbTrimmedWireFrameParams; class MbWireFrameProjParams; class MbWireFrameProjResult; +class MbOffsetWireFrameParams; //------------------------------------------------------------------------------ @@ -201,4 +202,28 @@ MATH_FUNC( MbResultType ) ExtendWireFrame( c3d::WireFrameSPtr & const MbCurveExtensionParameters3D & params, c3d::WireFrameSPtr & result ); + +//------------------------------------------------------------------------------ +/** \brief \ru Создать эквидистантный каркас. + \en Create an offset wire frame. \~ + \details \ru Создать эквидистантный каркас смещением базового каркаса. + \en Create an offset wire frame by shifting the base wire frame. \~ + \param[in] wireFrame - \ru Исходный каркас. + \en The initial wire frame. \~ + \param[in] sameWire - \ru Режим копирования входного каркаса. + \en Whether to copy the input wire frame. \~ + \param[in] params - \ru Параметры операции. + \en Operation parameters. \~ + \param[out] result - \ru Эквидистантный каркас. + \en The offset wire frame. \~ + \return \ru Возвращает код результата операции. + \en Returns operation result code. \~ + \ingroup WireFrame_Modeling +*/ +// --- +MATH_FUNC( MbResultType ) CreateOffsetWireFrame( c3d::WireFrameSPtr & wireFrame, + MbeCopyMode sameWire, + const MbOffsetWireFrameParams & params, + c3d::WireFrameSPtr & result ); + #endif // __ACTION_WIREFRAME_H diff --git a/C3d/Include/attr_hotpoint_attribute.h b/C3d/Include/attr_hotpoint_attribute.h index e7edb71..7723519 100644 --- a/C3d/Include/attr_hotpoint_attribute.h +++ b/C3d/Include/attr_hotpoint_attribute.h @@ -44,13 +44,14 @@ public: */ //--- enum class MbeHotPointType : uint16 { - undefinedHP = 0, ///< \ru Неопределенный тип. \en Undefined type. - draftHP, ///< \ru Хот-точка операции уклона. \en The draft operation hot point. - conicSectionHP, ///< \ru Хот-точка операции построения переменного конического сечения. \en The conic section operation hot point. - DMFilletRadiusSetHP, ///< \ru Хот-точка операции прямого моделирования по установке радиусов граням скругления. \en The direct modeling operation's hot point by set fillet face's radius. - elementaryHP, ///< \ru Хот-точка операции построения элементарного тела. \en The elementary solid operation hot point. - DMReplaceFacesHP, ///< \ru Хот-точка операции замены граней. \en Hot point of the face replacement operation. - DMOffsetFacesHP, ///< \ru Хот-точка операции замены граней на эквидистантные. \en Hot point of the operation of replacement faces with the offset ones. + undefinedHP = 0, ///< \ru Неопределенный тип. \en Undefined type. + draftHP, ///< \ru Хот-точка операции уклона. \en The draft operation hot point. + conicSectionHP, ///< \ru Хот-точка операции построения переменного конического сечения. \en The conic section operation hot point. + DMFilletRadiusSetHP, ///< \ru Хот-точка операции прямого моделирования по установке радиусов граням скругления. \en The direct modeling operation's hot point by set fillet face's radius. + elementaryHP, ///< \ru Хот-точка операции построения элементарного тела. \en The elementary solid operation hot point. + DMReplaceFacesHP, ///< \ru Хот-точка операции замены граней. \en Hot point of the face replacement operation. + DMOffsetFacesHP, ///< \ru Хот-точка операции замены граней на эквидистантные. \en Hot point of the operation of replacement faces with the offset ones. + DMReplaceFacesGroupHP, ///< \ru Хот-точка операции замены группы граней. \en Hot point of the operation of replacement faces group. // \ru Вставлять новые типы перед этим типом. \en Insert new types before this type. endHP = SYS_MAX_INT16 }; diff --git a/C3d/Include/attr_user_attribute.h b/C3d/Include/attr_user_attribute.h index 255ba4a..bba1457 100644 --- a/C3d/Include/attr_user_attribute.h +++ b/C3d/Include/attr_user_attribute.h @@ -40,6 +40,8 @@ class MATH_CLASS MbFixAttrSet; class IAttrDefinition { public: + virtual ~IAttrDefinition() = default; + /// \ru Преобразовать из пользовательского в "системный". \en Convert user attribute to "system" one. virtual MbUserAttribute * ReduceUserAttrib ( const MbExternalAttribute & source ) = 0; diff --git a/C3d/Include/attribute_item.h b/C3d/Include/attribute_item.h index 29a8110..5cd7419 100644 --- a/C3d/Include/attribute_item.h +++ b/C3d/Include/attribute_item.h @@ -600,7 +600,9 @@ namespace c3d // namespace C3D constexpr TCHAR c3dStr_SavedViewUpVector[] = _T( "c3d_SavedView_UpVector" ); /** \ru Подсказка для масштаба текущего вида. \en Hint for the scale of the current view. \~*/ constexpr TCHAR c3dStr_SavedViewScale[] = _T( "c3d_SavedView_Scale" ); - + /** \ru Подсказка для типа текущего вида (ортогональный/перспективный). Хранится в виде значения bool. + \en Hint for the type of the current view (orthogonal/perspective). Stored as a bool value. \~*/ + constexpr TCHAR c3dStr_SavedViewPerspective[] = _T( "c3d_SavedView_Perspective" ); } // namespace C3D diff --git a/C3d/Include/check_geometry.h b/C3d/Include/check_geometry.h index 7b2d4cf..00e4e31 100644 --- a/C3d/Include/check_geometry.h +++ b/C3d/Include/check_geometry.h @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -1227,7 +1228,7 @@ public: /// \ru Режим проверки самопересечений. \en Mode of self intersection checking. enum class MbeCheckSelfIntMode { - Auto , /// \ru Автоматический режим. \en Auto mode. + Auto , /// \ru Автоматический режим (проверять пересечение граней, включая самопересечения). \en Auto mode (check intersection of faces including self-intersections). SelfIntFacesOnly , /// \ru Проверять только самопересечение граней. \en Check only self-intersection of faces. IntDfferentFacesOnly /// \ru Проверять только пересечение различных граней. \en Check only the intersection of different faces. }; @@ -1235,6 +1236,8 @@ public: private: MbeCheckSelfIntMode _mode; ///< \ru Режим проверки самопересечений. \en Mode of self intersection checking. VERSION _version; ///< \ru Версия алгоритма. \en Algorithm version. + std::unique_ptr _stepData; ///< \ru Данные для вычисления шага при триангуляции. \en Data for step calculation during triangulation. + public: mutable IProgressIndicator * _progress; ///< \ru Индикатор прогресса выполнения операции. \en A progress indicator of the operation. @@ -1243,7 +1246,7 @@ public: MbShellSelfIntParams(); /** \brief \ru Конструктор проверки на самопересечение оболочки. \en Constructor of checking for self-intersection of shell. \~ - \details \ru Конструктор проверки на самопересечение оболчки. + \details \ru Конструктор проверки на самопересечение оболочки. \en Constructor of checking for self-intersection of shell. \~ \param[in] version - \ru Версия алгоритма. \en Algorithm version. \~ @@ -1253,7 +1256,7 @@ public: MbShellSelfIntParams( VERSION version, IProgressIndicator * prog = nullptr ); /** \brief \ru Конструктор проверки на самопересечение оболочки. \en Constructor of checking for self-intersection of shell. \~ - \details \ru Конструктор проверки на самопересечение оболчки. + \details \ru Конструктор проверки на самопересечение оболочки. \en Constructor of checking for self-intersection of shell. \~ \param[in] mode - \ru Режим проверки самопересечений. \en Mode of self intersection checking. \~ @@ -1263,6 +1266,20 @@ public: \en A progress indicator of the operation. */ MbShellSelfIntParams( MbeCheckSelfIntMode mode, VERSION version, IProgressIndicator * prog = nullptr ); + /** \brief \ru Конструктор проверки на самопересечение оболочки с помощью анализа сеток. + \en Constructor of checking for self-intersection of shell by meshes check. \~ + \details \ru Конструктор проверки на самопересечение оболочки с помощью анализа сеток. + \en Constructor of checking for self-intersection of shell by meshes check. \~ + \param[in] stepData - \ru Данные для вычисления шага при триангуляции. + \en Data for step calculation during triangulation. \~ + \param[in] version - \ru Версия алгоритма. + \en Algorithm version. \~ + \param[in] prog - \ru Индикатор прогресса выполнения операции. + \en A progress indicator of the operation. + \warning \ru Пока не готово. \en Not yet ready. +*/ + MbShellSelfIntParams( const MbStepData & stepData, VERSION version = Math::DefaultMathVersion(), IProgressIndicator * prog = nullptr ); + /// \ru Деструктор. \en Destructor. ~MbShellSelfIntParams() {} public: @@ -1272,6 +1289,9 @@ public: void SetMode( MbeCheckSelfIntMode mode ) { _mode = mode; } /// \ru Получить версию алгоритма. \en Get the algorithm version. VERSION GetVersion() const { return _version; } + // \ru Получить данные для расчета шага. \en Get data for the step calculation. \~ + const MbStepData * GetStepData() const { return _stepData.get(); } + OBVIOUS_PRIVATE_COPY( MbShellSelfIntParams ) }; @@ -1292,7 +1312,7 @@ private: \en Result of intersection/self-intersection of faces. \~ \details \ru Результат пересечения/самопересечения граней. Если '_facesIndices' содержат одинаковые индексы, значит грань с данным индексом самопересекается. - Кривые пересечения не вычисляются для сомопересечения и '_curves' будет пустым. \n + Кривые пересечения не вычисляются для самопересечения и '_curves' будет пустым. \n \en The result of intersection/self-intersection of edges. If '_facesIndices' contains identical indices, which means the face with this index intersects itself. Intersection curves are not calculated for self-intersection and '_curves' will be empty. \n \~ @@ -1359,8 +1379,8 @@ public: If intersectionCurves = nullptr - intersection curves do not return. \~ \return \ru Возвращает: - false, если результата с заданым индексом не содержится; - true, если результата с заданым индексом найден; + false, если результата с заданным индексом не содержится; + true, если результата с заданным индексом найден; \en Returns: false, if there is no result with the given index; true, if a result with the given index is found; \~ @@ -1370,6 +1390,8 @@ public: size_t Count() const { return _selfIntResults.size(); } /// \ru Установить значения по умолчанию. \en Set defaults. void Reset() { _selfIntResults.clear(); }; + /// \ru Зарезервировать размер массива пар пересекающихся и самопересекающихся граней. \en Reserve the size the array of pairs of intersecting and self-intersecting faces. + void ReserveResult( size_t count ) { _selfIntResults.reserve( count ); } OBVIOUS_PRIVATE_COPY( MbShellSelfIntResults ) }; diff --git a/C3d/Include/conv_exchange_settings.h b/C3d/Include/conv_exchange_settings.h index 4260d5c..8a5f44f 100644 --- a/C3d/Include/conv_exchange_settings.h +++ b/C3d/Include/conv_exchange_settings.h @@ -409,9 +409,9 @@ public : public: /// \ru Получить имя документа. \en Get document's name. virtual const std::string GetDocumentName () const = 0; //{ return std::string( GetDocName().get_str() ); }; - /// \ru Получить имя файла для конвертирования. \en Get file name for converting. - virtual const c3d::path_string FullFilePath () const = 0 ;//{ return c3d::path_string( GetFileName().c_str() ); }; - /// \ru Является ли файл текстовым. \en Whether the file is a text file. + /// \ru Получить имя файла для конвертирования. \en Get file name for converting. + virtual const c3d::path_string FullFilePath() const = 0;//{ return c3d::path_string( GetFileName().c_str() ); }; + /// \ru Является ли файл текстовым. \en Whether the file is a text file. virtual bool IsFileAscii () const = 0; /// \ru Получить версию формата при экспорте. \en Get the version of format for export. virtual long int GetFormatVersion () const { return EXPORT_DEFAULT; }; @@ -529,6 +529,9 @@ public: /// \ru Определить способ формирования визуальных свойст при чтении из C3D. \en Specify the way how visual properties form while reading from C3D. virtual ColorProcessing GetC3DVisualPropertiesResolutionStrategy() const { return ColorProcessing::cr_Both; } + + /// \ru Импортировать полигональные объекты как объекты с топологической информацией. \en Import polygonal objects as objects with topological information. + virtual bool ImportMeshesWithTopology() const { return false; } }; // IConvertorProperty3D @@ -576,6 +579,7 @@ public: double appUnitsFactor; ///< \ru Единицы длины модели пользовательского приложения. \en Length units of the model used in user application. bool attatchIdAttributes; ///< \ru Следует ли формировать атрибут на основе идентификатора элемнта в файле. \en Whether to attatch the element's id in file as attribute. bool auditEnabled; + bool importMeshesWithTopology; ///< \ru Сохранять сетки в MbMesh (false) или в MbPolymesh (true). \en Save meshes to MbMesh (false) or to MbPolymesh (true). ColorProcessing visualPropertiesFormation; ///< \ru Способ формирования визуальных свойст при чтении из C3D. \en The way how visual properties form while reading from C3D. SPtr pruductIdMaker; ///< \ru Генератор однострочного идентификатора по данным об изделии. \en Generator of a single-line id based on product information attribute. SPtr scaleRequester; /// \ru Запросчик масштабного коэффициента единиц длины. \en Scale requester. @@ -715,6 +719,9 @@ public: /// \ru Определить способ формирования визуальных свойст при чтении из C3D. \en Specify the way how visual properties form while reading from C3D. ColorProcessing GetC3DVisualPropertiesResolutionStrategy() const override; + /// \ru Импортировать полигональные объекты как объекты с топологической информацией. \en Import polygonal objects as objects with topological information. + bool ImportMeshesWithTopology() const override { return importMeshesWithTopology; } + OBVIOUS_PRIVATE_COPY( ConvConvertorProperty3D ) }; // IConvertorProperty3D @@ -803,4 +810,30 @@ public: bool StdToC3D( const std::string & from, c3d::string_t& to ) override; }; + +//------------------------------------------------------------------------------ +/** \brief \ru Преобразование строк с использованием кодировки Windows-1251. + \en Transform strings using the Windows-1251 encoding. + \ingroup Base_Tools_String +*/ +class CONV_CLASS IC3DCharEncodingTransformerWindows1251 : public IC3DCharEncodingTransformer +{ +public: + ~IC3DCharEncodingTransformerWindows1251() override = default; + + //------------------------------------------------------------------------------ + /** \brief \ru Преобразовать строку C3D в строку STD. + \en Transform C3D string to the STD one. \~ + \ingroup Base_Tools_String + */ + bool C3DToStd( const c3d::string_t& from, std::string & to ) override; + + //------------------------------------------------------------------------------ + /** \brief \ru Преобразовать строку STD в строку C3D. + \en Transform STD string to the C3D one. \~ + \ingroup Base_Tools_String + */ + bool StdToC3D( const std::string & from, c3d::string_t& to ) override; +}; + #endif // __CONV_EXCHANGE_SETTINGS_H diff --git a/C3d/Include/conv_model_tree_linearized.h b/C3d/Include/conv_model_tree_linearized.h index 1566404..676c8be 100644 --- a/C3d/Include/conv_model_tree_linearized.h +++ b/C3d/Include/conv_model_tree_linearized.h @@ -1,4 +1,7 @@ -#include +#ifndef MODEL_TREE_LINEARIZED_H +#define MODEL_TREE_LINEARIZED_H + +#include #include #include #include @@ -50,18 +53,18 @@ class LinearizedContainer { ReferencedItemType item; mutable std::vector references; public: + // Конструктор по умолчанию + LinearizedContainer() = default; + + // Конструктор копирования по умолчанию + LinearizedContainer(const LinearizedContainer& i) = default; + // Конструктор - LinearizedContainer( const ReferencedItemType& it ) + LinearizedContainer(const ReferencedItemType& it) : item( it ) , references() { } - // Конструктор копирования - LinearizedContainer( const LinearizedContainer& i ) - : item( i.item ) - , references( i.references ) { - } - // Оператор сравнения bool operator ==(const LinearizedContainer& to) const { return item == to.item; @@ -117,9 +120,14 @@ public: // Деструктор ~LinearizedTreeDocument(); -public: + PartsLinearized GetPartsList() const; + + AssembliesLinearized GetAssembliesList() const; + // Заполнить данные void FillLinearizedData(); + + private: // Заполнены ли данные bool IsFilled(); @@ -153,4 +161,6 @@ public: void SolidPlaneCutting( const MbSolid & solid, std::vector & cutRes ); // Резка тела MbResultType SolidCut( const MbSolid & solid, const MbSurface & surf, bool forward ); -}; \ No newline at end of file +}; + +#endif //MODEL_TREE_LINEARIZED_H \ No newline at end of file diff --git a/C3d/Include/conv_topo_mesh.h b/C3d/Include/conv_topo_mesh.h index 8df60d7..baa5c1a 100644 --- a/C3d/Include/conv_topo_mesh.h +++ b/C3d/Include/conv_topo_mesh.h @@ -19,8 +19,7 @@ class MbGrid; class MbFloatGrid; -class MbMesh; -class MbTriangle; +class MbItem; namespace JTC { @@ -45,14 +44,12 @@ namespace JTC { typedef std::vector MeshVertexVector; typedef std::vector MeshPolygonVector; - typedef std::pair TrianglePair; - - //------------------------------------------------------------------------------ // Сетка с топологической информацией // --- class CONV_CLASS TopoMesh : public MbRefItem { - SPtr mesh; + protected: + SPtr item; TopoGridVector grids; MeshVertexVector ownPoints; MeshPolygonVector ownFacePolygons; @@ -67,10 +64,10 @@ namespace JTC { virtual ~TopoMesh(); /// Инициализировать - bool Init( const MbMesh& mesh, bool enableDiagnostics = false ); + bool Init( const MbItem& mesh, bool enableDiagnostics = false ); /// Получить сетку - const MbMesh* GetMesh() const; + SPtr GetMesh() const; /// Число полигонов size_t MeshPolygonsCount() const; @@ -89,7 +86,7 @@ namespace JTC { /// Получить вырожденные треуголники std::map< size_t, std::vector > GetDegeneratedTriangles() const; - + /// Получить граничные точки сетки std::vector GetBoundaryPoints() const; @@ -97,7 +94,7 @@ namespace JTC { void Reset(); /// Получить следующую в цепочке граничную вершину. - size_t NextBoundaryVertex( size_t indexBoundaryVertex, const std::vector& allBoundary ) const; + //unused:size_t NextBoundaryVertex( size_t indexBoundaryVertex, const std::vector& allBoundary ) const; /// Сформировать внешнюю границу начиная с указанной вершины. bool InitVoidBoundFrom( std::vector& freeBoundaryVerticis ); @@ -105,6 +102,9 @@ namespace JTC { /// Получить точность задания расстояния. double MetricTolerance() const; + /// Получить нормаль на сетке + void GetNormal( size_t indexGrid, size_t indexNormal, MbFloatVector3D& vNormal ) const; + OBVIOUS_PRIVATE_COPY( TopoMesh ) }; diff --git a/C3d/Include/cr_offset_wireframe.h b/C3d/Include/cr_offset_wireframe.h new file mode 100644 index 0000000..59bc039 --- /dev/null +++ b/C3d/Include/cr_offset_wireframe.h @@ -0,0 +1,75 @@ +//////////////////////////////////////////////////////////////////////////////// +/** + \file + \brief \ru Строитель эквидистантного каркаса. + \en Creator of an offset wire frame. +*/ +//////////////////////////////////////////////////////////////////////////////// + +#ifndef __CR_OFFSET_WIREFRAME_H +#define __CR_OFFSET_WIREFRAME_H + + +#include +#include + + +//------------------------------------------------------------------------------ +/** \brief \ru Строитель эквидистантного каркаса. + \en Creator of an offset wire frame. \~ + \details \ru Строитель эквидистантного каркаса. + \en Creator of an offset wire frame. \~ + \ingroup Model_Creators +*/ +// --- +class MATH_CLASS MbOffsetWireFrameCreator : public MbCreator { +private: + MbOffsetWireFrameParams _parameters; ///< \ru Параметры эквидистантного каркаса. \en Parameters of an offset wire frame. + +public: + /** \brief \ru Конструктор по параметрам. + \en Constructor by parameters. \~ + \details \ru Конструктор эквидистантного карскаса в пространстве. + \en Constructor of an offset wire frame in the space. \~ + \param[in] params - \ru Параметры. + \en Parameters. \~ + */ + MbOffsetWireFrameCreator( const MbOffsetWireFrameParams & params ); + + /// \ru Деструктор. \en Destructor. + virtual ~MbOffsetWireFrameCreator(); + +protected: + /// \ru Конструктор копирования. \en Copy-constructor. + MbOffsetWireFrameCreator( const MbOffsetWireFrameCreator & other, + MbRegDuplicate * iReg ); +private: + MbOffsetWireFrameCreator(); ///< \ru Не реализовано. \en Not implemented. + +public: + // \ru Общие функции строителя. \en The common functions of the creator. + MbeCreatorType IsA() const override; ///< \ru Тип элемента. \en A type of element. + MbCreator & Duplicate( MbRegDuplicate * iReg = nullptr) const override; ///< \ru Сделать копию. \en Create a copy. + + bool IsSame ( const MbCreator &, double accuracy) const override; ///< \ru Являются ли объекты равными? \en Determine whether an object is equal? + bool IsSimilar( const MbCreator & ) const override; ///< \ru Являются ли объекты подобными. \en Whether the objects are similar. + bool SetEqual ( const MbCreator & ) override; ///< \ru Сделать равным. \en Make equal. + + void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ) override; ///< \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. + void Move ( const MbVector3D &, MbRegTransform * = nullptr ) override; ///< \ru Сдвиг. \en Translation. + void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ) override; ///< \ru Повернуть вокруг оси. \en Rotate about an axis. + + MbePrompt GetPropertyName() override; ///< \ru Дать имя свойства объекта. \en Get the object property name. + void GetProperties ( MbProperties & ) override; ///< \ru Выдать свойства объекта. \en Get properties of the object. + void SetProperties ( const MbProperties & ) override; ///< \ru Записать свойства объекта. \en Set properties of the object. + + bool CreateWireFrame( MbWireFrame *&, MbeCopyMode, RPArray * items = nullptr ) override; ///< \ru Построить каркас по журналу построения \en Create an offset wire frame from the history tree. + +DECLARE_PERSISTENT_CLASS_NEW_DEL( MbOffsetWireFrameCreator ) +}; // MbOffsetWireFrameCreator + + +IMPL_PERSISTENT_OPS( MbOffsetWireFrameCreator ) + + +#endif // __CR_OFFSET_WIREFRAME_H diff --git a/C3d/Include/cr_split_data.h b/C3d/Include/cr_split_data.h index d009f85..f475748 100644 --- a/C3d/Include/cr_split_data.h +++ b/C3d/Include/cr_split_data.h @@ -84,10 +84,10 @@ private: public: /// \ru Конструктор. \en Constructor. MbSplitData() - : place ( ) + : sketchContours( ) + , place ( ) , direction ( ) , sense ( orient_BOTH ) - , sketchContours( ) , spaceCurves ( ) , surfaces ( ) , creators ( ) @@ -96,10 +96,10 @@ public: } /// \ru Конструктор по двумерному контуру в локальной системе координат. \en Constructor by two-dimensional contour in the local coordinate system. MbSplitData( const MbPlacement3D & pl, MbeSenseValue dirSense, const MbContour & item, bool same ) - : place ( pl ) + : sketchContours( ) + , place ( pl ) , direction ( ) , sense ( dirSense ) - , sketchContours( ) , spaceCurves ( ) , surfaces ( ) , creators ( ) @@ -111,10 +111,10 @@ public: } /// \ru Конструктор по двумерному контуру в локальной системе координат. \en Constructor by two-dimensional contour in the local coordinate system. MbSplitData( const MbPlacement3D & pl, const MbVector3D & dir, const MbContour & item, bool same ) - : place ( pl ) + : sketchContours( ) + , place ( pl ) , direction ( dir ) , sense ( orient_BOTH ) - , sketchContours( ) , spaceCurves ( ) , surfaces ( ) , creators ( ) @@ -129,10 +129,10 @@ public: /// \ru Конструктор по двумерным контурам в локальной системе координат. \en Constructor by two-dimensional contours in the local coordinate system. template MbSplitData( const MbPlacement3D & pl, MbeSenseValue dirSense, const PlaneContoursVector & items, bool same ) - : place ( pl ) + : sketchContours( ) + , place ( pl ) , direction ( ) , sense ( dirSense ) - , sketchContours( ) , spaceCurves ( ) , surfaces ( ) , creators ( ) @@ -143,10 +143,10 @@ public: /// \ru Конструктор по двумерным контурам в локальной системе координат. \en Constructor by two-dimensional contours in the local coordinate system. template MbSplitData( const MbPlacement3D & pl, const MbVector3D & dir, const PlaneContoursVector & items, bool same ) - : place ( pl ) + : sketchContours( ) + , place ( pl ) , direction ( dir ) , sense ( orient_BOTH ) - , sketchContours( ) , spaceCurves ( ) , surfaces ( ) , creators ( ) @@ -158,10 +158,10 @@ public: } /// \ru Конструктор по пространственным кривым. \en Constructor by spatial curves. MbSplitData( const c3d::ConstSpaceCurvesSPtrVector & items, bool same ) - : place ( ) + : sketchContours( ) + , place ( ) , direction ( ) , sense ( orient_BOTH ) - , sketchContours( ) , spaceCurves ( ) , surfaces ( ) , creators ( ) @@ -171,10 +171,10 @@ public: } /// \ru Конструктор по пространственным кривым. \en Constructor by spatial curves. MbSplitData( const c3d::ConstSpaceCurvesVector & items, bool same ) - : place ( ) + : sketchContours( ) + , place ( ) , direction ( ) , sense ( orient_BOTH ) - , sketchContours( ) , spaceCurves ( ) , surfaces ( ) , creators ( ) @@ -184,10 +184,10 @@ public: } /// \ru Конструктор по поверхности. \en Constructor by a surface. MbSplitData( const MbSurface & item, bool same ) - : place ( ) + : sketchContours( ) + , place ( ) , direction ( ) , sense ( orient_BOTH ) - , sketchContours( ) , spaceCurves ( ) , surfaces ( ) , creators ( ) @@ -199,10 +199,10 @@ public: } /// \ru Конструктор по поверхностям. \en Constructor by surfaces. MbSplitData( const c3d::ConstSurfacesSPtrVector & items, bool same ) - : place ( ) + : sketchContours( ) + , place ( ) , direction ( ) , sense ( orient_BOTH ) - , sketchContours( ) , spaceCurves ( ) , surfaces ( ) , creators ( ) @@ -212,10 +212,10 @@ public: } /// \ru Конструктор по поверхностям. \en Constructor by surfaces. MbSplitData( const c3d::ConstSurfacesVector & items, bool same ) - : place ( ) + : sketchContours( ) + , place ( ) , direction ( ) , sense ( orient_BOTH ) - , sketchContours( ) , spaceCurves ( ) , surfaces ( ) , creators ( ) diff --git a/C3d/Include/creator.h b/C3d/Include/creator.h index 22a78db..6bbb798 100644 --- a/C3d/Include/creator.h +++ b/C3d/Include/creator.h @@ -102,6 +102,8 @@ enum MbeCreatorType { ct_UnwrapPointCreator = 220, ///< \ru Строитель развёрнутой точки. \en Constructor of the unwrapped point. \n ct_WrapPointCreator = 221, ///< \ru Строитель свёрнутой точки. \en Constructor of the wrapped point. \n + ct_OffsetWireFrameCreator = 222, ///< \ru Строитель эквидистантного каркаса. \en Constructor of the offset wireframe. \n + // \ru Строители полигональных объектов. \en Creators of polygonal objects. ct_SimpleMeshCreator = 400, ///< \ru Строитель полигонального объекта без истории. \en Constructor of a polygonal object without history. ct_ReverseMeshCreator = 401, ///< \ru Строитель вывернутого полигонального объекта. \en Constructor of a reversed polygonal object. diff --git a/C3d/Include/cur_surface_intersection.h b/C3d/Include/cur_surface_intersection.h index 7706825..68c90ba 100644 --- a/C3d/Include/cur_surface_intersection.h +++ b/C3d/Include/cur_surface_intersection.h @@ -72,10 +72,10 @@ namespace c3d // namespace C3D Кривая пересечения поверхностей используется для стыковки поверхностей или для описания ребра стыковки двух граней. Кривая пересечения может описывать разные типы рёбер стыковки двух граней: \n обычное ребро - поверхности разные, двумерные кривые разные,\n - ребро-шов - поверхность одина и та же, двумерные кривые разные не равные,\n + ребро-шов - поверхность одна и та же, двумерные кривые разные не равные,\n Ребро-линия разъема - поверхности копии, двумерные кривые копии,\n - ребро-край - поверхность одина и та же, двумерная кривая одина и та же,\n - ребро-полюс - поверхность одина и та же, двумерные кривые копии.\n + ребро-край - поверхность одна и та же, двумерная кривая одна и та же,\n + ребро-полюс - поверхность одна и та же, двумерные кривые копии.\n Если две двумерные кривые кривых на поверхности curveOne curveTwo являются контурами, то количество сегментов в них должно быть одинаковым. \en Intersection curve of surfaces contains two curves on intersected surfaces - curveOne and curveTwo, conformed to the next rules:\n @@ -128,7 +128,7 @@ private : { SPtr spaceCurve; ///< \ru Пространственная аппроксимационная кривая. \en The spatial approximating curve. \~ SpaceCurveAuxiliaryData() : spaceCurve( nullptr ) {} - SpaceCurveAuxiliaryData( const SpaceCurveAuxiliaryData & c ) : spaceCurve( nullptr ) { + SpaceCurveAuxiliaryData( const SpaceCurveAuxiliaryData & c ) : AuxiliaryData {}, spaceCurve( nullptr ) { if ( c.spaceCurve != nullptr ) { spaceCurve = static_cast( &c.spaceCurve->Duplicate() ); } diff --git a/C3d/Include/func_nurbs_function.h b/C3d/Include/func_nurbs_function.h index b46c50b..4aa3746 100644 --- a/C3d/Include/func_nurbs_function.h +++ b/C3d/Include/func_nurbs_function.h @@ -53,7 +53,7 @@ protected: public: MbNurbsFunctionAuxiliaryData() : values(), pointsM(), weightM() {} - MbNurbsFunctionAuxiliaryData( const MbNurbsFunctionAuxiliaryData & ) : values(), pointsM(), weightM() {} + MbNurbsFunctionAuxiliaryData( const MbNurbsFunctionAuxiliaryData & ) : AuxiliaryData {}, values(), pointsM(), weightM() {} virtual ~MbNurbsFunctionAuxiliaryData() {} }; diff --git a/C3d/Include/gc_api.h b/C3d/Include/gc_api.h index 8dd5fad..7d1849d 100644 --- a/C3d/Include/gc_api.h +++ b/C3d/Include/gc_api.h @@ -21,7 +21,7 @@ #include #include -#include +#include template class SArray; diff --git a/C3d/Include/gce_api.h b/C3d/Include/gce_api.h index 2457a97..e2eb6cf 100644 --- a/C3d/Include/gce_api.h +++ b/C3d/Include/gce_api.h @@ -337,6 +337,25 @@ GCE_FUNC(pattern_item) GCE_AddLinearPattern( GCE_system gSys, GCE_vec2d trans ); //--- GCE_FUNC(pattern_item) GCE_AddAngularPattern( GCE_system gSys, GCE_point point, double angle ); +//---------------------------------------------------------------------------------------- +/** \brief \ru Объявить составной паттерн по двум данным. + \en Declare a composition pattern of two patterns. \~ + \param[in] gSys - \ru Система ограничений. + \en System of constraints. \~ + \param[in] pItem1 - \ru Первый паттерн. + \en The first pattern. \~ + \param[in] pItem2 - \ru Второй паттерн. + \en The second patttern. \~ + + \return \ru Дескриптор зарегистрированного паттерна. + \en Descriptor of registered pattern. \~ + + \details \ru Метод создает паттерн - композицию двух паттернов. + \en The method creates an composition pattern defined by two patterns. \~ +*/ +//--- +GCE_FUNC(pattern_item) GCE_AddCompositionPattern( GCE_system gSys, pattern_item pItem1, pattern_item pItem2 ); + //---------------------------------------------------------------------------------------- /** \brief \ru Создать k-й экземпляр образца в данном паттерне. \en Create k-th instance of the sample in a given pattern. \~ @@ -359,13 +378,38 @@ GCE_FUNC(pattern_item) GCE_AddAngularPattern( GCE_system gSys, GCE_point point, //--- GCE_FUNC(geom_item) GCE_AddInstance( GCE_system gSys, pattern_item pItem, geom_item sample, int k ); +//---------------------------------------------------------------------------------------- +/** \brief \ru Создать (i, j) экземпляр образца в данном составном паттерне. + \en Create (i, j) instance of the sample in a given composition 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] i - \ru Номер экземпляра. + \en Copy number. \~ + \param[in] j - \ru Номер экземпляра. + \en Copy number. \~ + + \return \ru Дескриптор зарегистрированного экземпляра. + \en Descriptor of registered instance. \~ + + \details \ru Метод создает (i, j) экземпляр образца в данном составном паттерне. + При i = 0, j = 0 возвращает идентификатор образца. + \en The method creates the (i, j) instance of the sample in the given pattern. + It returns the sample descriptor if i = 0 and j = 0. \~ +*/ +//--- +GCE_FUNC(geom_item) GCE_AddInstance( GCE_system gSys, pattern_item pItem, geom_item sample, int i, int j ); + //---------------------------------------------------------------------------------------- /** \brief \ru Добавить в систему жёсткое множество геометрических объектов. \en Add a rigid set of geometric objects to the system. \~ \details \ru Жёсткое множество - это массив геометрических объектов, зафиксированных друг относительно друга. Жёсткое множество представляет собой геометрический объект, для которого доступен весь функционал работы с геометрическими объектами. Например, у него можно спросить тип (#GCE_GeomType -> GCE_SET) или запросить - положение. С помощью вызовов #GCE_GetPoint и #GCE_GetCoordValue можно получить начало координат и направление оси OX + положение. С помощью вызовов #GCE_GetPointXY и #GCE_GetCoordValue можно получить начало координат и направление оси OX ЛСК жёсткого множества. Чтобы удалить жёсткое множество, надо, как и для любого другого геометрического объекта, вызвать функцию #GCE_RemoveGeom. При этом составляющие жёсткое множество объекты (geoms) при удалении жёсткого множества не удаляются и могут далее быть использованы в решателе. С геометрическими объектами, образующими @@ -375,7 +419,7 @@ GCE_FUNC(geom_item) GCE_AddInstance( GCE_system gSys, pattern_item pItem, geom_i дескриптор самого геометрического объекта из массива geoms, на который накладывается ограничение. \en A rigid set is an array of geometric objects which are fixed relative to each other. It is considered as a geometric object and hence all the functionality for working with geometric objects is available for it. For - example, it's possible to request its type (#GCE_GeomType -> GCE_SET) or get its position invoking #GCE_GetPoint + example, it's possible to request its type (#GCE_GeomType -> GCE_SET) or get its position invoking #GCE_GetPointXY and #GCE_GetCoordValue to get the origin and the direction of the OX axis of the LCS of the rigid set. To remove a rigid set it's necessary to call the function #GCE_RemoveGeom. Geometric objects (geoms) are not deleted together with a rigid set and can be used in the solver after it will be deleted. With geometric objects that have been @@ -828,6 +872,21 @@ 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 Determine whether the constraint and the geometric object are adjacent. \~ + \param[in] gSys - \ru Система ограничений. + \en System of constraints. \~ + \param[in] g - \ru Дескриптор геометрического объекта. + \en Descriptor of geometric object. \~ + \param[in] cItem - \ru Дескриптор ограничения. + \en Descriptor of constraint. \~ + \return \ru true, если ограничение и геометрический объект смежные. + \en true if the constraint and the geometric object are adjacent. \~ +*/ +//--- +GCE_FUNC(bool) GCE_IsAdjacentConstraint( GCE_system gSys, geom_item g, constraint_item cItem ); + //---------------------------------------------------------------------------------------- /** \brief \ru Функция отвечает на вопрос: Имеется ли хотя бы один экземпляр паттерна? \en The function answers the question: Is there an instance of the pattern? \~ @@ -1507,6 +1566,32 @@ GCE_FUNC(constraint_item) GCE_AddLength( GCE_system gSys, geom_item curve, GCE_d //--- GCE_FUNC(constraint_item) GCE_AddPatterned( GCE_system gSys, pattern_item pItem, geom_item sample, geom_item instance, int k ); +//---------------------------------------------------------------------------------------- +/** \brief \ru Связать ограничением паттерна два геометрических объекта. + \en Bind two geometric objects by a pattern constraint. \~ + \param[in] gSys - \ru Система ограничений. + \en System of constraints. \~ + \param[in] pItem1 - \ru Дескриптор первого паттерна. + \en Descriptor of first pattern. \~ + \param[in] pItem2 - \ru Дескриптор второго паттерна. + \en Descriptor of second pattern. \~ + \param[in] sample - \ru Дескриптор образца. + \en Descriptor of sample. \~ + \param[in] instance - \ru Дескриптор экземпляра. + \en Descriptor of instance. \~ + \param[in] i - \ru Номер экземпляра в первом паттерне. + \en Copy number in first pattern. \~ + \param[in] j - \ru Номер экземпляра во втором паттерне. + \en Copy number in second pattern. \~ + \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 i, int j ); + //---------------------------------------------------------------------------------------- /** \brief \ru Задать ограничение "Управляющий параметр" или "Фиксация переменной" \en Set the constraint "Driving parameter" or "Fixation of variable" \~ @@ -1825,6 +1910,30 @@ GCE_FUNC(constraint_item) GCE_AddDirectedDistance( GCE_system gSys, geom_item p[ GCE_FUNC(constraint_item) GCE_AddLinearEquation( GCE_system gSys, const double * a , const var_item * v, size_t n, double c ); +//---------------------------------------------------------------------------------------- +/** \brief \ru Задать ориентацию касания. + \en Set the tangent orientation. + \param[in] \ru gSys Система ограничений. + \en gSys System of constraints. \~ + \param[in] \ru constraint Дескриптор ограничения. + \en constraint Constraint's descriptor. \~ + \param[in] \ru alignment Опция выравнивания касания кривых. + \en alignment Curve tangency alignment option. \~ + \return \ru В случае успешного вызова функция вернет новое значение выравнивания, заданного вызовом. + \en If the call is successful, the function will return the new alignment value specified by the call. \~ + \details + \ru В настоящее время функция применяется к ограничению касания (GCE_TANGENT). Данный вызов устанавливает + сонаправленность или противонаправленность касательных (GCE_COORIENTED, GCE_OPPOSITE), + либо делает выбор автоматически, если задать опцию GCE_AUTO_ALIGNMENT. Когда выбрана опцию GCE_CLOSEST, + солвер будет поддерживать взаимную ориентацию согласно текущего размещения геометрии. + \en The function currently applies to the tangency constraint (GCE_TANGENT). The call sets whether + the direction of the geometry tangents are cooriented/opposite or makes the selection automatically + if you set the GCE_AUTO_ALIGNMENT option. When the option GCE_CLOSEST is selected the C3D Solver + should maintain the current geometry positions. \~ +*/ +//--- +GCE_FUNC(GCE_alignment) GCE_SetAlignment( GCE_system gSys, constraint_item constraint, GCE_alignment alignment = GCE_AUTO_ALIGNMENT ); + //---------------------------------------------------------------------------------------- /** \brief \ru Изменить значение управляющего размера. \en Change the value of driving dimension. \~ @@ -2126,8 +2235,6 @@ GCE_FUNC(GCE_result) GCE_Transform( GCE_system gSys, const MbMatrix & mat ); //--- GCE_FUNC(bool) GCE_SetJournal( GCE_system gSys, const char * fName ); -#define FB_NULL_GEOM 0 - //---------------------------------------------------------------------------------------- /** \brief \ru Устаревшая функция. Вызов будет удален в одной из следующих версий. diff --git a/C3d/Include/gce_equations.h b/C3d/Include/gce_equations.h new file mode 100644 index 0000000..ca43ab3 --- /dev/null +++ b/C3d/Include/gce_equations.h @@ -0,0 +1,131 @@ +////////////////////////////////////////////////////////////////////////////////////////// +/** + \file + \brief \ru Нелинейные уравнения и неравенства, определяемые на стороне Приложения. + \en Nonlinear equations and inequations defined by the application. \~ +*/ +////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef __GCE_EQUATIONS_H +#define __GCE_EQUATIONS_H + +#include +#include "gce_geom.h" + +class MtVectorN; +template class RPArray; + +//---------------------------------------------------------------------------------------- +/** \brief \ru Интерфейс численного уравнения, выраженного через набор координат. + \en Interface of the numeric equation expressed via a set of coordinates. + \details \ru Как правило, это алгебраические уравнение общего вида f(x1,x2,..,xn) = g(x1,x2,..,xn) + явно-выраженной форме: x1 = g(x2,x3,..,xn). + \en As a rule, it is an algebraic equation of a general form f(x1,x2,..,xn) = g(x1,x2,..,xn) + or, as a special case, it is an equation in explicit form: x1 = g(x2,x3,..,xn). \~ +*/ +//--- +struct GCE_CLASS ItNumericEquation +{ + enum eval_result_code: char + { + EVAL_RESULT_Undefined = 0, + EVAL_RESULT_Ok, + EVAL_RESULT_OutOfDomaint + }; + struct eval_result + { + eval_result_code resCode = EVAL_RESULT_Undefined; + double funDer = MB_MAXDOUBLE; // Derivative value. + double funVal = MB_MAXDOUBLE; // Function value. + }; + /// \ru Выдать координату с индексом crdIdx. \en Get coordinate with crdIdx index. + virtual ItCoord* Coord( size_t crdIdx ) const = 0; + /// \ru Количество координат, связанных с уравнением. \en Count of coordinates connected with the equation. + virtual size_t NumCoords() const = 0; + /// \ru Вычисление первой производной по координате и значений функции. \en The first derivative by coordinate and the function values calculation. + virtual eval_result Evaluate(const ItCoord* crd, const std::vector& crdVals) const; + /// \ru Выдать координату зависимой переменной (для уравнений заданных в явно-выраженной форме). \en Get the coordinate of dependent variable (for explicit equations). + virtual const ItCoord* DependedCoord() const = 0; + + /** \brief \ru Признак уравнения, заданного в форме присвоения (начиная с Компас V12). + \en Flag of equation specified in form of assignment. + \details + \ru Уравнения, заданные в явно выраженной форме, считающиеся присвоением выражения зависимой переменной: x1 = g(x2,x3,..,xn). + Такие уравнения стремимся вычислять иерархическим способом, сверху-вниз. + \en Equations specified explicitly, considered to be the assignment of dependent variable: x1 = g(x2,x3,..,xn). + It is preferred to compute such equations by hierarchical top-down method. \~ + */ + virtual bool IsExplicit() const = 0; + +public: + virtual refcount_t AddRef() const = 0; + virtual refcount_t Release() const = 0; + +private: + // It will be removed + virtual bool CalcDerive( ItGeomCoord &, const MtVectorN &, double &, double & ) const { return false; } + // It will be removed. + virtual ItGeomCoord * GetCoord( ptrdiff_t ) const { return nullptr; } + // It will be removed. + virtual bool CalcDerive( ItGeomCoord &, const std::vector & /*argLine*/, double & /*fd*/, double & /*f*/ ) const { return false; } + // It will be removed. + virtual ptrdiff_t GetCoordCount() const { return 0; } + // It will be removed. + virtual ptrdiff_t GetDependedCoordIdx() const { return -1; } + +protected: + ~ItNumericEquation() {} +}; + +//---------------------------------------------------------------------------------------- +/** \brief \ru Вычисление первой производной по координате и значений функции. + \en The first derivative by coordinate and the function values calculation. +*/ +//--- +inline ItNumericEquation::eval_result ItNumericEquation::Evaluate(const ItCoord* crd, const std::vector& crdVals) const +{ + eval_result res; + ItGeomCoord * gCrd = dynamic_cast(const_cast(crd)); + if ( gCrd!=nullptr && CalcDerive(*gCrd, crdVals, res.funDer, res.funVal)) + { + res.resCode = EVAL_RESULT_Ok; + } + return res; +} + + +using ItAlgebraicConstraint = ItNumericEquation; + +/** + \addtogroup Constraints2D_API + \{ +*/ + +//---------------------------------------------------------------------------------------- +/** \brief \ru Задать ограничение, реализуемое на стороне клиента. + \en Specify a constraint implemented by the user. \~ + \param[in] gSys - \ru Система ограничений. + \en System of constraints. \~ + \param[in] iEqu - \ru Интерфейс уравнения, заданного пользователем. + \en Interface of the equation specified by the user. \~ + \param[in] varsCount - \ru Количество переменных. + \en Count of variables. \~ + \param[in] varsVector - \ru Вектор переменных. + \en Vector of variables. \~ + \return \ru Дескриптор нового ограничения. + \en Descriptor of a new constraint. \~ +*/ +// --- +GCE_FUNC(constraint_item) GCE_AddEquation( GCE_system gSys + , ItAlgebraicConstraint & iEqu + , size_t varsCount + , const var_item * varsVector ); + +/** + \} + Constraints2D_API +*/ + +#endif // __GCE_EQUATIONS_H + +// eof \ No newline at end of file diff --git a/C3d/Include/gce_routines.h b/C3d/Include/gce_routines.h new file mode 100644 index 0000000..75ab437 --- /dev/null +++ b/C3d/Include/gce_routines.h @@ -0,0 +1,25 @@ +////////////////////////////////////////////////////////////////////////////////////////// +/** + \file + \brief \ru API процедур и функций 2D решателя. + \en API of procedures and functions of 2D solver. \~ +*/ +////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef __GCE_ROUTINES_H +#define __GCE_ROUTINES_H + +/** + \addtogroup Constraints2D_API + \{ +*/ + + +/** + \} + Constraints2D_API +*/ + +#endif // __GCE_ROUTINES_H + +// eof \ No newline at end of file diff --git a/C3d/Include/gce_types.h b/C3d/Include/gce_types.h index 8c558b1..f6227ba 100644 --- a/C3d/Include/gce_types.h +++ b/C3d/Include/gce_types.h @@ -76,7 +76,7 @@ const pattern_item GCE_NULL_P = GCE_NULL; const double GCE_UNDEFINED_DBL = UNDEFINED_DBL; //---------------------------------------------------------------------------------------- -/// \ru Словарь типов геометрических примитивов. \en Dictionary of geometric primitives types. +/// \ru Словарь геометрических типов данных. \en Dictionary of а geometric data types. //--- typedef enum { @@ -363,6 +363,34 @@ typedef enum } GCE_bisec_variant; +//---------------------------------------------------------------------------------------- +/** \brief \ru Варианты выравнивания направлений. + \en Variants of alignment. \~ + \details \en Значение опции выравнивания используется для выбора из альтернативных решений + ограничения, такого как `GCE_TANGENT`. + \en The alignment value is used to alternate between solutions of a constraint such as `GCE_TANGENT`. + \note \ru Значения этого перечисления могут быть использованы для постоянного хранения и + останутся неизменными в следующих версиях. + \en Values of this enum can be used for permanent storage and will be kept + in the future versions. \~ +*/ +//--- +typedef enum +{ + GCE_NO_ALIGNMENT = 0, ///< \ru Неопределенное значение выравнивания (=не применима к данному ограничению). \en Undefined alignment value (=not applicable to this constraint). + GCE_COORIENTED, ///< \ru Для касания это сонаправленные касательные вектора (=нормали). \en For tangency, these are co-directional tangent vectors (=normal). + GCE_OPPOSITE, ///< \ru Для касания это противонаправленные касательные вектора (=нормали). \en For tangency, these are the opposing tangent vectors (=normal). + + /** \brief \ru Поддерживать способ выравнивания согласно начальному или текущему положению геометрии (соответствует поведению прежних версий). + \en Maintain the alignment according to the initial or current position of the geometry (reproduces behaviour from previous versions). \~ */ + GCE_CLOSEST, + + /** \brief \ru Автоматически выбрать опцию выравнивания, используя начальное приближение геометрии. + \en Automatically determine alignment options using initial geometry approximation. \~ */ + GCE_AUTO_ALIGNMENT, + +} GCE_alignment; + //---------------------------------------------------------------------------------------- /// \ru Координаты вектора. \en Vector coordinates. @@ -380,7 +408,7 @@ struct GCE_CLASS GCE_vecNd { size_t size; double * arg; - GCE_vecNd(): arg(0), size(0) {} + GCE_vecNd(): size(0), arg(0) {} }; //---------------------------------------------------------------------------------------- @@ -568,8 +596,9 @@ struct GCE_CLASS GCE_dim_pars double dimValue; ///< \ru Значение размера, когда var == GCE_NULL_V. \en Value of dimension when var == GCE_NULL_V. GCE_dim_pars() - : dimValue( 0.0 ) - , var( GCE_NULL_V ) + : var( GCE_NULL_V ) + , dimValue( 0.0 ) + {} }; diff --git a/C3d/Include/gcm_api.h b/C3d/Include/gcm_api.h index 50a001d..3838f9d 100644 --- a/C3d/Include/gcm_api.h +++ b/C3d/Include/gcm_api.h @@ -1134,6 +1134,32 @@ GCM_FUNC(GCM_geom) GCM_GetMovingGeom( GCM_system gSys ); GCM_FUNC(GCM_result) GCM_SolveReposition( GCM_system gSys, GCM_geom g, const MbPlacement3D & newPos, GCM_reposition movType ); +//---------------------------------------------------------------------------------------- +/** + \brief \ru Решить систему для произвольного изменения положения тела в заданной плоскости. + \en Solve the system for an arbitrary change of position of one solid in a given plane. + \param[in] gSys - \ru Система ограничений. + \en System of constraints. \~ + \param[in] movGeom - \ru Компонент, деталь, которой манипулируют. + \en Component, part which is manipulated. \~ + \param[in] projPlane - \ru Нормаль к плоскости, в которой происходит перетаскивание, заданная в ГСК сборки. + \en The normal to the plane in which the dragging occurs, specified in the assembly WCS. \~ + \param[in] cursor - \ru Текущее положение курсора в ГСК.. + \en Current position of a cursor in the WCS. \~ + \return \ru Код результата. \en Result code. \~ + + \details + \ru Процедура, управляющая режимом перетаскивания. При использовании данной функции не требуется предварительно + делать соответствующий ей вызов GCM_PrepareReposition, а так же не требуется вызывать GCM_FinishReposition + по окончании её использования. + \en The procedure that controls the drag and drop mode. When using this function, there is no need to make + a preliminary invoke of GCM_PrepareReposition, and there is no need to invoke GCM_FinishReposition + after using it. \~ +*/ +//--- +GCM_FUNC(GCM_result) GCM_SolveReposition( GCM_system gSys, GCM_geom moveGeom, const MbCartPoint3D & cursor, + const MbVector3D & projPlane ); + /** \brief \ru Решить систему сопряжений для новой позиции курсора в режиме драггинга. \en Solve the system of constraints for new position of cursor in the dragging mode. diff --git a/C3d/Include/gcm_manager.h b/C3d/Include/gcm_manager.h index 78c6ec8..8ae19e1 100644 --- a/C3d/Include/gcm_manager.h +++ b/C3d/Include/gcm_manager.h @@ -88,12 +88,12 @@ public: static const MtParVariant undef; ///< \ru Неопределенное значение. \en Undefined value. public: - MtParVariant() : tag( GCM_ARG_UNDEFINED ), enumVal( SYS_MAX_INT64-2 ) {} // \ru Неопределенное значение \en Undefined value - MtParVariant( float val ) : tag( GCM_ARG_NUMBER ), numVal( static_cast(val) ) {} - MtParVariant( double val ) : tag( GCM_ARG_NUMBER ), numVal( val ) {} + MtParVariant() : enumVal( SYS_MAX_INT64-2 ), tag( GCM_ARG_UNDEFINED ) {} // \ru Неопределенное значение \en Undefined value + MtParVariant( float val ) : numVal( static_cast(val) ), tag( GCM_ARG_NUMBER ) {} + MtParVariant( double val ) : numVal( val ), tag( GCM_ARG_NUMBER ) {} template< class _EnumType > - MtParVariant( _EnumType val ) : tag( GCM_ARG_ENUM ), enumVal( static_cast(val) ) {} - MtParVariant( const GCM_interval & interval ) : tag( GCM_ARG_INTERVAL ), interVal( interval ) {} + MtParVariant( _EnumType val ) : enumVal( static_cast(val) ), tag( GCM_ARG_ENUM ) {} + MtParVariant( const GCM_interval & interval ) : interVal( interval ), tag( GCM_ARG_INTERVAL ) {} public: template< typename _EnumType > diff --git a/C3d/Include/gcm_mates_generator.h b/C3d/Include/gcm_mates_generator.h index 1a9da3a..5f83388 100644 --- a/C3d/Include/gcm_mates_generator.h +++ b/C3d/Include/gcm_mates_generator.h @@ -32,13 +32,13 @@ struct GCM_CLASS TMParameters double realpar; // Dimension value. TMParameters( AlignCondition al, MtMateType mtype, double par = 0. ) - : align ( al ) - , matetype( mtype ) + : matetype( mtype ) + , align ( al ) , realpar ( par ) {} TMParameters( GCM_c_type mtype, double par = 0.0, GCM_alignment al = GCM_NO_ALIGNMENT ) - : align ( al ) - , matetype( mtype ) + : matetype( mtype ) + , align ( al ) , realpar ( par ) {} }; @@ -267,7 +267,7 @@ private: MtGeomSolver & manager; ///< \ru Решатель сборки. \en Solver of the assembly. public: - explicit AssemblyGenerator( MtGeomSolver & m ) : manager( m ), dimConstrs() {} + explicit AssemblyGenerator( MtGeomSolver & m ) : dimConstrs(), manager( m ) {} private: AssemblyGenerator( const AssemblyGenerator & ); diff --git a/C3d/Include/gcm_routines.h b/C3d/Include/gcm_routines.h index a7e0fe1..e3b1a50 100644 --- a/C3d/Include/gcm_routines.h +++ b/C3d/Include/gcm_routines.h @@ -77,8 +77,8 @@ struct GCM_CLASS MtMateParameters public: MtMateParameters() - : myAlignVal( GCM_NO_ALIGNMENT ) - , myDimVal( 0.0 ) + : myDimVal( 0.0 ) + , myAlignVal( GCM_NO_ALIGNMENT ) , myDimEvaluated( false ) , myDimSigned( false ) {} @@ -154,9 +154,9 @@ struct GCM_CLASS MtADimensionTraits double value; ///< \ru Значение размера - угол вращения. \en Dimension value - the angle of rotation. MtADimensionTraits() - : axisZ() - , firstVector() + : firstVector() , secondVector() + , axisZ() , value( 0.0 ) {} }; diff --git a/C3d/Include/gcm_types.h b/C3d/Include/gcm_types.h index 6b77e95..b853fc1 100644 --- a/C3d/Include/gcm_types.h +++ b/C3d/Include/gcm_types.h @@ -339,18 +339,19 @@ typedef enum /* Произвольное поведение (arbitrary behavior). */ - GCM_REPOSITION_FreeRotation ///< \ru Произвольная репозиция с преимуществом вращения. \en Arbitrary reposition with predominant rotation. \~ - , GCM_REPOSITION_FreeMoving ///< \ru Произвольная репозиция с преимуществом перемещения. \en Arbitrary reposition with predominant moving. \~ + GCM_REPOSITION_FreeRotation = 1 ///< \ru Произвольная репозиция с преимуществом вращения. \en Arbitrary reposition with predominant rotation. \~ + , GCM_REPOSITION_FreeMoving = 2 ///< \ru Произвольная репозиция с преимуществом перемещения. \en Arbitrary reposition with predominant moving. \~ /* Строгое поведение (strict behavior). */ - , GCM_REPOSITION_Dragging ///< \ru Перетаскивание в плоскости "экрана". \en Dragging in the plane of the screen. \~ - , GCM_REPOSITION_Rotation ///< \ru Вращение вокруг неподвижной оси. \en Rotation around fixed axis. \~ - , GCM_REPOSITION_Transfer /**< \ru Перенос только для одного твердого тела. \en Shift only one solid. \~ + , GCM_REPOSITION_Dragging = 3///< \ru Перетаскивание в плоскости "экрана". \en Dragging in the plane of the screen. \~ + , GCM_REPOSITION_Rotation = 4///< \ru Вращение вокруг неподвижной оси. \en Rotation around fixed axis. \~ + , GCM_REPOSITION_Transfer = 5/**< \ru Перенос только для одного твердого тела. \en Shift only one solid. \~ \note \ru Этот режим #GCM_REPOSITION_Transfer был задуман для процессов вставки нового тела в сборку САПР. \en This mode #GCM_REPOSITION_Transfer have been intended for insertion processes of a new solid in the CAD assembly. \~ */ + , GCM_REPOSITION_Inactive = 1000 } GCM_reposition; //---------------------------------------------------------------------------------------- @@ -421,19 +422,20 @@ typedef enum \note Internal use only. The feature is under development. */ //--- -typedef struct +struct GCM_CLASS GCM_dof_record { - GCM_dof_result result; ///< \ru Код результата вычисления степени свободы геометрического объекта. \en Resulting code of evaluating the geometric degrees of freedom. \~ + /// \ru Код результата вычисления степени свободы геометрического объекта. \en Resulting code of evaluating the geometric degrees of freedom. \~ + GCM_dof_result result; // Translational degree of freedom info. - size_t tdof; + size_t tdof; GCM_vec3d dir1; GCM_vec3d dir2; // Rotational degree of freedom info. size_t rdof; GCM_point center; - GCM_vec3d axis1; - GCM_vec3d axis2; -} GCM_dof_record; + GCM_vec3d axis1 ; + GCM_vec3d axis2 ; +}; //---------------------------------------------------------------------------------------- /** \brief \ru Статус геометрического объекта. diff --git a/C3d/Include/lump.h b/C3d/Include/lump.h index e6365df..a08aee4 100644 --- a/C3d/Include/lump.h +++ b/C3d/Include/lump.h @@ -181,7 +181,8 @@ public: {} /// \ru Конструктор копирования с регистратором. \en Copy-constructor with the registrator. MbLumpCube( const MbLumpCube & other ) - : cube( other.cube ) + : MbRefItem {} + , cube( other.cube ) , from( other.from ) , component( other.component ) , identifier( other.identifier ) diff --git a/C3d/Include/map_lump.h b/C3d/Include/map_lump.h index aa18b8b..71b5b4a 100644 --- a/C3d/Include/map_lump.h +++ b/C3d/Include/map_lump.h @@ -209,8 +209,8 @@ public: : component ( _comp ) , identifier( _ident ) , solid ( _solid ) - , name ( &_name ) , from ( _from ) + , name ( &_name ) , wtCurves ( 0, 1, true ) { name.SetOwn(false); @@ -231,8 +231,8 @@ public: : component ( _comp ) , identifier( _ident ) , solid ( nullptr ) - , name ( &_name ) , from ( ) + , name ( &_name ) , wtCurves ( 0, 1, true ) { name.SetOwn(false); diff --git a/C3d/Include/math_version.h b/C3d/Include/math_version.h index d13c6fb..9eaa589 100644 --- a/C3d/Include/math_version.h +++ b/C3d/Include/math_version.h @@ -97,10 +97,12 @@ #define MATH_22_HF3_VERSION 0x16000004L ///< \ru Версия файла - 22.0 HF3. \en The file version - 22.0 HF3. \~ \ingroup Base_Tools #define MATH_22_HF4_VERSION 0x16000005L ///< \ru Версия файла - 22.0 HF4. \en The file version - 22.0 HF4. \~ \ingroup Base_Tools #define MATH_22_HF5_VERSION 0x16000006L ///< \ru Версия файла - 22.0 HF5. \en The file version - 22.0 HF5. \~ \ingroup Base_Tools +#define MATH_22_HF6_VERSION 0x16000007L ///< \ru Версия файла - 22.0 HF6. \en The file version - 22.0 HF6. \~ \ingroup Base_Tools #define MATH_22_UHF_VERSION 0x16000011L ///< \ru Версия файла - 22.0 UHF (Upper Hot Fix). \en The file version - 22.0 UHF (Upper Hot Fix). \~ \ingroup Base_Tools #define C3D_2023_VERSION 0x16001001L ///< \ru Версия файла - C3D 2023. \en The file version - C3D 2023. \~ \ingroup Base_Tools #define MATH_23_VERSION 0x17000001L ///< \ru Версия файла - 23.0. \en The file version - 23.0. \~ \ingroup Base_Tools #define MATH_23_HF1_VERSION 0x17000003L ///< \ru Версия файла - 23.0 HF1. \en The file version - 23.0 HF1. \~ \ingroup Base_Tools +#define MATH_23_HF2_VERSION 0x17000004L ///< \ru Версия файла - 23.0 HF2. \en The file version - 23.0 HF2. \~ \ingroup Base_Tools #define MATH_23_UHF_VERSION 0x17000101L ///< \ru Версия файла - 23.0 UHF (Upper Hot Fix). \en The file version - 23.0 UHF (Upper Hot Fix). \~ \ingroup Base_Tools #define C3D_2024_VERSION 0x17001002L ///< \ru Версия файла - C3D 2024. \en The file version - C3D 2024. \~ \ingroup Base_Tools diff --git a/C3d/Include/math_x.h b/C3d/Include/math_x.h index 7f1b0f4..89b377d 100644 --- a/C3d/Include/math_x.h +++ b/C3d/Include/math_x.h @@ -93,7 +93,7 @@ namespace c3d { #define CONCAT_TKNS(A, B, C, D) A B C D // Concatenate tokens without expanding macro (if invoked from macro, arguments are expanded). #define CONCAT_TOKENS(A, B, C, D) CONCAT_TKNS(A, B, C, D) // Concatenate tokens with expanding macro. -#define DEPR_MSG "This is a deprecated API that will be removed in version 2024!" // Message about a deprecated API. +#define DEPR_MSG "This is a deprecated API that will be removed in version 2025!" // Message about a deprecated API. #define DEPR_MSG_EX(msg) CONCAT_TOKENS(DEPR_MSG, " Use ", #msg, " instead it.") // Message about a deprecated API indicating a replacement API. diff --git a/C3d/Include/mb_point_mating.h b/C3d/Include/mb_point_mating.h index 48534f1..ea7b4c6 100644 --- a/C3d/Include/mb_point_mating.h +++ b/C3d/Include/mb_point_mating.h @@ -131,12 +131,12 @@ MbPntMatingData::MbPntMatingData( const MbeMatingType nType, bool nMovePnts, bool nAttach ) : MbRefItem ( ) - , type ( nType ) , tangent ( (nTang != nullptr) ? new Vector( *nTang ) : nullptr ) , tangentDer1 ( (nTangDer1 != nullptr) ? new Vector( *nTangDer1 ) : nullptr ) , tangentDer2 ( (nTangDer2 != nullptr) ? new Vector( *nTangDer2 ) : nullptr ) - , movePnts ( nMovePnts ) , changedPnts ( nChangedPnts ) + , type ( nType ) + , movePnts ( nMovePnts ) , attach ( nAttach ) { if ( type <= trt_Position ) { // BUG_52162 @@ -153,12 +153,12 @@ MbPntMatingData::MbPntMatingData( const MbeMatingType nType, template MbPntMatingData::MbPntMatingData( const MbPntMatingData & d ) : MbRefItem ( ) - , type ( d.type ) , tangent ( (d.tangent != nullptr) ? new Vector( *d.tangent ) : nullptr ) , tangentDer1 ( (d.tangentDer1 != nullptr) ? new Vector( *d.tangentDer1 ) : nullptr ) , tangentDer2 ( (d.tangentDer2 != nullptr) ? new Vector( *d.tangentDer2 ) : nullptr ) - , movePnts ( d.movePnts ) , changedPnts ( d.changedPnts ) + , type ( d.type ) + , movePnts ( d.movePnts ) , attach ( d.attach ) { } diff --git a/C3d/Include/mb_property_title.h b/C3d/Include/mb_property_title.h index 2ed906a..5e84b74 100644 --- a/C3d/Include/mb_property_title.h +++ b/C3d/Include/mb_property_title.h @@ -181,6 +181,7 @@ enum MbePrompt IDS_ITEM_0274, ///< \ru Усеченный каркас. \en Trimmed wire frame. IDS_ITEM_0275, ///< \ru Развернутая точка. \en Unwrapped point. IDS_ITEM_0276, ///< \ru Свёрнутая точка. \en Wrapped point. + IDS_ITEM_0277, ///< \ru Эквидистантный каркас. \en Offset wire frame. // \ru Типы параметрических поверхностей. \en Types of parametric surfaces. @@ -202,6 +203,7 @@ enum MbePrompt IDS_ITEM_0315, ///< \ru Конически согнутая поверхность. \en Conically Bent Surface. IDS_ITEM_0316, ///< \ru Конически разогнутая поверхность. \en Conically Unbent Surface. IDS_ITEM_0317, ///< \ru Поверхность заметания с изменением образующей. \en Sweep Surface with Changin Generatin. + IDS_ITEM_0318, ///< \ru Линейчато согнутая/разогнутая поверхность. \en Ruled Bent/Unbent Surface. IDS_ITEM_0319, ///< \ru Плоскость. \en Plane. IDS_ITEM_0320, ///< \ru Сферическая поверхность. \en Spherical Surface. IDS_ITEM_0321, ///< \ru Тороидальная поверхность. \en Toroidal Surface. @@ -1341,6 +1343,8 @@ enum MbePrompt IDS_PROP_2033, ///< \ru Индекс части скругления. \en Index of fillet part. IDS_PROP_2034, ///< \ru Опция выбора результата. \en Option for the result selection. + IDS_PROP_2035, ///< \ru Режим адаптации. \en Adaptation mode. + IDS_PROP_LAST = 9999, ///< \ru Наибольшее значение. \en The greatest value. }; diff --git a/C3d/Include/mb_smooth_nurbs_fit_curve.h b/C3d/Include/mb_smooth_nurbs_fit_curve.h index 2645fe7..d07fc6f 100644 --- a/C3d/Include/mb_smooth_nurbs_fit_curve.h +++ b/C3d/Include/mb_smooth_nurbs_fit_curve.h @@ -182,11 +182,11 @@ private: public: /// \ru Конструктор по умолчанию. \en Default constructor. MbApproxNurbsParameters( VERSION version = Math::DefaultMathVersion() ) - : _order ( c3d::NURBS_DEGREE ) + : _bClosed ( false ) + , _order ( c3d::NURBS_DEGREE ) , _methodSmoothing( sm_CurvatureVariance ) , _coefSmoothing ( -1. ) , _tolerance ( c3d::DELTA_MIN ) - , _bClosed ( false ) , _pReference ( nullptr ) , _version ( version ) {} diff --git a/C3d/Include/mb_variables.h b/C3d/Include/mb_variables.h index 7faa600..3f201a6 100644 --- a/C3d/Include/mb_variables.h +++ b/C3d/Include/mb_variables.h @@ -623,7 +623,7 @@ MATH_FUNC(const char *) C3DFileNameOnly( const char * path ); // Suppress a warning "unreferenced formal parameter" -#define C3D_UNUSED_PARAMETER( param ) (void*)(¶m) +#define C3D_UNUSED_PARAMETER( param ) (std::ignore = param) #ifdef C3D_DEBUG diff --git a/C3d/Include/mesh_halfedge_attr.h b/C3d/Include/mesh_halfedge_attr.h index e019447..88f7637 100644 --- a/C3d/Include/mesh_halfedge_attr.h +++ b/C3d/Include/mesh_halfedge_attr.h @@ -22,11 +22,13 @@ class MbHalfedge; #define SIMPLE_FACET_ATTRIBUTE(type, value, nameAttr, typeAttr) \ class MATH_CLASS nameAttr : public MbHalfedgeAttrSimpleValueFacetBase\ {\ + private:\ + const type _def = value;\ public:\ nameAttr( const MbHalfedge & topo ) : MbHalfedgeAttrSimpleValueFacetBase( topo, typeAttr ) {}\ virtual ~nameAttr() {}\ static MbeTypeAttr IsA() { return typeAttr; }\ - type DefaultValue() const override { return value; }\ + const type& DefaultValue() const override { return _def; }\ HALFEDGE_VISITING();\ DECLARE_PERSISTENT_CLASS( nameAttr );\ }; @@ -35,11 +37,13 @@ class MbHalfedge; #define SIMPLE_EDGE_ATTRIBUTE(type, value, nameAttr, typeAttr) \ class MATH_CLASS nameAttr : public MbHalfedgeAttrSimpleValueEdgeBase\ {\ + private:\ + const type _def = value;\ public:\ nameAttr( const MbHalfedge & topo ) : MbHalfedgeAttrSimpleValueEdgeBase( topo, typeAttr ) {}\ virtual ~nameAttr() {}\ static MbeTypeAttr IsA() { return typeAttr; }\ - type DefaultValue() const override { return value; }\ + const type& DefaultValue() const override { return _def; }\ HALFEDGE_VISITING();\ DECLARE_PERSISTENT_CLASS( nameAttr );\ }; @@ -48,11 +52,13 @@ class MbHalfedge; #define SIMPLE_VERTEX_ATTRIBUTE(type, value, nameAttr, typeAttr) \ class MATH_CLASS nameAttr : public MbHalfedgeAttrSimpleValueVertexBase\ {\ + private:\ + const type _def = value;\ public:\ nameAttr( const MbHalfedge & topo ) : MbHalfedgeAttrSimpleValueVertexBase( topo, typeAttr ) {}\ virtual ~nameAttr() {}\ static MbeTypeAttr IsA() { return typeAttr; }\ - type DefaultValue() const override { return value; }\ + const type& DefaultValue() const override { return _def; }\ HALFEDGE_VISITING();\ DECLARE_PERSISTENT_CLASS( nameAttr );\ }; @@ -105,6 +111,8 @@ public: bool CalculateEdgePoint( size_t iEd, double prm, MbCartPoint3D & pt ) const; /// \ru Получить 3Д вершины для последовательности ребер. \en Get 3D points for all vertices in the edges chain. bool GetEdgePathVertices( const c3d::IndicesVector & edges, c3d::SpacePointsVector & points ) const; + /// \ru Получить 3Д вершины для последовательности ребер. \en Get 3D points for all vertices in the edges chain. + bool GetEdgePathVertices( const c3d::IndicesPairsVector & edges, c3d::SpacePointsVector & points ) const; /// \ru Посчитать нормаль треугольного фасета. \en Calculate the normal for the triangle facet. bool CalculateTriangleNormal( size_t iTr, MbVector3D & normal ) const; /// \ru Посчитать aspect ratio треугольного фасета. \en Calculate aspect ratio for the triangle facet. @@ -123,8 +131,10 @@ public: bool CalculateLengthEdge( size_t iEd, double & len ) const; /// \ru Посчитать квадрат длины ребра. \en Calculate the square of the edge's length. bool CalculateLengthEdge2( size_t iEd, double & len2 ) const; - // \ru Рассчитать габарит в локальной системы координат. \en Calculate the bounding box int the given coordinate system. + // \ru Рассчитать габарит в локальной системе координат. \en Calculate the bounding box int the given coordinate system. void CalculateLocalGabarit( const MbMatrix3D & matrInto, MbCube & localCube ) const; + // \ru Рассчитать габарит фасета в локальной системе координат. \en Calculate the facet's bounding box int the given coordinate system. + void CalculateFacetLocalGabarit( const MbMatrix3D & matrInto, size_t iF, MbCube & localCube ) const; // \ru Рассчитать уравнение плоскости треугольного фасета. \en Calculate the plane where the given triangle facet is located. bool GetTrianglePlaneEquation( size_t iTr, bool bNormalize, std::array & plane ) const; // \ru Рассчитать нормаль в вершине усреднением нормалей соседних треугольных фасетов. \en Calculate the normal at a vertex as the average normal of all triangle facets around it. @@ -192,6 +202,8 @@ public: bool CalculateLengthEdge2( size_t iEd, double & len2 ) const; /// \ru Получить параметры для последовательности ребер. \en Get 2D parameters for all vertices in the edges chain. bool GetEdgePathVertices( const c3d::IndicesVector & edges, c3d::ParamPointsVector & points ) const; + /// \ru Получить параметры для последовательности ребер. \en Get 2D parameters for all vertices in the edges chain. + bool GetEdgePathVertices( const c3d::IndicesPairsVector & edges, c3d::ParamPointsVector & points ) const; /// \ru Рассчитать габаритный прямоугольник. \en Calculate the bounding rect. void CalculateRect( MbRect & rect ) const; diff --git a/C3d/Include/mesh_halfedge_attr_base.h b/C3d/Include/mesh_halfedge_attr_base.h index b2d673e..5acb4f4 100644 --- a/C3d/Include/mesh_halfedge_attr_base.h +++ b/C3d/Include/mesh_halfedge_attr_base.h @@ -121,6 +121,8 @@ public: void SetId( size_t id ) { _id = id; } /// \ru Получить индекс. \en Get identifier. size_t GetId() const { return _id; } + /// \ru Получить топологию. \en GetTopology. + const MbHalfedge & GetTopo() const { return *_topo; } /// \ru Принять посетителя. \en Accept Visitor virtual void Accept( HalfedgeVisitor & visitor ) = 0; @@ -179,7 +181,7 @@ const T * CastHalfedgeAttribute( const MbHalfedgeAttrBase * pObj ) \ingroup Data_Structures */ // --- -template +template class MbHalfedgeAttrSimpleValueBase : public MbHalfedgeAttrBase { protected: @@ -192,7 +194,7 @@ public: virtual ~MbHalfedgeAttrSimpleValueBase() {} /// \ru Получить значение по умолчанию. \en Get default value. - virtual Value DefaultValue() const = 0; + virtual const Value & DefaultValue() const = 0; /// \ru Установить размер массива величин, заполнить его значением по умолчанию. \en Set size of the values array filled with default values. void SetSize( size_t size ) { _values.assign( size, DefaultValue() ); } /// \ru Получить размер массива величин. \en Get size of the values array. @@ -200,7 +202,11 @@ public: /// \ru Определено ли значение элемента. \en Check if value is undefined (default). virtual bool IsUndefined( size_t i ) const { return _values[i] == DefaultValue(); } /// \ru Получить значение элемента. \en Get value by identifier. + template::value >::type> Value GetValue( size_t i ) const { return _values[i]; } + /// \ru Получить значение элемента. \en Get value by identifier. + template::value >::type> + const Value & GetValue( size_t i ) const { return _values[i]; } /// \ru Установить значение элемента в указанную величину. \en Set value to the element given by identifier. void SetValue( size_t i, Value val ) { _values[i] = val; } /// \ru Установить значение набора элементов в указанную величину. \en Set value to the set of elements. diff --git a/C3d/Include/op_curve_parameter.h b/C3d/Include/op_curve_parameter.h index 74d643a..ae83693 100644 --- a/C3d/Include/op_curve_parameter.h +++ b/C3d/Include/op_curve_parameter.h @@ -161,12 +161,12 @@ public: const MbVector3D & dir ) : _uv1beg ( uv1beg ) , _uv1end ( uv1end ) - , _ext1 ( ext1 ) , _uv2beg ( uv2beg ) , _uv2end ( uv2end ) - , _ext2 ( ext2 ) , _direction ( dir ) , _guideCurve ( nullptr ) + , _ext1 ( ext1 ) + , _ext2 ( ext2 ) , _useRedetermination ( false ) , _checkPoles ( false ) {} @@ -205,11 +205,11 @@ public: bool checkPoles ) : _uv1beg ( uv1beg ) , _uv1end ( uv1end ) - , _ext1 ( ext1 ) , _uv2beg ( uv2beg ) , _uv2end ( uv2end ) - , _ext2 ( ext2 ) , _guideCurve ( guideCurve ) + , _ext1 ( ext1 ) + , _ext2 ( ext2 ) , _useRedetermination ( useRedetermination ) , _checkPoles ( checkPoles ) {} @@ -287,8 +287,8 @@ public: MbIntCurveParams( const MbSNameMaker & snMaker ) : mergeCurves( true ) , cutCurves ( false ) - , _snMaker ( &snMaker.Duplicate() ) , _type ( ict_General ) + , _snMaker ( &snMaker.Duplicate() ) { if ( snMaker.GetMathVersion() > MATH_19_VERSION ) // KOMPAS-39273 + KOMPAS-40408 cutCurves = true; @@ -305,8 +305,8 @@ public: MbIntCurveParams( bool _cutCurves, const MbSNameMaker & snMaker ) : mergeCurves( true ) , cutCurves ( _cutCurves ) - , _snMaker ( &snMaker.Duplicate() ) , _type ( ict_General ) + , _snMaker ( &snMaker.Duplicate() ) {} /** \brief \ru Конструктор. \en Constructor. \~ @@ -322,8 +322,8 @@ public: MbIntCurveParams( bool _mergeCurves, bool _cutCurves, const MbSNameMaker & snMaker ) : mergeCurves( _mergeCurves ) , cutCurves ( _cutCurves ) - , _snMaker ( &snMaker.Duplicate() ) , _type ( ict_General ) + , _snMaker ( &snMaker.Duplicate() ) {} /** \brief \ru Конструктор. @@ -349,12 +349,12 @@ public: const MbCartPoint & uvInitOnSurface2, const MbVector3D & initDirection, const MbSNameMaker & nameMaker ) - : _values ( new MbIntCurveOnePointValues( - surface1Domain, surface2Domain, uvInitOnSurface1, uvInitOnSurface2, initDirection) ) - , _type ( ict_OnePoint ) - , mergeCurves( true ) + : mergeCurves( true ) , cutCurves ( true ) + , _type ( ict_OnePoint ) , _snMaker ( &nameMaker.Duplicate() ) + , _values ( new MbIntCurveOnePointValues( + surface1Domain, surface2Domain, uvInitOnSurface1, uvInitOnSurface2, initDirection) ) {} /** \brief \ru Конструктор. @@ -386,11 +386,11 @@ public: bool ext2, const MbVector3D & dir, const MbSNameMaker & nameMaker ) - : _values ( new MbIntCurveLimitPointsValues(uv1beg, uv1end, ext1, uv2beg, uv2end, ext2, dir) ) - , _type ( ict_TwoPoints ) - , mergeCurves( true ) + : mergeCurves( true ) , cutCurves ( true ) + , _type ( ict_TwoPoints ) , _snMaker ( &nameMaker.Duplicate() ) + , _values ( new MbIntCurveLimitPointsValues(uv1beg, uv1end, ext1, uv2beg, uv2end, ext2, dir) ) {} @@ -429,12 +429,12 @@ public: bool useRedetermination, bool checkPoles, const MbSNameMaker & nameMaker ) - : _values ( new MbIntCurveLimitPointsValues( - uv1beg, uv1end, ext1, uv2beg, uv2end, ext2, guideCurve, useRedetermination, checkPoles) ) - , _type ( ict_TwoPointsGuide ) - , mergeCurves( true ) + : mergeCurves( true ) , cutCurves ( true ) + , _type ( ict_TwoPointsGuide ) , _snMaker ( &nameMaker.Duplicate() ) + , _values ( new MbIntCurveLimitPointsValues( + uv1beg, uv1end, ext1, uv2beg, uv2end, ext2, guideCurve, useRedetermination, checkPoles) ) {} /// \ru Получить параметры создания кривой по начальной точке. \en Get the parameters for the curve creation by the initial point. @@ -490,8 +490,8 @@ public: const MbSNameMaker & snMaker ) : MbIntCurveParams( mergeCrvs, cutCrvs, snMaker ) , _faces1 ( faceIndices1 ) - , _same1 ( same1 ) , _faces2 ( faceIndices2 ) + , _same1 ( same1 ) , _same2 ( same2 ) , _useCreators( true ) {} @@ -515,8 +515,8 @@ public: const MbSNameMaker & snMaker ) : MbIntCurveParams( snMaker ) , _faces1 ( faceIndices1 ) - , _same1 ( same1 ) , _faces2 ( faceIndices2 ) + , _same1 ( same1 ) , _same2 ( same2 ) , _useCreators( true ) {} @@ -541,8 +541,8 @@ public: const MbSNameMaker & snMaker ) : MbIntCurveParams( mergeCrvs, cutCrvs, snMaker ) , _faces1 ( faceIndices1 ) - , _same1 ( false ) , _faces2 ( faceIndices2 ) + , _same1 ( false ) , _same2 ( false ) , _useCreators( false ) {} @@ -562,8 +562,8 @@ public: const MbSNameMaker & snMaker ) : MbIntCurveParams( snMaker ) , _faces1 ( faceIndices1 ) - , _same1 ( false ) , _faces2 ( faceIndices2 ) + , _same1 ( false ) , _same2 ( false ) , _useCreators( false ) {} @@ -639,21 +639,48 @@ public: protected: bool useSurfaceNormal; ///< \ru Эквидистанта согласована с нормалью к поверхности. \en Offset point is moved according to surface normal. c3d::ConstSurfaceSPtr surface; ///< \ru Поверхность кривой или подобная ей. \en Curve's surface or similar to such surface. - const MbSNameMaker & snMaker; ///< \ru Именователь кривых каркаса. \en An object defining the frame curves names. + c3d::SNameMakerSPtr snMaker; ///< \ru Именователь кривых каркаса. \en An object defining the frame curves names. public: /// \ru Конструктор по параметрам. \en Constructor by parameters. MbSpatialOffsetCurveParams( const MbVector3D & v, const MbSNameMaker & nm ) - : offsetVect ( v ) - , useFillet ( false ) - , keepRadius ( false ) - , bluntAngle ( false ) - , fromBeg ( true ) - , useSurfaceNormal( false ) - , surface ( nullptr ) - , snMaker ( nm ) + : offsetVect ( v ) + , useFillet ( false ) + , keepRadius ( false ) + , bluntAngle ( false ) + , fromBeg ( true ) + , useSurfaceNormal( false ) + , surface ( nullptr ) + , snMaker ( &nm.Duplicate() ) {} + /// \ru Конструктор по параметрам. \en Constructor by parameters. + MbSpatialOffsetCurveParams( const MbVector3D & offset, bool useFllt, bool keepRds, bool bluntAngl, bool beg, bool useNrm, c3d::ConstSurfaceSPtr surf, const MbSNameMaker & nm ) + : offsetVect ( offset ) + , useFillet ( useFllt ) + , keepRadius ( keepRds ) + , bluntAngle ( bluntAngl ) + , fromBeg ( beg ) + , useSurfaceNormal( useNrm ) + , surface ( nullptr ) + , snMaker ( &nm.Duplicate() ) + { + if ( surface != nullptr ) + SetBySurfaceNormal( useSurfaceNormal, &surface ); + } + /// \ru Конструктор копирования. \en Copy constructor. + MbSpatialOffsetCurveParams( const MbSpatialOffsetCurveParams & other ); + /// \ru Конструктор для чтения. \en Constructor for reading. + MbSpatialOffsetCurveParams( TapeInit tapeInit ); + public: + /// \ru Преобразовать элемент согласно матрице. \en Transform element by matrix. + void Transform( const MbMatrix3D & matrix ); + /// \ru поворот точкек вокруг произвольной оси \en rotate points around an arbitrary axis. + void Rotate( const MbAxis3D & axis, double angle ); + /// \ru Сдвиг точкек на произвольный вектор \en Move points on arbitrary vector. + void Move( const MbVector3D & to ); + /// \ru Проверка на равенство. \en Check if *this == other. + bool IsEqual( const MbSpatialOffsetCurveParams & other, double accuracy ) const; /// \ru Установка режима по поверхности, переносится ли эквидистантная точка согласованно с нормалью к поверхности. \en Setting the mode whether offset point is moved according to surface normal or not. void SetBySurfaceNormal( bool set, c3d::ConstSurfaceSPtr * s = nullptr ) { @@ -667,14 +694,19 @@ public: surface = nullptr; } } - /// \ru Получить поверхность. \en Get surface. + /// \ru Получить флаг согласованности с нормалью к поверхности. \en Get the surface normal according flag. bool BySurfaceNormal() const { return useSurfaceNormal; } - /// \ru Получить поверхность. \en Get surface. + /// \ru Получить поверхность. \en Get surface. const c3d::ConstSurfaceSPtr & GetSurface() const { return surface; } - /// \ru Получить ссылку на именователь. \en Get names maker reference. - const MbSNameMaker & GetNameMaker() const { return snMaker; } + /// \ru Получить ссылку на именователь. \en Get names maker reference. + const MbSNameMaker & GetNameMaker() const { return *snMaker; } + /// \ru Задать именователь. \en Set names maker. + void SetNameMaker( const MbSNameMaker & newName ) const { snMaker->SetNameMaker( newName, true ); } -OBVIOUS_PRIVATE_COPY( MbSpatialOffsetCurveParams ) + /// \ru Оператор присваивания. \en Assignment operator. + MbSpatialOffsetCurveParams & operator=( const MbSpatialOffsetCurveParams & ); + + KNOWN_OBJECTS_RW_REF_OPERATORS( MbSpatialOffsetCurveParams ) // \ru Для работы со ссылками и объектами класса. \en For working with references and objects of the class. \~ }; @@ -687,11 +719,11 @@ OBVIOUS_PRIVATE_COPY( MbSpatialOffsetCurveParams ) */ // --- struct MATH_CLASS MbSurfaceOffsetCurveParams { public: - c3d::ConstFaceSPtr face; ///< \ru Грань, на которой строится эквидистанта. \en The face on which to build the offset curve. - MbAxis3D dirAxis; ///< \ru Направление смещения с точкой приложения. \en The offset direction with a reference point. - double dist; ///< \ru Величина смещения. \en The offset distance. + c3d::ConstFaceSPtr face; ///< \ru Грань, на которой строится эквидистанта. \en The face on which to build the offset curve. + MbAxis3D dirAxis; ///< \ru Направление смещения с точкой приложения. \en The offset direction with a reference point. + double dist; ///< \ru Величина смещения. \en The offset distance. protected: - const MbSNameMaker & snMaker; ///< \ru Именователь кривых каркаса. \en An object defining the frame curves names. + c3d::SNameMakerSPtr snMaker; ///< \ru Именователь кривых каркаса. \en An object defining the frame curves names. public: /// \ru Конструктор по параметрам. \en Constructor by parameters. @@ -699,13 +731,37 @@ public: : face ( &f ) , dirAxis( a ) , dist ( d ) - , snMaker( nm ) + , snMaker( &nm.Duplicate() ) {} -public: - /// \ru Получить ссылку на именователь. \en Get names maker reference. - const MbSNameMaker & GetNameMaker() const { return snMaker; } + /// \ru Конструктор копирования. \en Copy constructor. + MbSurfaceOffsetCurveParams( const MbSurfaceOffsetCurveParams & other ); + /// \ru Конструктор для чтения. \en Constructor for reading. + MbSurfaceOffsetCurveParams( TapeInit tapeInit ); -OBVIOUS_PRIVATE_COPY( MbSurfaceOffsetCurveParams ) +public: + /// \ru Преобразовать элемент согласно матрице. \en Transform element by matrix. + void Transform( const MbMatrix3D & matrix ); + /// \ru Поворот точкек вокруг произвольной оси \en Rotate points around an arbitrary axis. + void Rotate( const MbAxis3D & axis, double angle ); + /// \ru Сдвиг точкек на произвольный вектор \en Move points on arbitrary vector. + void Move( const MbVector3D & to ); + /// \ru Проверка на равенство. \en Check if *this == other. + bool IsEqual( const MbSurfaceOffsetCurveParams & other, double accuracy ) const; + /// \ru Установка поверхности. \en Setting the surface. + void SetFace( c3d::ConstFaceSPtr * f = nullptr ) + { + if ( f != nullptr ) + face = *f; + } + /// \ru Получить ссылку на именователь. \en Get names maker reference. + const MbSNameMaker & GetNameMaker() const { return *snMaker; } + /// \ru Задать именователь. \en Set names maker. + void SetNameMaker( const MbSNameMaker & newName ) const { snMaker->SetNameMaker( newName, true ); } + + /// \ru Оператор присваивания. \en Assignment operator. + MbSurfaceOffsetCurveParams & operator=( const MbSurfaceOffsetCurveParams & ); + + KNOWN_OBJECTS_RW_REF_OPERATORS( MbSurfaceOffsetCurveParams ) // \ru Для работы со ссылками и объектами класса. \en For working with references and objects of the class. \~ }; @@ -1096,23 +1152,23 @@ public: /// \ru Конструктор по параметрам. \en Constructor by parameters. MbCornerChamferParams( size_t _index, double _distance, double _distAngle, bool _type = false ) - : index ( _index ) - , distance ( _distance ) + : distance ( _distance ) , distAngle( _distAngle ) + , index ( _index ) , type ( _type ) {} /// \ru Конструктор по умолчанию. \en Default constructor. MbCornerChamferParams() - : index ( -1 ) - , distance ( 0 ) + : distance ( 0 ) , distAngle( 0 ) + , index ( -1 ) , type ( false ) {} /// \ru Конструктор копирования. \en Copy constructor. MbCornerChamferParams(const MbCornerChamferParams & other) - : index ( other.index ) - , distance ( other.distance ) + : distance ( other.distance ) , distAngle( other.distAngle ) + , index ( other.index ) , type ( other.type ) {} /// \ru Оператор присваивания. \en Assignment operator. \~ diff --git a/C3d/Include/op_direct_mod_parameter.h b/C3d/Include/op_direct_mod_parameter.h index b81f906..2d3953d 100644 --- a/C3d/Include/op_direct_mod_parameter.h +++ b/C3d/Include/op_direct_mod_parameter.h @@ -1011,6 +1011,22 @@ public: bool GetOffsetFacesHotPoint( MbCartPoint3D & pnt, MbVector3D & dir ) const; + /** \brief \ru Получить хот-точку и её вектор направления смещения для операции замены группы граней. + \en Get hot point and its displacement direction vector for the replacement faces group operation. \~ + \details \ru В случае успешного выполнения операции хот-точка размещается в центре грани, ближайшей к центру заменяющей группы граней. + В случае неудачного выполнения операции хот-точка располагается в центре заменяющей группы граней плюс смещение. + \en If the operation is successful, the hot point is placed in the center of the face, closest to the replacement group faces center. + If the operation fails, the hot point is located in the center of a replacement group faces, plus the offset is taken relative to this center.\~ + \param[out] pnt - \ru Хот-точка. + \en Hot point. \~ + \param[out] dir - \ru Вектор направления смещения хот-точки. + \en Hot point displacement direction vector.\~ + \return \ru Возвращает "true", если хот-точка была рассчитана. + \en Returns "true" if the hot-point is calculated. \~ + */ + bool GetReplaceFacesGroupHotPoint( MbCartPoint3D & pnt, + MbVector3D & dir ) const; + /** \brief \ru Получить константную ссылку на массив вариантов замены граней. \en Get a constant reference to an array of face replacement options. \~ \details \ru Получить константную ссылку на массив вариантов замены граней. diff --git a/C3d/Include/op_duplication_parameter.h b/C3d/Include/op_duplication_parameter.h index 91757c7..4251de2 100644 --- a/C3d/Include/op_duplication_parameter.h +++ b/C3d/Include/op_duplication_parameter.h @@ -516,7 +516,7 @@ public: /// \ru Получить индексы выбранных граней оболочки. \en Get indices of selected shell faces. void GetFacesIndices( c3d::IndicesVector & selIndices ) const { selIndices = _selIndices; } /// \ru Установить индексы выбранных граней оболочки. \en Set indices of selected shell faces. - void SetFacesIndices( c3d::IndicesVector & selIndices ) { _selIndices = selIndices; } + void SetFacesIndices( const c3d::IndicesVector & selIndices ) { _selIndices = selIndices; } /// \ru Режим адаптации открытых оболочек. \en Open shell instances adaptation mode. bool IsAdaptMode() const { return _adaptMode; } /// \ru Режим адаптации открытых оболочек. \en Open shell instances adaptation mode. diff --git a/C3d/Include/op_mesh_parameter.h b/C3d/Include/op_mesh_parameter.h index c1406a3..a19d704 100644 --- a/C3d/Include/op_mesh_parameter.h +++ b/C3d/Include/op_mesh_parameter.h @@ -140,18 +140,18 @@ private: public: /// \ru Конструктор.. \en Constructor. \~ MbConvexHullParams( const c3d::ParamPointsVector & points, double tolerance, bool makeContour, bool makeGrid, bool makeDelaunay ) - : _points ( points ) - , _tolerance ( tolerance ) - , _makeContour ( makeContour ) - , _makeGrid ( makeGrid ) + : _makeGrid ( makeGrid ) , _makeDelaunay( makeDelaunay ) + , _makeContour ( makeContour ) + , _tolerance ( tolerance ) + , _points ( points ) {} /// \ru Конструктор.. \en Constructor. \~ MbConvexHullParams( const std::vector & points, double tolerance, bool makeContour, bool makeGrid, bool makeDelaunay ) - : _tolerance ( tolerance ) - , _makeContour ( makeContour ) - , _makeGrid ( makeGrid ) + : _makeGrid ( makeGrid ) , _makeDelaunay( makeDelaunay ) + , _makeContour ( makeContour ) + , _tolerance ( tolerance ) { _points.clear(); _points.reserve( points.size() ); @@ -160,10 +160,10 @@ public: } /// \ru Конструктор.. \en Constructor. \~ MbConvexHullParams( const SArray & points, double tolerance, bool makeContour, bool makeGrid, bool makeDelaunay ) - : _tolerance ( tolerance ) - , _makeContour ( makeContour ) - , _makeGrid ( makeGrid ) + : _makeGrid ( makeGrid ) , _makeDelaunay( makeDelaunay ) + , _makeContour ( makeContour ) + , _tolerance ( tolerance ) { _points.clear(); _points.reserve( points.size() ); @@ -172,10 +172,10 @@ public: } /// \ru Конструктор.. \en Constructor. \~ MbConvexHullParams( const SArray & points, double tolerance, bool makeContour, bool makeGrid, bool makeDelaunay ) - : _tolerance ( tolerance ) - , _makeContour ( makeContour ) - , _makeGrid ( makeGrid ) + : _makeGrid ( makeGrid ) , _makeDelaunay( makeDelaunay ) + , _makeContour ( makeContour ) + , _tolerance ( tolerance ) { _points.clear(); _points.reserve( points.size() ); @@ -248,8 +248,9 @@ private: public: /// \ru Конструктор.. \en Constructor. \~ MbConvexHullParams3D( const c3d::SpacePointsVector & points, double tolerance ) - : _points ( points ) - , _tolerance( tolerance ) + : _tolerance( tolerance ) + , _points ( points ) + {} /// \ru Конструктор.. \en Constructor. \~ MbConvexHullParams3D( const std::vector & points, double tolerance ) @@ -1362,12 +1363,12 @@ private: , _pointsFittingMax ( 10000 ) , _withRefinement ( false ) , _closed ( false ) - , _order ( c3d::NURBS_DEGREE ) - , _countCpMax ( c3d::NURBS_POINTS_MAX_COUNT ) - , _smoothCoef ( METRIC_ACCURACY ) , _angleConeMin ( 1. ) , _angleConeMax ( 89. ) , _radiusAnalyticShapeMax( 1500. ) + , _order ( c3d::NURBS_DEGREE ) + , _countCpMax ( c3d::NURBS_POINTS_MAX_COUNT ) + , _smoothCoef ( METRIC_ACCURACY ) {} public: @@ -1383,12 +1384,12 @@ public: , _pointsFittingMax ( 10000 ) , _withRefinement ( false ) , _closed ( false ) - , _order ( c3d::NURBS_DEGREE ) - , _countCpMax ( c3d::NURBS_POINTS_MAX_COUNT ) - , _smoothCoef ( METRIC_ACCURACY ) , _angleConeMin ( 1. ) , _angleConeMax ( 89. ) , _radiusAnalyticShapeMax( 1500. ) + , _order ( c3d::NURBS_DEGREE ) + , _countCpMax ( c3d::NURBS_POINTS_MAX_COUNT ) + , _smoothCoef ( METRIC_ACCURACY ) {} /// \ru Конструктор по параметрам. \en Constructor by parameters. explicit MbSurfaceFitToGridParameters( MbeSpaceType surfaceType, @@ -1404,12 +1405,12 @@ public: , _pointsFittingMax ( 10000 ) , _withRefinement ( false ) , _closed ( false ) - , _order ( c3d::NURBS_DEGREE ) - , _countCpMax ( c3d::NURBS_POINTS_MAX_COUNT ) - , _smoothCoef ( METRIC_ACCURACY ) , _angleConeMin ( 1. ) , _angleConeMax ( 89. ) , _radiusAnalyticShapeMax( 1500. ) + , _order ( c3d::NURBS_DEGREE ) + , _countCpMax ( c3d::NURBS_POINTS_MAX_COUNT ) + , _smoothCoef ( METRIC_ACCURACY ) {} /// \ru Конструктор по параметрам для вписывания аналитических поверхностей. \en Constructor by parameters for analytic surfaces fitting. explicit MbSurfaceFitToGridParameters( MbeSpaceType surfaceType, @@ -1428,12 +1429,12 @@ public: , _pointsFittingMax ( 10000 ) , _withRefinement ( false ) , _closed ( false ) - , _order ( c3d::NURBS_DEGREE ) - , _countCpMax ( c3d::NURBS_POINTS_MAX_COUNT ) - , _smoothCoef ( METRIC_ACCURACY ) , _angleConeMin ( angleConeMin ) , _angleConeMax ( angleConeMax ) , _radiusAnalyticShapeMax( radiusAnalyticShapeMax ) + , _order ( c3d::NURBS_DEGREE ) + , _countCpMax ( c3d::NURBS_POINTS_MAX_COUNT ) + , _smoothCoef ( METRIC_ACCURACY ) {} /// \ru Конструктор по параметрам для вписывания нурбс поверхности. \en Constructor by parameters for NURBs surface fitting. explicit MbSurfaceFitToGridParameters( MbeSpaceType surfaceType, @@ -1450,12 +1451,12 @@ public: , _pointsFittingMax ( 10000 ) , _withRefinement ( false ) , _closed ( false ) - , _order ( order ) - , _countCpMax ( countCpMax ) - , _smoothCoef ( smoothCoef ) , _angleConeMin ( 1. ) , _angleConeMax ( 89. ) , _radiusAnalyticShapeMax( 1500. ) + , _order ( order ) + , _countCpMax ( countCpMax ) + , _smoothCoef ( smoothCoef ) {} /// \ru Выдать тип поверхности. \en Get surface type. diff --git a/C3d/Include/op_polymesh_parameter.h b/C3d/Include/op_polymesh_parameter.h index 78c5b8e..69d0e9b 100644 --- a/C3d/Include/op_polymesh_parameter.h +++ b/C3d/Include/op_polymesh_parameter.h @@ -335,7 +335,8 @@ private: std::vector _weft; ///< \ru Полилинии для нулевой нити утка. \en Weft polylines. \~ MbHalfedgeAttrSizetEdge * _pAttrId; ///< \ru Атрибут индексов сторон ячеек. \en An attribute for cell sides indices. \~ MbHalfedgeAttrDoubleEdge * _pAttrAng; ///< \ru Атрибут углов сторон ячеек. \en An attribute for cell sides angles. \~ - MbHalfedgeAttrBoolVertex * _pAttrNode; ///< \ru Атрибут флагов узлов ткани. \en An attribute for the fiber nodes. \~ + MbHalfedgeAttrBoolVertex * _pAttrNode; ///< \ru Атрибут флагов узлов ткани. \en An attribute for fiber nodes flags. \~ + MbHalfedgeAttrSizetEdge * _pAttrDir; ///< \ru Атрибут направлений сторон ячеек ткани. \en An attribute for cell sides directions. \~ public: /// \ru Конструктор. \en Constructor. @@ -420,6 +421,16 @@ public: \en Polylines represented a line mapping to the shell. \~ */ void GetSplitPolylines( const MbCartPoint & uv, const MbVector & dir, std::vector & polys ) const; + /** \brief \ru Получить атрибут направлений сторон ячеек. + \en Get an attribute for cell sides directions. \~ + \details \ru Получить атрибут направлений сторон ячеек. + Возможные значения: + 0 - вдоль основы, 1 - вдоль утка, 2 - против основы, 3 - против утка, SYS_MAX_T - не определено. + \en Get an attribute for cell sides directions. + Possible values are: + 0 - along warp, 1 - along weft, 2 - against warp, 3 - against weft, SYS_MAX_T - undefined. + */ + const MbHalfedgeAttrSizetEdge * GetDirectionalAttribute() const { return _pAttrDir; } // \ru Инициализировать атрибуты сетки. \en Initialize the mesh attributes. \~ void InitAttributes(); diff --git a/C3d/Include/op_shell_parameter.h b/C3d/Include/op_shell_parameter.h index cb7d864..11cd532 100644 --- a/C3d/Include/op_shell_parameter.h +++ b/C3d/Include/op_shell_parameter.h @@ -689,7 +689,7 @@ KNOWN_OBJECTS_RW_REF_OPERATORS( PocketValues ) // \ru Для работы со // --- class MATH_CLASS SlotValues : public HoleValues { public: - // \ru Вид паза сверху. \en View of slot from above. \~ + /* \ru Вид паза сверху. \en View of slot from above. \~ // -- // / \ // | | @@ -698,6 +698,7 @@ public: // | | // \ / // -- + */ enum SlotType { // ________ * // | | * @@ -2834,6 +2835,10 @@ public: const MbFaceShell * GetShell() const { return shell; } /// \ru Номер грани в оболочке. \en The index of face in the shell. const MbItemIndex & GetFaceIndex() const { return faceIndex; } + /// \ru Номер грани в оболочке. \en The index of face in the shell. + void SetFaceIndex( const MbItemIndex & index ) { faceIndex.Init( index ); } + /// \ru Номер грани в оболочке. \en The index of face in the shell. + void SetFaceIndex( size_t index ) { faceIndex.Init( index ); } /// \ru Получить режим обработки оболочки-препятствия. \en Get obstacle shell processing mode. ShellObstacleType GetObstacleType() const { return toShellType; } /// \ru Получить вариант представления результирующего тела. \en Get options for representing the resulting body. @@ -4263,9 +4268,9 @@ public: \en An object for naming the new objects. \~ */ MbShellChamferParams( const c3d::EdgesSPtrVector & initCurves, const SmoothValues & params, const MbSNameMaker & names ) - : _params( params ) + : _initCurves( initCurves ) , _nameMaker( &names.Duplicate() ) - , _initCurves( initCurves ) {} + , _params( params ) {} public: /// \ru Получить именователь операции. \en Get the object defining names generation in the operation. @@ -4436,8 +4441,8 @@ public: MbShellFilletValues( const std::vector & initFunctions, c3d::FacesSPtrVector & initBounds, const MbSNameMaker & names, const SmoothValues & params ) : MbShellChamferParams( c3d::EdgesSPtrVector(), params, names ) - , _initBounds ( initBounds ) - , _initFunctions( initFunctions ) {} + , _initFunctions( initFunctions ) + , _initBounds ( initBounds ) {} public: /// \ru Получить набор скругляемых ребер тела с функциями изменения радиуса. \en Get the edges to fillet together with the radius laws. @@ -5544,8 +5549,8 @@ public: : _initFaces ( initFaces ) , _initFacesLeft ( initFacesLeft ) , _initFacesRight( initFacesRight ) - , _params ( params ) - , _nameMaker ( &names.Duplicate() ) {} + , _nameMaker ( &names.Duplicate() ) + , _params ( params ) {} public: /// \ru Получить набор граней для скругления. \en Get faces to fillet. @@ -6179,15 +6184,15 @@ public: public: /// \ru Конструктор. \en Constructor. MbShellPartResults() - : _solid() - , _partIndices() + : _partIndices() + , _solid() { } /// \ru Конструктор по индексам частей тела. \en Constructor by the indices of the parts of the solid. MbShellPartResults( const MbPartSolidIndices & partIndices ) - : _solid() - , _partIndices( partIndices ) + : _partIndices( partIndices ) + , _solid() { } diff --git a/C3d/Include/op_swept_parameter.h b/C3d/Include/op_swept_parameter.h index 6210131..a3feb08 100644 --- a/C3d/Include/op_swept_parameter.h +++ b/C3d/Include/op_swept_parameter.h @@ -1603,9 +1603,9 @@ protected: protected: /// \ru Конструктор. \en Constructor. - MbSweptLayout( const MbSurface & surf, Direction dir ) : surface( &surf ), direction( dir ), skipUnion( false ) {} + MbSweptLayout( const MbSurface & surf, Direction dir ) : direction( dir ), skipUnion( false ), surface( &surf ) {} /// \ru Конструктор копирования. \en Copy-constructor. - MbSweptLayout( const MbSweptLayout & other ) : surface( other.surface ), direction( other.direction ), skipUnion( other.skipUnion ) {} + MbSweptLayout( const MbSweptLayout & other ) : direction( other.direction ), skipUnion( other.skipUnion ), surface( other.surface ) {} /// \ru Деструктор. \en Destructor. virtual ~MbSweptLayout(); public: diff --git a/C3d/Include/op_wireframe_parameter.h b/C3d/Include/op_wireframe_parameter.h index d8260d2..4aac35d 100644 --- a/C3d/Include/op_wireframe_parameter.h +++ b/C3d/Include/op_wireframe_parameter.h @@ -12,7 +12,7 @@ #include -#include +#include #include @@ -433,4 +433,114 @@ public: }; +//------------------------------------------------------------------------------- +/** \brief \ru Параметры эквидистантного каркаса. + \en Parameters of an offset wire frame. \~ + \details \ru Параметры эквидистантного каркаса. + \en Parameters of an offset wire frame. \~ + \ingroup WireFrame_Parameters +*/ +// --- +class MATH_CLASS MbOffsetWireFrameParams : public MbPrecision { +private: + std::unique_ptr _spatialParameters; ///< \ru Параметры для смещения пространственной кривой. \en Parameters for offsetting a spatial curve. \~ + std::unique_ptr _surfaceParameters; ///< \ru Параметры для смещения кривой вдоль поверхности. \en Parameters for offsetting a curve along a surface. \~ + MbVector3D _offset; ///< \ru Вспомогательный вектор смещения. \en The auxiliary offset vector. + +public: + /** \brief \ru Конструктор по параметрам. + \en Constructor by parameters. \~ + \details \ru Конструктор для смещения пространственной кривой. + \en Constructor for offsetting a spatial curve. \~ + \param[in] offsetVect - \ru Вектор, задающий смещение в точке кривой. + \en The displacement vector at a point of the curve. \~ + \param[in] useFillet - \ru Если true, то разрывы заполнять скруглением, иначе продолженными кривыми. + \en If 'true', the gaps are to be filled with fillet, otherwise with the extended curves. \~ + \param[in] keepRadius - \ru Если true, то в существующих скруглениях сохранять радиусы. + \en If 'true', the existent fillet radii are to be kept. \~ + \param[in] bluntAngle - \ru Если true, то в притуплять острые углы. + \en If 'true', sharp corners are to be blunt. \~ + \param[in] fromBeg - \ru Вектор смещения привязан к началу (если true). + \en The translation vector is associated with the beginning (if true). \~ + \param[in] nameMaker - \ru Именователь кривых каркаса. + \en An object defining the frame curves names. \~ + \param[in] useSurfaceNormal - \ru Эквидистанта согласована с нормалью к поверхности. + \en Offset point is moved according to surface normal. \~ + \param[in] surface - \ru Поверхность кривой или подобная ей. + \en Curve's surface or similar to such surface. \~ + */ + explicit MbOffsetWireFrameParams( const MbVector3D & offsetVect, + bool useFillet, + bool keepRadius, + bool bluntAngle, + bool fromBeg, + const MbSNameMaker & nameMaker, + bool useSurfaceNormal, + c3d::ConstSurfaceSPtr surface = nullptr ); + + /** \brief \ru Конструктор по параметрам. + \en Constructor by parameters. \~ + \details \ru Конструктор для смещения пространственной кривой. + \en Constructor for offsetting a spatial curve. \~ + \param[in] offsetVect - \ru Вектор, задающий смещение в точке кривой. + \en The displacement vector at a point of the curve. \~ + \param[in] nameMaker - \ru Именователь кривых каркаса. + \en An object defining the frame curves names. \~ + */ + explicit MbOffsetWireFrameParams( const MbVector3D & offsetVect, + const MbSNameMaker & nameMaker ); + + /** \brief \ru Конструктор по параметрам. + \en Constructor by parameters. \~ + \details \ru Конструктор для смещения кривой вдоль поверхности. + \en Constructor for offsetting a curve along a surface. \~ + \param[in] face - \ru Грань, на которой строится эквидистанта. + \en The face on which to build the offset curve. \~ + \param[in] axis - \ru Направление смещения с точкой приложения. + \en The offset direction with a reference point. \~ + \param[in] dist - \ru Величина смещения. + \en The offset distance. \~ + \param[in] nameMaker - \ru Именователь кривых каркаса. + \en An object defining the frame curves names. \~ + */ + explicit MbOffsetWireFrameParams( const MbFace & face, const MbAxis3D & axis, double dist, const MbSNameMaker & nameMaker ); + /// \ru Конструктор копирования. \en Copy constructor. + MbOffsetWireFrameParams( const MbOffsetWireFrameParams & other ); + /// \ru Конструктор для чтения. \en Constructor for reading. + MbOffsetWireFrameParams( TapeInit ti ); + /// \ru Деструктор. \en Destructor. + virtual ~MbOffsetWireFrameParams() {} + +public: + /// \ru Получить параметры. \en Get parameters. + const MbSpatialOffsetCurveParams * GetSpatialParams() const { return _spatialParameters.get(); } + /// \ru Получить параметры. \en Get parameters. + const MbSurfaceOffsetCurveParams * GetSurfaceParams() const { return _surfaceParameters.get(); } + /// \ru Выдать вектор смещения. \en Get offset vector. + const MbVector3D & GetOffsetVector() const; + /// \ru Установить вектор смещения. \en Set offset vector. + MbVector3D & SetOffsetVector(); + /// \ru Установить параметры по вектору смещения. \en Set parameters by offset vector. + void SetOffsetParams( const MbVector3D & offset ); + /// \ru Являются ли параметры параметрами для смещением кривой вдоль вектора. \en Are the parameters for a shift of the curve along the vector. + bool IsParamsForSpatialCurve() const; + /// \ru Преобразовать элемент согласно матрице. \en Transform element by matrix. + void Transform( const MbMatrix3D & matrix ); + /// \ru поворот точек вокруг произвольной оси \en rotate points around an arbitrary axis. + void Rotate( const MbAxis3D & axis, double angle ); + /// \ru Сдвиг точек на произвольный вектор \en Move points on arbitrary vector. + void Move( const MbVector3D & to ); + /// \ru Проверка на равенство. \en Check if *this == other. + bool IsEqual( const MbOffsetWireFrameParams & other, double accuracy ) const; + /// \ru Получить именователь операции. \en Get names maker. + const MbSNameMaker & GetNameMaker() const; + + /// \ru Оператор присваивания. \en An assignment operator. + const MbOffsetWireFrameParams & operator=( const MbOffsetWireFrameParams & other ); + + KNOWN_OBJECTS_RW_REF_OPERATORS( MbOffsetWireFrameParams ) // \ru Для работы со ссылками и объектами класса. \en For working with references and objects of the class. \~ + +}; + + #endif // __OP_WIREFRAME_PARAMETERS_H diff --git a/C3d/Include/pars_equation_tree.h b/C3d/Include/pars_equation_tree.h index 7044d08..8c650aa 100644 --- a/C3d/Include/pars_equation_tree.h +++ b/C3d/Include/pars_equation_tree.h @@ -691,7 +691,8 @@ public: \en Object to copy. \~ */ IntervalConstNode( const IntervalConstNode & other ) - : m_firstValue ( other.m_firstValue->Duplicate() ) // ( other.m_firstValue ) + : TreeIntervalNode {} + , m_firstValue ( other.m_firstValue->Duplicate() ) // ( other.m_firstValue ) , m_secondValue( other.m_secondValue->Duplicate() ) // ( other.m_secondValue ) {} /** \brief \ru Деструктор. @@ -1529,7 +1530,8 @@ class MATH_CLASS BTreeUserFunc : public BTreeNode public: // Конструктор копирования BTreeUserFunc( const BTreeUserFunc & other ) - : func( &other.func->Duplicate() ) + : BTreeNode {} + , func( &other.func->Duplicate() ) { for ( size_t i = 0, c = other.pars.size(); i < c; ++i ) { pars.Add( other.pars[i]->Duplicate() ); diff --git a/C3d/Include/polymesh_topo.h b/C3d/Include/polymesh_topo.h index 4f2fb23..a287f3d 100644 --- a/C3d/Include/polymesh_topo.h +++ b/C3d/Include/polymesh_topo.h @@ -367,6 +367,22 @@ public: \en Keep old regions (i.e. do not make separate regions from new subregions). \~ */ virtual void SplitByEdgesTopo( const c3d::IndicesVector & splitSet, bool bKeepRegions ) = 0; + /** \brief \ru Удалить ребра сетки из ребер сегментации. + \en Remove mesh edges from segmentation edges. \~ + \param[in] edgesToDel - \ru Удаляемые ребра сетки. + \en Mesh edges to remove. \~ + */ + virtual void RemoveTopoEdgesFromSegm( const c3d::IndicesVector & edgesToDel ) = 0; + /** \brief \ru Удалить ребра сегментации. + * После удаления ребер общие регионы объединяются и + * сохраняется регион, у которого наибольшая площадь. + \en Segmentation edges to remove. + * Merges all regions connected through removed edges into one. + This region has the ID of the original region with the largest area. \~ + \param[in] edgesToDel - \ru Удаляемые ребра сегментации. + \en Remove segmentation edges. \~ + */ + virtual bool RemoveSegmEdges( const c3d::IndicesVector & edgesToDel ) = 0; /** \brief \ru Объединить несколько регионов в один. \en Merge several regions into one. \~ \param[in] regions - \ru Регионы. diff --git a/C3d/Include/se_curve.h b/C3d/Include/se_curve.h index dbde98c..fd82d0f 100644 --- a/C3d/Include/se_curve.h +++ b/C3d/Include/se_curve.h @@ -46,7 +46,7 @@ namespace c3d //------------------------------------------------------------------------------ /** \brief \ru Форма ограничения кривой STEP. - \en . \~ + \en . Trimming form of STEP curve\~ \note \ru ЭКСПЕРИМЕНТАЛЬНАЯ. \en EXPEREIMENTAL. \~ */ @@ -184,6 +184,8 @@ namespace c3d std::vector m_knotMultiplicities; ///< \ru Множители узлов. \en Knots multiplicities. std::vector m_knots; ///< \ru Узлы. \en Knots. SeBKnotsType m_knotsType; ///< \ru Тип вектора. \en Type of knots vector. + bool m_weightsDefined; ///< \ru Заданы ли веса точек. \en Wether the weights of points are defined. + std::vector m_weights; ///< \ru Веса точек. \en Weights of points. public: @@ -220,7 +222,13 @@ namespace c3d /// \ru Получить тип вектора. \en Get type of vector. SeBKnotsType GetKnotsType() const; - /// \ru . \en . + /// \ru Заданы ли веса. \en Wether the weights defined. + bool AreWeightsDefined() const; + + /// \ru Получить вес точки. \en Get weightf of a point. + double GetWeight( size_t index ); + + /// \ru Создать сплайн. \en Create a spline. static std::shared_ptr Create( size_t const thisId, ptrdiff_t const degree, @@ -233,6 +241,21 @@ namespace c3d SeBKnotsType const knotsType ); + + /// \ru Создать сплайн. \en Create a spline. + static std::shared_ptr Create( + size_t const thisId, + ptrdiff_t const degree, + std::vector && controlPointsList, + SeBCurveForm const curveForm, + bool const isClosed, + bool const isSelfIntersected, + std::vector && knotMultiplicities, + std::vector && knots, + std::vector && weights, + SeBKnotsType const knotsType + ); + VISITING_CLASS( SeBSplineWithKnotsCurve ) void Accept( Visitor & visitor ) const override @@ -255,6 +278,20 @@ namespace c3d std::vector && knots, SeBKnotsType const knotsType ); + + /// \ru Конструктор. \en Constructor. + SeBSplineWithKnotsCurve( + size_t const thisId, + ptrdiff_t const degree, + std::vector && controlPointsList, + SeBCurveForm const curveForm, + bool const isClosed, + bool const isSelfIntersected, + std::vector && knotMultiplicities, + std::vector && knots, + std::vector && weights, + SeBKnotsType const knotsType + ); }; //------------------------------------------------------------------------------ diff --git a/C3d/Include/se_surface.h b/C3d/Include/se_surface.h index e2e8be1..dde336c 100644 --- a/C3d/Include/se_surface.h +++ b/C3d/Include/se_surface.h @@ -13,6 +13,20 @@ namespace c3d { namespace converter { + + //------------------------------------------------------------------------------ + /** \brief \ru Форма тора STEP. + \en STEP Torus form. \~ + \note \ru ЭКСПЕРИМЕНТАЛЬНАЯ. + \en EXPEREIMENTAL. \~ + */ + enum class SeTorusForm { + Donut, ///< \ru Тор. \en Donut. + Apple, ///< \ru Яблоко. \en Apple. + Lemon, ///< \ru Лимон. \en Lemon. + }; + + //------------------------------------------------------------------------------ /** \brief \ru Плоскость. \en Plane. \~ @@ -151,22 +165,27 @@ namespace c3d */ class CONV_CLASS SeTorusSurface : public SeBase { - size_t m_placement; ///< \ru Локальная система координат. \en Location. - double m_majorRadius, ///< \ru . \en . - m_minorRadius; ///< \ru . \en . + size_t m_placement; ///< \ru Локальная система координат. \en Location. + double m_majorRadius, ///< \ru Радиус. \en Radius. + m_minorRadius; ///< \ru Толщина. \en Thickness. + SeTorusForm m_torusForm; ///< \ru Torus form. \en Form. public: - /// \ru . \en . + + /// \ru Создать поверхность тора. \en Create toroidal surace. static std::shared_ptr Create( size_t thisId, size_t placement, double majorRadius, double minorRadius ); /// \ru . \en . size_t GetPlacement() const; - /// \ru . \en . + /// \ru Получить радиус. \en Get radius. double GetMajorRadius() const; - /// \ru . \en . + /// \ru Получить толщину. \en GetThickness. double GetMinorRadius() const; + /// \ru Получить форму. \en Get form. + SeTorusForm GetTorusForm() const; + VISITING_CLASS( SeTorusSurface ) void Accept( Visitor & visitor ) const override @@ -178,7 +197,7 @@ namespace c3d private: /// \ru Конструктор. \en Constructor. - SeTorusSurface( size_t thisId, size_t placement, double majorRadius, double minorRadius ); + SeTorusSurface( size_t thisId, size_t placement, double majorRadius, double minorRadius, SeTorusForm torusForm ); }; diff --git a/C3d/Include/space_item.h b/C3d/Include/space_item.h index 22f358b..3119800 100644 --- a/C3d/Include/space_item.h +++ b/C3d/Include/space_item.h @@ -150,6 +150,7 @@ enum MbeSpaceType { st_ExplorationSurface = 347, ///< \ru Поверхность заметания с масштабированием и поворотом образующей кривой. \en Swept surface with scaling and winding of generating curve. st_SectionSurface = 348, ///< \ru Поверхность заметания переменного сечения. \en The swept mutable section surface. st_SimplexSpline = 349, ///< \ru Поверхность, моделирующая симплексный сплайн. + st_RuledBendedUnbendedSurface=341, ///< \ru Поверхность, полученная линейчатым сгибом/разгибом. \en Surface constructed by ruled fold / unbending. st_FreeSurface = 400, ///< \ru Тип для поверхностей, созданных пользователем. \en Type for the user-defined surfaces. \n // \ru Типы вспомогательных объектов. \en Helper object types. diff --git a/C3d/Include/surf_grid_surface.h b/C3d/Include/surf_grid_surface.h index 1b7fe50..1e1e73c 100644 --- a/C3d/Include/surf_grid_surface.h +++ b/C3d/Include/surf_grid_surface.h @@ -36,13 +36,14 @@ protected : size_t index[_C3D_3_]; ///< \ru Номера вершин треугольника в массиве точек. \en The numbers of vertices in points array. size_t neighbour[_C3D_3_]; ///< \ru Номера соседних треугольников. \en The numbers of neighbour triangles. SYS_MAX_T if it is absent. -// points[index[2]] +/* points[index[2]] // + // / \ // neighbour[2] / \ neighbour[1] // / \ // points[index[0]] +---------------+ points[index[1]] // neighbour[0] +*/ public : MbTrigon() { index[0] = SYS_MAX_T; index[1] = SYS_MAX_T; index[2] = SYS_MAX_T; diff --git a/C3d/Include/templ_multimap.h b/C3d/Include/templ_multimap.h index 852f823..4f16696 100644 --- a/C3d/Include/templ_multimap.h +++ b/C3d/Include/templ_multimap.h @@ -266,7 +266,7 @@ size_t MultiMap::LowerBoundEx( const SArray= 0 && key <= pairs[firstNotLess].m_key ) + if ( firstNotLess <= last && key <= pairs[firstNotLess].m_key ) return firstNotLess; if ( key == pairs[last].m_key ) return last; @@ -330,7 +330,7 @@ size_t MultiMap::UpperBoundEx( const SArray= 0 && key < pairs[firstGreater].m_key ) + if ( firstGreater <= end && key < pairs[firstGreater].m_key ) return firstGreater; if ( key < pairs[last].m_key ) return last; diff --git a/C3d/Include/tool_err_handling.h b/C3d/Include/tool_err_handling.h index 96c30f9..e674329 100644 --- a/C3d/Include/tool_err_handling.h +++ b/C3d/Include/tool_err_handling.h @@ -107,31 +107,44 @@ public: */ static MbResultType SetError( MbResultType ); + /** \brief \ru Достаточно ли памяти для работы. \en Whether is enough memory to work. + \param[in] memRatio - \ru Максимальный процент использования памяти (при memRatio == -1 используются значения по умолчанию). + \en The maximum percentage of memory usage (with memRatio == -1, the default values are used). \~ + */ + static bool IsEnoughMemory( double memRatio = -1 ); + + /** \brief \ru Сбросить все данные. + \en Reset all data. + */ + static void Reset(); + + ///> \ru Следующие методы будут удалены. \en The next methods will be removed. + /** \brief \ru Инициализировать обработчик перед началом мониторинга ошибок. Возвращает true, если обработчик стартовал, или false, если обработчик уже работает. Парная функция Recover() должна вызываться, только если Init() вернул true. \en Initialize handler before starting error monitoring. Returns true if the handler is started or false if the handler is already working. - The paired function Recover() should be called only if Init() returnes true. + The paired function Recover() should be called only if Init() returns true. */ - static bool Init(); + DEPRECATE_DECLARE static bool Init(); /** \brief \ru Восстановиться, если обнаружена фатальная ошибка. \en Recover if a fatal error is detected. */ - static void Recover(); + DEPRECATE_DECLARE static void Recover(); - /** \brief \ru Достаточно ли памяти для работы. \en Whether is enough memory to work. + /** \brief \ru Коэффициент использования памяти [0.0, 1.0]. \en Memory use coefficient [0.0, 1.0]. */ - static bool IsEnoughMemory(); + DEPRECATE_DECLARE static double MemoryUseRatio(); /** \brief \ru Установить допустимый порог памяти для работы (Mb). \en Set an acceptable memory threshold for work (Mb). */ - static void SetMemoryThreshold( double ); + DEPRECATE_DECLARE static void SetMemoryThreshold( double memThreshold ); /** \brief \ru Установить порог памяти по умолчанию. \en Set default memory threshold. */ - static void ResetMemoryThreshold(); + DEPRECATE_DECLARE static void ResetMemoryThreshold(); }; #endif // __TOOL_ERR_HANDLING_H diff --git a/C3d/Include/topology.h b/C3d/Include/topology.h index 1891be1..76d7592 100644 --- a/C3d/Include/topology.h +++ b/C3d/Include/topology.h @@ -962,8 +962,8 @@ public : /// \ru Получить параметры разрезки для периодического ребра. \en Get the cutting parameters for a periodic edge. bool CutPeriodicEdge( const MbVector3D & eye, SSArray & trimParams, double & delT1, double & delT2 ) const; - /// \ru Согласовать тип кроивой пересечения. \en Agree on the type of intersection curve. - void AgreeBuildType( double tCurve ); + /// \ru Согласовать тип кривой пересечения. \en Agree on the type of intersection curve. + DEPRECATE_DECLARE void AgreeBuildType( double tCurve ); // \ru Объявление оператора присваивания без реализации, чтобы не было присваивания по умолчанию. \en The declaration of the assignment operator without implementation to prevent an assignment by default. OBVIOUS_PRIVATE_COPY( MbCurveEdge ) @@ -1504,7 +1504,7 @@ public: { MbFaceTemp * _temporal; ///< \ru Объект сопровождения грани (для скорости вычислений). \en An object for maintenance of a face (to improve calculations speed). MbFaceAuxiliaryData() : AuxiliaryData(), _temporal( nullptr ) {} - MbFaceAuxiliaryData( const MbFaceAuxiliaryData & ) : _temporal( nullptr ) {} + MbFaceAuxiliaryData( const MbFaceAuxiliaryData & ) : AuxiliaryData {}, _temporal( nullptr ) {} virtual ~MbFaceAuxiliaryData(); }; @@ -1526,9 +1526,9 @@ public: template MbFace( const Loops & bnds, const MbSurface & surf, bool sense ) : MbTopologyItem() - , loops ( bnds.size(), 1 ) , surface ( const_cast(&surf) ) , sameSense ( sense ) // признак совпадения нормали + , loops ( bnds.size(), 1 ) , cache ( nullptr ) { surface->AddRef(); diff --git a/C3d/Lib/x32/Debug/c3d.lib b/C3d/Lib/x32/Debug/c3d.lib index 665b6ad..cc6be65 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 920b71d..681bfcf 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 e45809b..812447b 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 b0904e2..fdbccbe 100644 Binary files a/C3d/Lib/x64/Release/c3d.lib and b/C3d/Lib/x64/Release/c3d.lib differ