- C3d aggiornamento librerie ( 118044).
This commit is contained in:
SaraP
2025-08-28 14:47:28 +02:00
parent daccdfc398
commit f05795ffff
53 changed files with 1756 additions and 520 deletions
+5 -3
View File
@@ -711,8 +711,9 @@ MATH_FUNC( bool ) InspectMeshClosure( const MbMesh & mesh, MeshInfo & info );
\en Vector of simplified triangulations. \~
\ingroup Polygonal_Objects
*/ // ---
MATH_FUNC( MbResultType ) SimplifyTriangularMesh( const MbMesh & mesh, const MbMeshSimplificationParams & params,
c3d::MeshesSPtrVector & simplifiedMeshes );
MATH_FUNC( MbResultType ) SimplifyTriangularMesh( const MbMesh & mesh,
const MbMeshSimplificationParams & params,
c3d::MeshesSPtrVector & simplifiedMeshes );
//------------------------------------------------------------------------------
@@ -727,7 +728,8 @@ MATH_FUNC( MbResultType ) SimplifyTriangularMesh( const MbMesh & mesh, const MbM
\ingroup Polygonal_Objects
*/ // ---
MATH_FUNC( MbResultType ) SimplifyTriangularMesh( const MbMeshSimplificationParams & params, MbMesh & mesh );
MATH_FUNC( MbResultType ) SimplifyTriangularMesh( const MbMeshSimplificationParams & params,
MbMesh & mesh );
//------------------------------------------------------------------------------
+99 -1
View File
@@ -34,6 +34,11 @@ class MbPolylinePolymeshProjectResults;
class MbFillClosedCurveParams;
class MbFillPolymeshHoleParams;
class MbPolymeshNormalsParams;
class MbCurvePolymeshProjectParams;
class MbPolymeshProjectResults;
class MbPathPolymeshOffsetParams;
class MbPolymeshBooleanParams;
class MbPolymeshBooleanResults;
//------------------------------------------------------------------------------
@@ -70,6 +75,7 @@ MATH_FUNC( MbResultType ) CreatePolymeshByShell( const MbShellLinearizationParam
\en Facet array. \~
\param[out] groups - \ru Связные группы фасетов.
\en Groups of connected facets. \~
\ingroup Polygonal_Objects
\warning \ru В разработке.
\en Under development. \~
*/ // ---
@@ -87,6 +93,7 @@ MATH_FUNC( void ) GetConnectedFacetGroups( const MbPolymesh &
\en Region array. \~
\param[out] groups - \ru Связные группы регионов.
\en Groups of connected regions. \~
\ingroup Polygonal_Objects
\warning \ru В разработке.
\en Under development. \~
*/ // ---
@@ -104,6 +111,7 @@ MATH_FUNC( void ) GetConnectedRegionGroups( const MbPolymesh &
\en Boundary criterion. \~
\param[out] facets - \ru Группы фасетов, разделенные по регионам.
\en Groups of facets divided into regions. \~
\ingroup Polygonal_Objects
\warning \ru В разработке.
\en Under development. \~
*/ // ---
@@ -123,6 +131,7 @@ MATH_FUNC( void ) GetPolymeshRegions( const MbPolymesh & me
\en A seed facet. \~
\param[out] facets - \ru Все фасеты региона.
\en All the facets of a region. \~
\ingroup Polygonal_Objects
\warning \ru В разработке.
\en Under development. \~
*/ // ---
@@ -141,6 +150,7 @@ MATH_FUNC( void ) GetPolymeshRegion( const MbPolymesh & mes
\en Facet array which forms a region. \~
\param[out] boundaries - \ru Границы региона (набор граничных ребер).
\en Boundary edges of a region. \~
\ingroup Polygonal_Objects
\warning \ru В разработке.
\en Under development. \~
*/ // ---
@@ -156,6 +166,7 @@ MATH_FUNC( void ) GetPolymeshRegionBoundaries( const MbPolymesh &
\en A polygonal object with topology. \~
\param[out] boundaries - \ru Открытые границы (наборы граничных ребер).
\en Arrays of open boundary edges. \~
\ingroup Polygonal_Objects
\warning \ru В разработке.
\en Under development. \~
*/ // ---
@@ -169,6 +180,7 @@ MATH_FUNC( void ) GetPolymeshOpenBoundaries( const MbPolymesh & mesh, std::vecto
\en A polygonal object with topology. \~
\param[out] boundaries - \ru Открытые границы (наборы граничных ребер сегментации).
\en Arrays of open boundary edges of a segmentation. \~
\ingroup Polygonal_Objects
\warning \ru В разработке.
\en Under development. \~
*/ // ---
@@ -192,6 +204,7 @@ MATH_FUNC( void ) GetPolymeshLoopPolyline( const MbPolymesh & mesh, size_t iLoop
\en A cutting plane. \~
\param[out] polylines - \ru Построенные ломаные контура сечения объекта.
\en The resultant contours. \~
\ingroup Polygonal_Objects
\warning \ru В разработке.
\en Under development. \~
*/ // ---
@@ -209,6 +222,7 @@ MATH_FUNC( MbResultType ) PolymeshSection( const MbPolymesh & me
\en Should cut facets be triangulated. \~
\param[in,out] mesh - \ru Полигональный объект с топологией.
\en A polygonal object with topology. \~
\ingroup Polygonal_Objects
\warning \ru В разработке.
\en Under development. \~
*/ // ---
@@ -226,6 +240,7 @@ MATH_FUNC( bool ) CutPolymeshByPlane( const MbPlacement3D & place,
\en A polygonal object with topology. \~
\param[in,out] meshSub - \ru Полигональный объект, в который производится копирование.
\en A polygonal object in which data should be copied to. \~
\ingroup Polygonal_Objects
\warning \ru В разработке.
\en Under development.\~
*/ // ---
@@ -239,6 +254,7 @@ MATH_FUNC( void ) CopyPolymeshPart( const MbPolymesh & mesh, const c3d::IndicesV
\en Polygonal object. \~
\return \ru True если полигональный объект является триангуляцией, иначе false.
\en True if polymesh is triangulation, otherwise false. \~
\ingroup Polygonal_Objects
*/ // ---
MATH_FUNC( bool ) IsPolymeshTriangulation( const MbPolymesh & mesh );
@@ -324,6 +340,7 @@ MATH_FUNC( MbResultType ) DrapeShell( const MbDrapeShellParams & params, MbDrape
\en A polygonal object, accumulating merged objects. \~
\return \ru Код результата операции, rt_Success, если объекты успешно объединены.
\en Returns the operation result code, rt_Success if the objects are successfully merged. \n
\ingroup Polygonal_Objects
\warning \ru В разработке.
\en Under development.\~
*/ // ---
@@ -339,6 +356,7 @@ MATH_FUNC( MbResultType ) MergePolymeshes( const MbPolymesh & meshFrom, const Mb
\en A polygonal object. \~
\return \ru Код результата операции, rt_Success если объект успешно сглажен.
\en Returns the operation result code, rt_Success if the object is successfully smoothed. \n
\ingroup Polygonal_Objects
\warning \ru В разработке.
\en Under development.\~
*/ // ---
@@ -361,6 +379,7 @@ MATH_FUNC( MbResultType ) SmoothPolymesh( const MbMeshSmoothingParams & params,
\en Result of projecting a polyline on a polymesh. \~
\return \ru Код результата операции, rt_Success, если проекция успешно построена.
\en Returns the operation result code, rt_Success if a polyline is successfully projected. \n
\ingroup Polygonal_Objects
\warning \ru В разработке.
\en Under development.\~
*/ // ---
@@ -378,6 +397,7 @@ MATH_FUNC( MbResultType ) ProjectPolylineOnPolymesh( MbPolymesh & mesh, const Mb
\en A patch. \~
\return \ru Код результата операции.
\en Returns the operation result code. \~
\ingroup Polygonal_Objects
\warning \ru В разработке.
\en Under development. \~
*/ // ---
@@ -392,13 +412,14 @@ MATH_FUNC( MbResultType ) FillClosedCurve( const MbFillClosedCurveParams & param
Впоследствии их можно удалить вручную функцией DeleteInactive.
\en Fill a polygonal object hole.
Some inactive elements can appear during the operation.
They should be explicitly removed by the DeleteInactive function afterwards. \~
They can be explicitly removed by the DeleteInactive function afterwards. \~
\param[in] params - \ru Параметры заполнения.
\en Filling parameters. \~
\param[in-out] mesh - \ru Полигональный объект.
\en A polygonal object. \~
\return \ru Код результата операции.
\en Returns the operation result code. \~
\ingroup Polygonal_Objects
\warning \ru В разработке.
\en Under development. \~
*/ // ---
@@ -420,9 +441,86 @@ MATH_FUNC( MbResultType ) FillPolymeshHole( const MbFillPolymeshHoleParams & par
\en A polygonal object. \~
\return \ru Код результата операции.
\en Returns the operation result code. \~
\ingroup Polygonal_Objects
\warning \ru В разработке.
\en Under development. \~
*/ // ---
MATH_FUNC( MbResultType ) CalculatePolymeshNormals( const MbPolymeshNormalsParams & params, MbPolymesh & mesh );
//------------------------------------------------------------------------------
/** \brief \ru Обрезать полигональный объект набором кривых.
\en Cut a polygonal object by a set of curves. \~
\details \ru Обрезать полигональный объект набором кривых.
В результате операции в полигональном объекте могут появиться неактивные элементы.
Впоследствии их можно удалить вручную функцией DeleteInactive.
\en Cut a polygonal object by a set of curves.
Some inactive elements can appear during the operation.
They can be explicitly removed by the DeleteInactive function afterwards. \~
\param[in] params - \ru Параметры обрезки полигонального объекта набором кривых.
\en Parameters for cutting a polymesh with a set of curves. \~
\param[out] results - \ru Результаты обрезки полигонального объекта набором кривых.
\en Results of cutting a polymesh with a set of curves. \~
\param[in-out] mesh - \ru Полигональный объект.
\en A polygonal object being projected on. \~
\return \ru Код результата операции, rt_Success в случае успеха операции.
\en Returns the operation result code, rt_Success if an operation is successful. \n
\ingroup Polygonal_Objects
\warning \ru В разработке.
\en Under development.\~
*/ // ---
MATH_FUNC( MbResultType ) CutPolymeshByCurves( const MbCurvePolymeshProjectParams & params, MbPolymeshProjectResults & results, MbPolymesh & mesh );
//------------------------------------------------------------------------------
/** \brief \ru Выполнить эквидистантное смещение цепочек ребер по поверхности полигонального объекта.
\en Offset polymesh edge paths. \~
\details \ru Выполнить эквидистантное смещение цепочек ребер по поверхности полигонального объекта.
В результате операции в полигональном объекте могут появиться неактивные элементы.
Впоследствии их можно удалить вручную функцией DeleteInactive.
\en Offset polymesh edge paths.
Some inactive elements can appear during the operation.
They can be explicitly removed by the DeleteInactive function afterwards. \~
\param[in] params - \ru Параметры оффсета цепочки ребер полигонального объекта.
\en Parameters for polymesh edge paths offsetting. \~
\param[out] results - \ru Результаты оффсета цепочки ребер полигонального объекта
\en Results of polymesh edge paths offsetting. \~
\param[in-out] mesh - \ru Полигональный объект.
\en A polygonal object. \~
\return \ru Код результата операции, rt_Success в случае успеха операции.
\en Returns the operation result code, rt_Success if an operation is successful. \n
\ingroup Polygonal_Objects
\warning \ru В разработке.
\en Under development.\~
*/ // ---
MATH_FUNC( MbResultType ) OffsetPolymeshPath( const MbPathPolymeshOffsetParams & params, MbPolymeshProjectResults & results, MbPolymesh & mesh );
//------------------------------------------------------------------------------
/** \brief \ru Булева операция на двух полигональных объектах.
\en Boolean operation for two polygonal objects. \~
\details \ru Булева операция на двух полигональных объектах.
Поддерживаются сетки, содержащие только треугольные фасеты.
Первый полигональный объект будет содержать сетку - результат операции.
Второй полигональный объект будет невалиден после операции.
\en Boolean operation for two polygonal objects. \~
Supports meshes with triangular facets only.
The first polygonal object will contain the polymesh with boolean operation result.
The second polygonal object will be invalid after operation.
\param[in] params - \ru Параметры операции.
\en The parameters. \~
\param[out] results - \ru Результаты операции.
\en The results. \~
\param[in-out] mesh0 - \ru Первый полигональный объект.
\en The first polygonal object. \~
\param[in-out] mesh1 - \ru Второй полигональный объект.
\en The second polygonal object. \~
\return \ru Возвращает код результата операции.
\en Returns operation result code. \~
\warning \ru В разработке.
\en Under development.\~
\ingroup Polygonal_Objects
*/ // ---
MATH_FUNC( MbResultType ) PolymeshBoolean( const MbPolymeshBooleanParams & params, MbPolymeshBooleanResults & results, MbPolymesh & mesh0, MbPolymesh & mesh1 );
#endif // __ACTION_POLYMESH_H
+64
View File
@@ -0,0 +1,64 @@
////////////////////////////////////////////////////////////////////////////////
/**
\file
\brief \ru Классы для операций с полигональными геометрическими объектами с топологией.
\en Classes for operations with polygonal geometric objects with topology. \~
*/
////////////////////////////////////////////////////////////////////////////////
#ifndef __ACTION_POLYMESH_OPERATIONS_H
#define __ACTION_POLYMESH_OPERATIONS_H
#include <math_define.h>
#include <mb_operation_result.h>
class MbPolymesh;
class MbSegmentationParams;
class MbRepairSegmentationParams;
//------------------------------------------------------------------------------
/** \brief \ru Абстрактный класс для сегментации полигональных объектов.
\en An abstract class for segmenting polygonal objects. \~
\details \ru Абстрактный класс для сегментации полигональных объектов.
\en An abstract class for segmenting polygonal objects. \~
\warning \ru В разработке.
\en Under development. \~
*/
// ---
class MATH_CLASS MbMeshSegmenter
{
protected:
/// \ru Конструктор. \en Constructor.
MbMeshSegmenter() = default;
public:
/// \ru Деструктор. \en Destructor.
virtual ~MbMeshSegmenter() = default;
/** \brief \ru Создать экземпляр класса на основе MbPolymesh.
\en Create an object by MbPolymesh. \~
\param[in] mesh - \ru Полигональный геометрический объект.
\en A polygonal geometric object. \~
\return \ru Возвращает указатель на созданный объект.
\en Returns the pointer to a created object. \~
*/
static MbMeshSegmenter * Create( MbPolymesh & mesh );
/** \brief \ru Сегментировать полигональный объект.
\en Segment the polygonal object. \~
\param[in] params - \ru Параметры сегментации.
\en Segmentation parameters. \~
\return \ru Код результата операции.
\en Returns the operation result code. \~
*/
virtual MbResultType Segment( const MbSegmentationParams & params ) = 0;
/** \brief \ru Починить сегментацию полигонального объекта.
\en Repair the segmentation of the polygonal object. \~
\param[in] params - \ru Параметры лечения сегментации.
\en Parameters for repairing the segmentation. \~
*/
virtual void RepairSegmentation( const MbRepairSegmentationParams & params ) = 0;
};
#endif // __ACTION_POLYMESH_OPERATIONS_H
+68 -24
View File
@@ -26,26 +26,21 @@
#define __ACTION_SHELL_H
#include <templ_rp_array.h>
#include <templ_s_array.h>
#include <mb_cart_point3d.h>
#include <space_item.h>
#include <op_boolean_flags.h>
#include <op_shell_parameter.h>
#include <op_swept_parameter.h>
#include <topology_faceset.h>
#include <mb_operation_result.h>
class MbCurve;
class MbCurve3D;
class MbSurface;
class MbCurveEdge;
class MbFace;
class MbSolid;
class MbSNameMaker;
class MbPatchCurve;
class IProgressIndicator;
class MbCurve;
class MbCurve3D;
class MbSurface;
class MbCurveEdge;
class MbFace;
class MbSolid;
class MbSNameMaker;
class MbPatchCurve;
class IProgressIndicator;
//------------------------------------------------------------------------------
@@ -168,6 +163,8 @@ MATH_FUNC (MbResultType) NurbsSurfacesShell( MbNurbsSurfacesShellParams & params
\en Create a solid from a set of curves. \~
\details \ru Построить тело по сети кривых, заданных в параметрах построения. \n
\en Create a solid from a set of curves specified in the parameters. \n \~
\deprecated \ru Функция устарела, взамен использовать функцию со структурой результата построения.
\en The constructor is deprecated. Instead, use a function MeshShell with a structure MbMeshShellResults. \~
\param[in] params - \ru Параметры операции.
\en The operation parameters. \~
\param[out] result - \ru Результирующая оболочка.
@@ -177,9 +174,27 @@ MATH_FUNC (MbResultType) NurbsSurfacesShell( MbNurbsSurfacesShellParams & params
\ingroup Shell_Modeling
*/
// ---
DEPRECATE_DECLARE_REPLACE ( MeshShell with a structure MbMeshShellResults )
MATH_FUNC (MbResultType) MeshShell( const MbMeshShellParameters & params,
c3d::SolidSPtr & result );
//------------------------------------------------------------------------------
/** \brief \ru Построить тело по сети кривых.
\en Create a solid from a set of curves. \~
\details \ru Построить тело по сети кривых, заданных в параметрах построения. \n
\en Create a solid from a set of curves specified in the parameters. \n \~
\param[in] params - \ru Параметры операции.
\en The operation parameters. \~
\param[out] result - \ru Результаты построения.
\en Operation results. \~
\return \ru Возвращает код результата операции.
\en Returns operation result code. \~
\ingroup Shell_Modeling
*/
// ---
MATH_FUNC (MbResultType) MeshShell( const MbMeshShellParameters & params,
MbMeshShellResults & result );
//------------------------------------------------------------------------------
/** \brief \ru Усечь (обрезать) незамкнутое тело.
@@ -194,8 +209,8 @@ MATH_FUNC (MbResultType) MeshShell( const MbMeshShellParameters & params,
\en Whether to copy the initial shells. \~
\param[in] operNames - \ru Именователь.
\en An object for naming the new objects. \~
\param[in] truncatingItems - \ru Усекающие объекты.
\en Truncating objects. \~
\param[in] truncatingItems - \ru Усекающие объекты ( кривые, поверхности или тела ).
\en Truncating objects ( curves, surfaces or solids ). \~
\param[in] truncatingOrients - \ru Ориентация усекающих объектов.
\en The truncating objects orientation. \~
\param[in] truncatingSplitMode - \ru Кривые используются как линии разъема.
@@ -213,6 +228,7 @@ MATH_FUNC (MbResultType) MeshShell( const MbMeshShellParameters & params,
\ingroup Shell_Modeling
*/
// ---
DEPRECATE_DECLARE_REPLACE ( TruncateShell with MbTruncateShellParams )
MATH_FUNC (MbResultType) TruncateShell( MbSolid & initSolid,
SArray<size_t> & selIndices,
MbeCopyMode initCopyMode,
@@ -226,6 +242,33 @@ MATH_FUNC (MbResultType) TruncateShell( MbSolid & initSolid,
MbPlacement3D *& resultPlace );
//------------------------------------------------------------------------------
/** \brief \ru Усечь (обрезать) незамкнутое тело.
\en Truncate an open solid. \~
\details \ru Выполнить построение незамкнутого тела путём усечения исходного тела. \n
\en Create an open solid by truncation the initial solid. \n \~
\param[in] initSolid - \ru Исходная оболочка.
\en The initial shell. \~
\param[in] copyMode - \ru Режим копирования исходной оболочки.
\en Whether to copy the initial shells. \~
\param[in] params - \ru Параметры операции.
\en The operation parameters. \~
\param[out] results - \ru Результаты операции.
\en The operation results. \~
\return \ru Возвращает код результата операции.
\en Returns operation result code. \~
\ingroup Shell_Modeling
\warning \ru В разработке.
\en Under development. \~
*/
// ---
MATH_FUNC( MbResultType ) TruncateShell( MbSolid & initSolid,
MbeCopyMode copyMode,
const MbTruncateShellParams & params,
MbTruncateShellResults & results );
//------------------------------------------------------------------------------
/** \brief \ru Построить продолжение незамкнутого тела выдавливанием.
\en Create an extension of an open solid by extrusion. \~
@@ -431,10 +474,10 @@ MATH_FUNC (bool) CheckJoinedParams( const MbCurve3D & curve,
\en Create a curve from a set of edges. \~
\details \ru Создать кривую для поверхности соединения по списку ребер. \n
\en Create a curve for a surface of the joint from a list of edges. \n \~
\param[in] edges - \ru Набор ребер.
\en A set of edges. \~
\param[in] orients - \ru Ориентации ребер.
\en Edges senses. \~
\param[in] edges - \ru Набор ребер (контейнер константных указателей на ребра).
\en A set of edges (container of constant pointers to edges). \~
\param[in] orients - \ru Ориентации ребер (контейнер булевых флагов).
\en Edges senses (boolean flags container). \~
\param[in] matr - \ru Матрица преобразования ребер.
\en Edges transformation matrix. \~
\param[out] res - \ru Результат операции.
@@ -448,10 +491,11 @@ MATH_FUNC (bool) CheckJoinedParams( const MbCurve3D & curve,
\ingroup Curve3D_Modeling
*/
//---
MATH_FUNC (MbCurve3D *) CreateJoinedCurve( const RPArray<MbCurveEdge> & edges,
const SArray<bool> & orients,
const MbMatrix3D & matr,
MbResultType & res );
template <typename ConstEdgeVector, typename OrientsVector>
MATH_FUNC (MbCurve3D *) CreateJoinedCurve( const ConstEdgeVector & edges,
const OrientsVector & orients,
const MbMatrix3D & matr,
MbResultType & res );
//------------------------------------------------------------------------------
+4 -1
View File
@@ -22,7 +22,6 @@
#include <mb_vector3d.h>
#include <space_item.h>
#include <wire_frame.h>
#include <mb_nurbs_function.h>
#include <mb_point_mating.h>
#include <mb_operation_result.h>
#include <op_curve_parameter.h>
@@ -175,6 +174,7 @@ MATH_FUNC (MbResultType) OffsetCurve( const MbCurve3D & curve,
\ingroup Curve3D_Modeling
*/
// ---
//DEPRECATE_DECLARE_REPLACE ( ProjectionWireFrame with MbProjectionWireFrameParams and MbProjectionWireFrameResults )
MATH_FUNC (MbResultType) CurveProjection( const MbSurface & surface,
const MbCurve3D & curve,
MbVector3D * direction,
@@ -208,6 +208,7 @@ MATH_FUNC (MbResultType) CurveProjection( const MbSurface & surface,
\ingroup Curve3D_Modeling
*/
// ---
//DEPRECATE_DECLARE_REPLACE ( ProjectionWireFrame with MbProjectionWireFrameParams and MbProjectionWireFrameResults )
MATH_FUNC (MbResultType) CurveProjection( const MbSurface & surface,
const MbCurve3D & curve,
MbVector3D * direction,
@@ -275,6 +276,7 @@ MATH_FUNC (MbResultType) CurveByTwoProjections( const MbPlacement3D & place
\ingroup Curve3D_Modeling
*/
//---
//DEPRECATE_DECLARE_REPLACE ( ProjectionWireFrame with MbProjectionWireFrameParams and MbProjectionWireFrameResults )
MATH_FUNC (MbResultType) ProjectionCurve( const MbCurve3D & curve,
const RPArray<MbFace> & faces,
const MbVector3D * dir,
@@ -319,6 +321,7 @@ MATH_FUNC (MbResultType) ProjectionCurve( const MbCurve3D & curve,
\ingroup Curve3D_Modeling
*/
//---
//DEPRECATE_DECLARE_REPLACE ( ProjectionWireFrame with MbProjectionWireFrameParams and MbProjectionWireFrameResults )
MATH_FUNC (MbResultType) ProjectionCurve( const MbWireFrame & wireFrame,
const bool sameWireFrame,
const MbSolid & solid,
+23 -1
View File
@@ -20,7 +20,8 @@ class MbTrimmedWireFrameParams;
class MbWireFrameProjParams;
class MbWireFrameProjResult;
class MbOffsetWireFrameParams;
class MbProjectionWireFrameParams;
class MbProjectionWireFrameResults;
//------------------------------------------------------------------------------
/** \brief \ru Создать скругленный каркас.
@@ -226,4 +227,25 @@ MATH_FUNC( MbResultType ) CreateOffsetWireFrame( c3d::WireFrameSPtr &
const MbOffsetWireFrameParams & params,
c3d::WireFrameSPtr & result );
//------------------------------------------------------------------------------
/** \brief \ru Операция построения проекционного проволочного каркаса.
\en Create a projection wireframe. \~
\details \ru Операция построения проекции набора кривых по нормали или по
направлению на тело, набор граней или поверхность. \n
\en Create a normal or vector projection of a set of curves to
a solid, set of faces or a surface. \n \~
\param[in] params - \ru Параметры операции.
\en Operation parameters. \~
\param[out] results - \ru Результаты операции.
\en Operation results. \~
\return \ru Возвращает код результата операции.
\en Returns operation result code. \~
\ingroup WireFrame_Modeling
\warning \ru В разработке.
\en Under development. \~
*/
// ---
MATH_FUNC (MbResultType) ProjectionWireFrame( const MbProjectionWireFrameParams & params,
MbProjectionWireFrameResults & results );
#endif // __ACTION_WIREFRAME_H
+16 -3
View File
@@ -1069,6 +1069,19 @@ MATH_FUNC (bool) RemoveEdgeSmoothnessAttributes( MbFaceShell & shell );
*/ //---
MATH_FUNC (const MbDoubleRangeAttribute *) GetEdgeSmoothnessAttribute( const MbCurveEdge & edge );
//------------------------------------------------------------------------------
/** \brief \ru Обновить атрибут гладкости ребра.
\en Update edge smoothness attribute. \~
\details \ru Обновить атрибут гладкости ребра.
\en Update edge smoothness attribute. \~
\param[in] edge - \ru Ребро, которое проверяем.
\en Edge to check. \~
\return \ru Возвращает true, если атрибут есть в ребре и обновлен.
\en Returns true if this attribute is present in the edge and is updated.\~
\ingroup Algorithms_3D
*/ //---
MATH_FUNC( bool ) UpdateEdgeSmoothnessAttribute( MbCurveEdge & edge );
//------------------------------------------------------------------------------
/** \brief \ru Проверить, вырожденная ли поверхность.
@@ -1108,9 +1121,9 @@ class MATH_CLASS MbSurfaceSelfIntParams {
public:
/// \ru Метод проверки самопересечений. \en Method of self intersection checking.
enum class MbeCheckSelfIntMethod {
csim_Auto , /// \ru Автоматический режим. \en Auto mode.
csim_UVLine , /// \ru Вдоль uv линий. \en Along uv lines.
csim_SegmIntersect /// \ru Сегментированное пересечение. \en Segmented intersection.
csim_Auto , ///< \ru Автоматический режим. \en Auto mode.
csim_UVLine , ///< \ru Вдоль uv линий. \en Along uv lines.
csim_SegmIntersect ///< \ru Сегментированное пересечение. \en Segmented intersection.
};
private:
+2 -5
View File
@@ -290,7 +290,8 @@ enum eMsgDetail {
emd_PluginGeneralProblem, ///< \ru Сбой общего характера в плагине. \en General plugin fault.
emd_PluginLicenceProblem, ///< \ru Ошибка активации плагина. \en Plugin couldn't be activated.
emd_PluginFunctionalityLimitation ///< \ru Плагин не обладает требуемой функциональностью. \en Plugin' funtionality doesn't cover the required case.
emd_PluginFunctionalityLimitation, ///< \ru Плагин не обладает требуемой функциональностью. \en Plugin' funtionality doesn't cover the required case.
emd_PluginImportPartialSuccess /// \ru Модель частично импортирована через плагин. \en Model was partially imported via the plugin.
};
@@ -587,10 +588,6 @@ public:
bool addRemovedFacesAsShells; ///< \ru Добавлять ли удаленные грани в качестве отдельных оболочек. \en Whether to add removed faces as shells.
double lengthUnitsFactor; ///< \ru Единицы длины модели. \en Length units of the model.
double appUnitsFactor; ///< \ru Единицы длины модели пользовательского приложения. \en Length units of the model used in user application.
//DEPRECATE_DECLARE
bool attatchIdAttributes; ///< \ru Следует ли формировать атрибут на основе идентификатора элемнта в файле. \en Whether to attatch the element's id in file as attribute.
//DEPRECATE_DECLARE
bool auditEnabled;
bool importMeshesWithTopology; ///< \ru Сохранять сетки в MbMesh (false) или в MbPolymesh (true). \en Save meshes to MbMesh (false) or to MbPolymesh (true).
bool repairInconsistentMesh; /// \ru Лечить ли неправильные сетки. \en Whether to repair inconsistent meshes.
MbRepairInconsistentMeshParams repairInconsistentMeshParams; /// \ru Параметры для лечения неправильных сеток. \en Parameters for repairing inconsistent meshes.
-308
View File
@@ -958,314 +958,6 @@ inline IConverter3D* GetConvertor3D() { return GetConverter3D(); }
inline void ReleaseConvertor3D( IConverter3D* convInstance ) { ReleaseConverter3D( convInstance ); }
/** \brief \ru Прочитать файл формата SAT.
\en Read a file of SAT format. \~
\param[in] prop - \ru Реализация интерфейса свойств конвертера.
\en Implementation of converter's properties interface. \~
\param[in] idoc - \ru Реализация интерфейса документа.
\en Implementation of document interface. \~
\param[in] indicator - \ru Индикатор хода процесса.
\en The process progress indicator. \~
\return \ru Код завершения операции.
\en Code of the operation termination. \~
\ingroup ACIS_Exchange
*/
DEPRECATE_DECLARE
CONV_FUNC( MbeConvResType ) SATRead( IConvertorProperty3D& prop, ItModelDocument& idoc, IProgressIndicator* indicator );
/** \brief \ru Записать файл формата SAT.
\en Write file of SAT format. \~
\details \ru Записать файл формата SAT или указанный поток.
Если задан поток, то запись производится в присланный поток.
Если поток не задан (нулевой), то открывается поток для файла, заданного в свойствах конвертера. \n
\en Write file of SAT format or the specified stream.
If a stream is specified, then the record is performed to the given stream.
If a stream is not specified (null), then a stream is being opened for file specified in the properties of the converter. \n \~
\param[in] prop - \ru Реализация интерфейса свойств конвертера.
\en Implementation of converter's properties interface. \~
\param[in] idoc - \ru Реализация интерфейса документа.
\en Implementation of document interface. \~
\param[in] indicator - \ru Индикатор хода процесса (может быть nullptr).
\en The process progress indicator (can be nullptr). \~
\return \ru Код завершения операции.
\en Code of the operation termination. \~
\ingroup ACIS_Exchange
*/
DEPRECATE_DECLARE
CONV_FUNC( MbeConvResType ) SATWrite( IConvertorProperty3D& prop, ItModelDocument& idoc, IProgressIndicator* indicator );
/** \brief \ru Прочитать файл формата IGES.
\en Read a file of IGES format. \~
\param[in] prop - \ru Реализация интерфейса свойств конвертера.
\en Implementation of converter's properties interface. \~
\param[in] idoc - \ru Реализация интерфейса документа.
\en Implementation of document interface. \~
\param[in] indicator - \ru Индикатор хода процесса.
\en The process progress indicator. \~
\return \ru Код завершения операции.
\en Code of the operation termination. \~
\ingroup IGES_Exchange
*/
DEPRECATE_DECLARE
CONV_FUNC( MbeConvResType ) IGSRead( IConvertorProperty3D& prop, ItModelDocument& idoc, IProgressIndicator* indicator = 0 );
/** \brief \ru Записать файл формата IGES.
\en Write a file of IGES format. \~
\param[in] prop - \ru Реализация интерфейса свойств конвертера.
\en Implementation of converter's properties interface. \~
\param[in] idoc - \ru Реализация интерфейса документа.
\en Implementation of document interface. \~
\param[in] indicator - \ru Индикатор хода процесса.
\en The process progress indicator. \~
\return \ru Код завершения операции.
\en Code of the operation termination. \~
\ingroup IGES_Exchange
*/
DEPRECATE_DECLARE
CONV_FUNC( MbeConvResType ) IGSWrite( IConvertorProperty3D& prop, ItModelDocument& idoc, IProgressIndicator* indicator = 0 );
/** \brief \ru Прочитать файл формата JT.
\en Read a file of JT format. \~
\param[in] prop - \ru Реализация интерфейса свойств конвертера.
\en Implementation of converter's properties interface. \~
\param[in] idoc - \ru Реализация интерфейса документа.
\en Implementation of document interface. \~
\param[in] indicator - \ru Индикатор хода процесса.
\en The process progress indicator. \~
\return \ru Код завершения операции.
\en Code of the operation termination. \~
\ingroup IGES_Exchange
*/
DEPRECATE_DECLARE
CONV_FUNC( MbeConvResType ) JTRead( IConvertorProperty3D& prop, ItModelDocument& idoc, IProgressIndicator* indicator = 0 );
/** \brief \ru Записать файл формата JT.
\en Write a file of JT format. \~
\param[in] prop - \ru Реализация интерфейса свойств конвертера.
\en Implementation of converter's properties interface. \~
\param[in] idoc - \ru Реализация интерфейса документа.
\en Implementation of document interface. \~
\param[in] indicator - \ru Индикатор хода процесса.
\en The process progress indicator. \~
\return \ru Код завершения операции.
\en Code of the operation termination. \~
\ingroup IGES_Exchange
*/
DEPRECATE_DECLARE
CONV_FUNC( MbeConvResType ) JTWrite( IConvertorProperty3D& prop, ItModelDocument& idoc, IProgressIndicator* indicator = 0 );
/** \brief \ru Прочитать файл формата Parasolid.
\en Read a file of Parasolid format. \~
\param[in] prop - \ru Реализация интерфейса свойств конвертера.
\en Implementation of converter's properties interface. \~
\param[in] idoc - \ru Реализация интерфейса документа.
\en Implementation of document interface. \~
\param[in] indicator - \ru Индикатор хода процесса.
\en The process progress indicator. \~\~
\return \ru Код завершения операции.
\en Code of the operation termination. \~
\ingroup Parasolid_Exchange
*/
DEPRECATE_DECLARE
CONV_FUNC( MbeConvResType ) XTRead( IConvertorProperty3D& prop, ItModelDocument& idoc, IProgressIndicator* indicator = 0 );
/** \brief \ru Записать файл формата Parasolid.
\en Write a file of Parasolid format. \~
\param[in] prop - \ru Реализация интерфейса свойств конвертера.
\en Implementation of converter's properties interface. \~
\param[in] idoc - \ru Реализация интерфейса документа.
\en Implementation of document interface. \~
\param[in] indicator - \ru Индикатор хода процесса.
\en The process progress indicator. \~
\return \ru Код завершения операции.
\en Code of the operation termination. \~
\ingroup Parasolid_Exchange
*/
DEPRECATE_DECLARE
CONV_FUNC( MbeConvResType ) XTWrite( IConvertorProperty3D& prop, ItModelDocument& idoc, IProgressIndicator* indicator = 0 );
/** \brief \ru Прочитать файл формата STEP.
\en Read a file of STEP format. \~
\param[in] prop - \ru Реализация интерфейса свойств конвертера.
\en Implementation of converter's properties interface. \~
\param[in] idoc - \ru Реализация интерфейса документа.
\en Implementation of document interface. \~
\param[in] indicator - \ru Индикатор хода процесса.
\en The process progress indicator. \~
\return \ru Код завершения операции.
\en Code of the operation termination. \~
\ingroup STEP_Exchange
*/
DEPRECATE_DECLARE
CONV_FUNC( MbeConvResType ) STEPRead( IConvertorProperty3D& prop, ItModelDocument& idoc, IProgressIndicator* indicator = 0 );
/** \brief \ru Записать файл формата STEP.
\en Write a file of STEP format. \~
\param[in] prop - \ru Реализация интерфейса свойств конвертера.
\en Implementation of converter's properties interface. \~
\param[in] idoc - \ru Реализация интерфейса документа.
\en Implementation of document interface. \~
\param[in] indicator - \ru Индикатор хода процесса.
\en The process progress indicator. \~
\return \ru Код завершения операции.
\en Code of the operation termination. \~
\ingroup STEP_Exchange
*/
DEPRECATE_DECLARE
CONV_FUNC( MbeConvResType ) STEPWrite( IConvertorProperty3D& prop, ItModelDocument& idoc, IProgressIndicator* indicator = 0 );
/** \brief \ru Прочитать файл формата STL.
\en Read a file of STL format. \~
\param[in] prop - \ru Реализация интерфейса свойств конвертера.
\en Implementation of converter's properties interface. \~
\param[in] idoc - \ru Реализация интерфейса документа.
\en Implementation of document interface. \~
\param[in] indicator - \ru Индикатор хода процесса.
\en The process progress indicator. \~
\return \ru Код завершения операции.
\en Code of the operation termination. \~
\ingroup STL_Exchange
*/
DEPRECATE_DECLARE
CONV_FUNC( MbeConvResType ) STLRead( IConvertorProperty3D& prop, ItModelDocument& idoc, IProgressIndicator* indicator = 0 );
/** \brief \ru Записать файл формата STL.
\en Write a file of STL format. \~
\param[in] prop - \ru Реализация интерфейса свойств конвертера.
\en Implementation of converter's properties interface. \~
\param[in] idoc - \ru Реализация интерфейса документа.
\en Implementation of document interface. \~
\param[in] indicator - \ru Индикатор хода процесса.
\en The process progress indicator. \~
\return \ru Код завершения операции.
\en Code of the operation termination. \~
\ingroup STL_Exchange
*/
DEPRECATE_DECLARE
CONV_FUNC( MbeConvResType ) STLWrite( IConvertorProperty3D& prop, ItModelDocument& idoc, IProgressIndicator* indicator = 0 );
/** \brief \ru Прочитать файл формата OBJ.
\en Read a file of OBJ format. \~
\param[in] prop - \ru Реализация интерфейса свойств конвертера.
\en Implementation of converter's properties interface. \~
\param[in] idoc - \ru Реализация интерфейса документа.
\en Implementation of document interface. \~
\param[in] indicator - \ru Индикатор хода процесса.
\en The process progress indicator. \~
\return \ru Код завершения операции.
\en Code of the operation termination. \~
\ingroup VRML_Exchange
*/
DEPRECATE_DECLARE
CONV_FUNC( MbeConvResType ) OBJRead( IConvertorProperty3D& prop, ItModelDocument& idoc, IProgressIndicator* indicator = 0 );
/** \brief \ru Прочитать файл формата VRML.
\en Read a file of VRML format. \~
\param[in] prop - \ru Реализация интерфейса свойств конвертера.
\en Implementation of converter's properties interface. \~
\param[in] idoc - \ru Реализация интерфейса документа.
\en Implementation of document interface. \~
\param[in] indicator - \ru Индикатор хода процесса.
\en The process progress indicator. \~
\return \ru Код завершения операции.
\en Code of the operation termination. \~
\ingroup VRML_Exchange
*/
DEPRECATE_DECLARE
CONV_FUNC( MbeConvResType ) VRMLRead( IConvertorProperty3D& prop, ItModelDocument& idoc, IProgressIndicator* indicator = 0 );
/** \brief \ru Прочитать файл формата GRDECL.
\en Read a file of GRDECL format. \~
\param[in] prop - \ru Реализация интерфейса свойств конвертера.
\en Implementation of converter's properties interface. \~
\param[in] idoc - \ru Реализация интерфейса документа.
\en Implementation of document interface. \~
\param[in] indicator - \ru Индикатор хода процесса.
\en The process progress indicator. \~
\return \ru Код завершения операции.
\en Code of the operation termination. \~
\ingroup VRML_Exchange
*/
DEPRECATE_DECLARE
CONV_FUNC( MbeConvResType ) GRDECLRead( IConvertorProperty3D& prop, ItModelDocument& idoc, IProgressIndicator* indicator = 0 );
/** \brief \ru Записать файл формата GRDECL.
\en Write a file of GRDECL format. \~
\param[in] prop - \ru Реализация интерфейса свойств конвертера.
\en Implementation of converter's properties interface. \~
\param[in] idoc - \ru Реализация интерфейса документа.
\en Implementation of document interface. \~
\param[in] indicator - \ru Индикатор хода процесса.
\en The process progress indicator. \~
\return \ru Код завершения операции.
\en Code of the operation termination. \~
\ingroup STL_Exchange
*/
DEPRECATE_DECLARE
CONV_FUNC( MbeConvResType ) GRDECLWrite( IConvertorProperty3D& prop, ItModelDocument& idoc, IProgressIndicator* indicator = 0 );
/** \brief \ru Записать файл формата VRML.
\en Write a file of VRML format. \~
\param[in] prop - \ru Реализация интерфейса свойств конвертера.
\en Implementation of converter's properties interface. \~
\param[in] idoc - \ru Реализация интерфейса документа.
\en Implementation of document interface. \~
\param[in] indicator - \ru Индикатор хода процесса.
\en The process progress indicator. \~
\return \ru Код завершения операции.
\en Code of the operation termination. \~
\ingroup VRML_Exchange
*/
DEPRECATE_DECLARE
CONV_FUNC( MbeConvResType ) VRMLWrite( IConvertorProperty3D& prop, ItModelDocument& idoc, IProgressIndicator* indicator = 0 );
/** \brief \ru Записать файл формата 3MF.
\en Write a file of 3MF format. \~
\param[in] prop - \ru Реализация интерфейса свойств конвертера.
\en Implementation of converter's properties interface. \~
\param[in] idoc - \ru Реализация интерфейса документа.
\en Implementation of document interface. \~
\param[in] indicator - \ru Индикатор хода процесса.
\en The process progress indicator. \~
\return \ru Код завершения операции.
\en Code of the operation termination. \~
\ingroup VRML_Exchange
*/
DEPRECATE_DECLARE
CONV_FUNC( MbeConvResType ) ThreeMFWrite( IConvertorProperty3D& prop, ItModelDocument& idoc, IProgressIndicator* indicator = 0 );
/** \brief \ru Прочитать файл с облаком точек в формате ASCII.
\en Read a file of ASCII Point Cloud format. \~
\param[in] prop - \ru Реализация интерфейса свойств конвертера.
\en Implementation of converter's properties interface. \~
\param[in] idoc - \ru Реализация интерфейса документа.
\en Implementation of document interface. \~
\param[in] indicator - \ru Индикатор хода процесса.
\en The process progress indicator. \~
\return \ru Код завершения операции.
\en Code of the operation termination. \~
\ingroup ASCII_Exchange
*/
DEPRECATE_DECLARE
CONV_FUNC( MbeConvResType ) ASCIIPointCloudRead( IConvertorProperty3D& prop, ItModelDocument& idoc, IProgressIndicator* indicator = 0 );
/** \brief \ru Записать файл с облаком точек в формате ASCII..
\en Write a point cloud file of ASCII format. \~
\param[in] prop - \ru Реализация интерфейса свойств конвертера.
\en Implementation of converter's properties interface. \~
\param[in] idoc - \ru Реализация интерфейса документа.
\en Implementation of document interface. \~
\param[in] indicator - \ru Индикатор хода процесса.
\en The process progress indicator. \~
\return \ru Код завершения операции.
\en Code of the operation termination. \~
\ingroup ASCII_Exchange
*/
DEPRECATE_DECLARE
CONV_FUNC( MbeConvResType ) ASCIIPointCloudWrite( IConvertorProperty3D& prop, ItModelDocument& idoc, IProgressIndicator* indicator = 0 );
/** \} */
+5 -4
View File
@@ -119,10 +119,11 @@ void CheckJoinedShellCurve( const MbCurve3D & curve1,
\ingroup Model_Creators
*/
//---
MbCurve3D * CreateJoinedShellCurve( const RPArray<MbCurveEdge> & edges,
const SArray<bool> & orients,
const MbMatrix3D & matr,
MbResultType & res );
template<typename ConstEdgeVector, typename OrientsVector>
MbCurve3D * CreateJoinedShellCurve( const ConstEdgeVector & edges,
const OrientsVector & orients,
const MbMatrix3D & matr,
MbResultType & res );
//------------------------------------------------------------------------------
+10 -4
View File
@@ -25,10 +25,11 @@
class MATH_CLASS MbProjCurveCreator : public MbCreator {
private:
MbWireFrame * wireFrame; // \ru Проецируемый проволочный каркас. \en Wireframe to project.
RPArray<MbCreator> shellCreators; // \ru Протокол построения оболочки, на которую выполняется проецирование \en History tree of the shell the projection is performed onto
MbVector3D dir; // \ru Вектор направления (если нулевой, то проекция по нормали) \en Direction vector (if zero, the normal projection)
bool createExact; // \ru Создавать проекционную кривую при необходимости \en Create the projection curve if necessary
bool truncateByBounds; // \ru Усечь границами \en Truncate by bounds
RPArray<MbCreator> shellCreators; // \ru Протокол построения оболочки, на которую выполняется проецирование \en History tree of the shell the projection is performed onto.
MbVector3D dir; // \ru Вектор направления (если нулевой, то проекция по нормали) \en Direction vector (if zero, the normal projection).
bool createExact; // \ru Создавать проекционную кривую при необходимости \en Create the projection curve if necessary.
bool truncateByBounds; // \ru Усечь границами \en Truncate by bounds.
bool projOnParallel; // \ru Создавать проекции на поверхностях параллельных вектору проецирования. \en Project onto surfaces parallel to a direction of the vector projection.
protected:
/// \ru Конструктор копирования. \en Copy-constructor.
@@ -47,6 +48,11 @@ public:
const RPArray<MbCreator> & shellCreators, bool sameCreators,
const MbVector3D * dir, bool exact, bool truncate,
const MbSNameMaker & snMaker );
/// \ru Конструктор по параметрам. \en Constructor by parameters.
MbProjCurveCreator( const MbWireFrame & wf, const bool sameWire,
const c3d::CreatorsSPtrVector & shellCreators, bool sameCreators,
const MbVector3D * dir, bool exact, bool truncate, bool projOnParallel,
const MbSNameMaker & snMaker );
public:
virtual ~MbProjCurveCreator();
+1 -1
View File
@@ -124,7 +124,7 @@ public :
MbeSelectOption option,
const c3d::IndicesVector & indices = c3d::IndicesVector() );
const MbPrecision & GetPrecision() const override { return sectionData; } // \ru Выдать точность построения. \en Get the precision of object construction.
const MbPrecision & GetPrecision() const override { return (MbPrecision &)sectionData; } // \ru Выдать точность построения. \en Get the precision of object construction.
private :
// \ru Объявление оператора присваивания без реализации, чтобы не было присваивания по умолчанию. \en The declaration of the assignment operator without implementation to prevent an assignment by default.
+44 -20
View File
@@ -12,7 +12,6 @@
#include <templ_rp_array.h>
#include <templ_s_array.h>
#include <templ_sptr.h>
#include <math_define.h>
#include <mb_placement3d.h>
@@ -34,6 +33,7 @@ class MbCurve;
class MbSurfaceIntersectionCurve;
class MbSNameMaker;
class MbSolid;
class MbWireFrame;
struct MbControlData3D;
class MbRegDuplicate;
class MbRegTransform;
@@ -46,12 +46,12 @@ enum MbeCopyMode;
\en Truncating elements. \~
\details \ru Усекающие элементы используются для разделения граней на части и усечения оболочек.
Усечение может выполняться двумерными кривыми, расположенными в плоскости XY локальной системы координат,
трёхмерными кривыми, поверхностями и оболочками.
трёхмерными кривыми, поверхностями, оболочками и каркасом.
Усекающие элементы используются в строителе усеченной оболочки MbTruncatedShell и
строителе оболочки с разбиением граней MbSplitShell. \n
\en Truncating elements are used for splitting faces into parts and truncation of shells.
Truncating can be performed by two-dimensional curves located in the XY plane of the local coordinate system,
by three-dimensional curves, surfaces and shells.
by three-dimensional curves, surfaces, shells and wire frame.
Truncating elements are used in the creator of truncated shell MbTruncatedShell and
in the creator of shell with face splitting MbSplitShell. \n \~
\ingroup Shell_Building_Parameters
@@ -60,11 +60,12 @@ enum MbeCopyMode;
class MATH_CLASS MbSplitData : public MbRefItem {
/// \ru Типы усекающих объектов. \en Truncating objects types.
enum MbeSplitItemsType {
sit_NoItems = 0, ///< \ru Нет объектов. \en No objects.
sit_Curves2d = 1, ///< \ru Двумерные кривые в локальной системе координат. \en Two-dimensional curves in the local coordinate system.
sit_Curves3d = 2, ///< \ru Трехмерные кривые. \en Three-dimensional curves.
sit_Surfaces = 3, ///< \ru Поверхности. \en Surfaces.
sit_Creators = 4, ///< \ru Строители тела. \en Solid creators.
sit_NoItems = 0, ///< \ru Нет объектов. \en No objects.
sit_Curves2d = 1, ///< \ru Двумерные кривые в локальной системе координат. \en Two-dimensional curves in the local coordinate system.
sit_Curves3d = 2, ///< \ru Трехмерные кривые. \en Three-dimensional curves.
sit_Surfaces = 3, ///< \ru Поверхности. \en Surfaces.
sit_Creators = 4, ///< \ru Строители тела. \en Solid creators.
sit_WfCreators = 5, ///< \ru Строители каркаса. \en Wire frame.
};
private:
@@ -80,6 +81,8 @@ private:
// Shell
c3d::CreatorsSPtrVector creators; ///< \ru Строители оболочки. \en Shell creators.
c3d::ShellSPtr solidShell; ///< \ru Оболочка. \en A shell.
// Wire frame
c3d::CreatorsSPtrVector wfCreators; ///< \ru Строители каркаса. \en Wire frame creators.
public:
/// \ru Конструктор. \en Constructor.
@@ -91,7 +94,8 @@ public:
, spaceCurves ( )
, surfaces ( )
, creators ( )
, solidShell ( nullptr )
, solidShell ( nullptr )
, wfCreators ( )
{
}
/// \ru Конструктор по двумерному контуру в локальной системе координат. \en Constructor by two-dimensional contour in the local coordinate system.
@@ -103,7 +107,8 @@ public:
, spaceCurves ( )
, surfaces ( )
, creators ( )
, solidShell ( nullptr )
, solidShell ( nullptr )
, wfCreators ( )
{
SPtr<MbContour> sketchContour;
sketchContour = same ? const_cast<MbContour *>(&item) : static_cast<MbContour *>(&item.Duplicate());
@@ -118,7 +123,8 @@ public:
, spaceCurves ( )
, surfaces ( )
, creators ( )
, solidShell ( nullptr )
, solidShell ( nullptr )
, wfCreators ( )
{
C3D_ASSERT( (direction.MaxFactor() < LENGTH_EPSILON) || !direction.Orthogonal( place.GetAxisZ(), ANGLE_EPSILON ) );
@@ -136,7 +142,8 @@ public:
, spaceCurves ( )
, surfaces ( )
, creators ( )
, solidShell ( nullptr )
, solidShell ( nullptr )
, wfCreators ( )
{
::AddRefItems( items, same, sketchContours );
}
@@ -150,7 +157,8 @@ public:
, spaceCurves ( )
, surfaces ( )
, creators ( )
, solidShell ( nullptr )
, solidShell ( nullptr )
, wfCreators ( )
{
C3D_ASSERT( (direction.MaxFactor() < LENGTH_EPSILON) || !direction.Orthogonal( place.GetAxisZ(), ANGLE_EPSILON ) );
@@ -165,7 +173,8 @@ public:
, spaceCurves ( )
, surfaces ( )
, creators ( )
, solidShell ( nullptr )
, solidShell ( nullptr )
, wfCreators ( )
{
::AddRefItems( items, same, spaceCurves );
}
@@ -178,7 +187,8 @@ public:
, spaceCurves ( )
, surfaces ( )
, creators ( )
, solidShell ( nullptr )
, solidShell ( nullptr )
, wfCreators ( )
{
::AddRefItems( items, same, spaceCurves );
}
@@ -191,7 +201,8 @@ public:
, spaceCurves ( )
, surfaces ( )
, creators ( )
, solidShell ( nullptr )
, solidShell ( nullptr )
, wfCreators ( )
{
SPtr<MbSurface> surface;
surface = same ? const_cast<MbSurface *>(&item) : static_cast<MbSurface *>(&item.Duplicate());
@@ -206,7 +217,8 @@ public:
, spaceCurves ( )
, surfaces ( )
, creators ( )
, solidShell ( nullptr )
, solidShell ( nullptr )
, wfCreators ( )
{
::AddRefItems( items, same, surfaces );
}
@@ -219,12 +231,15 @@ public:
, spaceCurves ( )
, surfaces ( )
, creators ( )
, solidShell ( nullptr )
, solidShell ( nullptr )
, wfCreators ( )
{
::AddRefItems( items, same, surfaces );
}
/// \ru Конструктор по телу. \en Constructor by a solid.
MbSplitData( const MbSolid & solid, bool same, bool keepShell );
/// \ru Конструктор по каркасу. \en
MbSplitData( const MbWireFrame & wireFrame, bool same );
/// \ru Конструктор копирования с регистратором копирования. \en Copy constructor with registrator of copying.
explicit MbSplitData( const MbSplitData &, bool same, MbRegDuplicate * iReg );
/// \ru Деструктор. \en Destructor.
@@ -353,7 +368,8 @@ public:
return ( sketchContours.empty() &&
spaceCurves.empty() &&
surfaces.empty() &&
(creators.empty() && (solidShell == nullptr)) ); }
(creators.empty() && (solidShell == nullptr)) &&
wfCreators.empty() ); }
/// \ru Являются ли объекты равными? \en Determine whether an object is equal?
bool IsSame( const MbSplitData &, double accuracy ) const;
@@ -493,12 +509,20 @@ public:
::DetachItem( creator );
}
}
/// \ru Получить хранимую оболочку. \en Get stored shell.
/// \ru Получить хранимую оболочку. \en Get stored shell.
const MbFaceShell * GetSolidShell() const { return solidShell; }
/// \ru Создать оболочку по строителям (solidShell остается нетронутой). \en Create a shell by creators (solidShell remains unchanged).
MbFaceShell * CreateShell( MbeCopyMode copyMode );
/// \ru Создать оболочку по строителям. \en Create a shell by creators (solidShell remains unchanged).
bool UpdateShell( MbeCopyMode copyMode );
/// \ru Выдать количество строителей тела. \en Get number of wire frame creators.
size_t GetWFrameCreatorsCount() const { return wfCreators.size(); }
/// \ru Получить строитель каркаса по индексу. \en Get wire frame constructor by index.
const MbCreator * GetWireFrameCreator( size_t k ) const { return ((k < wfCreators.size()) ? wfCreators[k].get() : nullptr ); }
/// \ru Получить строитель каркаса по индексу. \en Get wire frame constructor by index.
MbCreator * SetWireFrameCreator( size_t k ) { return ((k < wfCreators.size()) ? wfCreators[k].get() : nullptr ); }
/// \ru Создать каркас по строителям. \en Create a wire frame by creators.
MbWireFrame * CreateWireFrame( MbeCopyMode copyMode );
/// \ru Удалить данные. \en Delete data.
void DeleteItems();
/// \ru Прочитать данные. \en Read data.
+9 -4
View File
@@ -16,6 +16,7 @@
#include <math_define.h>
#include <mb_enum.h>
#include <mb_operation_result.h>
#include <wire_frame.h>
class MbCurve;
@@ -26,6 +27,7 @@ class MbCurve3D;
class MbFace;
class MbSolid;
class MbSNameMaker;
class MbTruncateShellParams;
struct MbMergingFlags;
@@ -33,9 +35,9 @@ struct MbMergingFlags;
/** \brief \ru Строитель усеченной оболочки.
\en Constructor of a truncated shell. \~
\details \ru Строитель усеченной оболочки режет исходную оболочку на части указанными элементами,
которыми могут служить двумерные кривые в локальной системе координат, трёхмерные кривые, поверхности и оболочки. \n
которыми могут служить двумерные кривые в локальной системе координат, трёхмерные кривые, поверхности, оболочка и каркас \n
\en Constructor of a truncated shell cuts the initial shell into parts by the specified elements
which can be two-dimensional curves in the local coordinate system, three-dimensional curves, surfaces and shells. \n \~
which can be two-dimensional curves in the local coordinate system, three-dimensional curves, surfaces, shell and wire frame. \n \~
\ingroup Model_Creators
*/
// ---
@@ -60,6 +62,9 @@ public:
/// \ru Конструктор по строителям тела. \en Constructor by solid creators.
MbTruncatedShell( const MbSolid &, bool same, bool keepShell,
bool orient, const MbMergingFlags &, const MbSNameMaker & );
/// \ru Конструктор по каркасу. \en Constructor by wire frame.
MbTruncatedShell( const MbWireFrame &, bool same,
bool orient, const MbMergingFlags &, const MbSNameMaker & );
virtual ~MbTruncatedShell();
@@ -92,7 +97,7 @@ public:
bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell,
RPArray<MbSpaceItem> * items = nullptr ) override;
// \ru Установить номера выбраных граней усекаемого тела \en Set indices of selected faces of the solid being truncated.
// \ru Установить номера выбранных граней усекаемого тела \en Set indices of selected faces of the solid being truncated.
void SetSelIndices( const std::vector<MbItemIndex> & selInds );
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbTruncatedShell )
@@ -140,6 +145,7 @@ IMPL_PERSISTENT_OPS( MbTruncatedShell )
\ingroup Model_Creators
*/
// ---
DEPRECATE_DECLARE
MATH_FUNC (MbCreator *) TruncateSurfacesSol( MbSolid & initSolid,
SArray<size_t> & selIndices,
MbeCopyMode sameShell,
@@ -153,5 +159,4 @@ MATH_FUNC (MbCreator *) TruncateSurfacesSol( MbSolid & initSo
MbFaceShell *& resShell,
MbPlacement3D *& resDir );
#endif // __TRUNCATED_SHELL_H
+17 -14
View File
@@ -64,7 +64,7 @@ private:
size_t degree; ///< \ru Порядок В-сплайна. \en Order of B-spline.
ptrdiff_t uppKnotsIndex; ///< \ru Последний индекс узлового вектора. \en Last index of knot vector.
SArray<double> knots; ///< \ru Узловой вектор. \en Knot vector.
SArray<double> weights; ///< \ru Множество весов контрольных точек. \en Set of weights of the control points.
MbWeightVector weights; ///< \ru Множество весов контрольных точек. \en Set of weights of the control points.
MbeNurbsCurveForm form; ///< \ru Форма кривой. \en Form of curve.
private:
@@ -360,7 +360,7 @@ public :
closed = initClosed;
uppIndex = (ptrdiff_t)initPoints.size() - 1;
pointList.assign( initPoints.begin(), initPoints.end() );
weights.assign( initPoints.size(), 1.0 );
weights.InitWeights( 1.0, initPoints.size() );
DefineKnotsVector();
return true;
@@ -398,14 +398,14 @@ public :
if ( initWeights != nullptr ) {
if ( (ptrdiff_t)initWeights->size() == uppIndex + 1 )
weights.assign( initWeights->begin(), initWeights->end() );
weights.InitWeights( *initWeights );
else {
C3D_ASSERT_UNCONDITIONAL( false ); // Wrong size of weights vector
weights.assign( initPoints.size(), 1.0 );
weights.InitWeights( 1.0, initPoints.size() );
}
}
else {
weights.assign( initPoints.size(), 1.0 );
weights.InitWeights( 1.0, initPoints.size() );
}
DefineKnotsVector();
@@ -444,7 +444,7 @@ public :
closed = initClosed;
pointList = initPoints;
form = initForm;
weights = initWeights;
weights.InitWeights( initWeights );
knots = initKnots;
uppIndex = (ptrdiff_t)pointList.size() - 1;
@@ -862,14 +862,17 @@ public :
bool IsRational() const;
/// \ru Получить размер весового вектора. \en Get a size of weights vector.
size_t GetWeightsCount() const { return weights.size(); }
size_t GetWeightsCount() const { return weights.Count(); }
/// \ru Получить весовой вектор. \en Get a weights vector.
template <class WeightsVector>
void GetWeights( WeightsVector & wts, bool justSet = true ) const { if ( justSet ) { wts.clear(); }; std::copy( weights.begin(), weights.end(), std::back_inserter( wts ) ); }
void GetWeights( WeightsVector & wts, bool justSet = true ) const { if ( justSet ) { wts.clear(); }; weights.GetWeights( wts ); }
/// \ru Получить весовой вектор. \en Get a weights vector.
const MbWeightVector & GetWeights() const { return weights; }
/// \ru Получить значение элемента весового вектора по индексу. \en Get a weights vector element value by index.
double GetWeight( size_t ind ) const { return weights[ind]; }
double GetWeight( size_t ind ) const { return weights.GetWeight( ind ); }
/// \ru Получить значение элемента весового вектора по индексу. \en Get a weights vector element value by index.
double & SetWeight( size_t ind ) { return weights[ind]; }
DEPRECATE_DECLARE_REPLACE( SetWeight( ptrdiff_t pointNumber, double newWeight ) )
double & SetWeight( size_t ind ) { return weights.SetWeight( ind ); }
/// \ru Получить размер узлового вектора. \en Get a size of knots vector.
size_t GetKnotsCount() const { return knots.size(); }
@@ -885,7 +888,7 @@ public :
// \ru BEG: для библиотеки (хорошо бы избавиться) \en BEG: for the library (it would be good to get rid of this)
/// \ru Добавить точку в конец массива. \en Add point to the end of the array.
void LtAddPoint ( MbCartPoint & pnt, double weight ) { C3D_ASSERT_UNCONDITIONAL( false ); pointList.push_back( pnt ); weights.push_back( weight ); }
void LtAddPoint ( MbCartPoint & pnt, double weight ) { C3D_ASSERT_UNCONDITIONAL( false ); pointList.push_back( pnt ); weights.AddWeight( weight ); }
/// \ru Добавить характерную точку в степенном представлении в конец массива. \en Add a control point with degree representation to the end of the array.
void LtAddPowerPoint( MbCartPoint & pnt ) { C3D_ASSERT_UNCONDITIONAL( false ); pointList.push_back( pnt ); }
/// \ru Добавить узел в конец узлового вектора. \en Add a knot to the end of knot vector.
@@ -1068,9 +1071,9 @@ MbNurbs::MbNurbs( size_t initDegree, bool initClosed, const PointsVector & initP
degree = initDegree; // Степень В-сплайна.
if ( initWeights != nullptr )
weights.assign( initWeights->begin(), initWeights->end() );
weights.InitWeights( *initWeights );
else
weights.assign( initPoints.size(), 1.0 );
weights.InitWeights( 1.0, initPoints.size() );
if ( initKnots != nullptr ) {
knots.assign( initKnots->begin(), initKnots->end() );
@@ -1092,7 +1095,7 @@ inline
void MbNurbs::AddPoint( const MbCartPoint & pnt, double weight )
{
pointList.push_back( pnt );
weights.push_back( weight );
weights.AddWeight( weight );
form = ncf_Unspecified;
Rebuild();
}
+10 -6
View File
@@ -61,7 +61,7 @@ class MATH_CLASS MbNurbs3D : public MbPolyCurve3D {
private :
size_t degree; ///< \ru Порядок В-сплайна (порядок = степень + 1). \en Order of B-spline (order = degree + 1).
ptrdiff_t uppKnotsIndex; ///< \ru Последний индекс узлового вектора. \en Last index of knot vector.
SArray<double> weights; ///< \ru Множество весов контрольных точек. \en Set of weights of the control points.
MbWeightVector weights; ///< \ru Множество весов контрольных точек. \en Set of weights of the control points.
SArray<double> knots; ///< \ru Узловой вектор сплайна. \en Knot vector of the spline.
MbeNurbsCurveForm form; ///< \ru Форма кривой. \en Shape of curve.
@@ -659,14 +659,18 @@ public:
bool IsRational() const;
/// \ru Получить размер весового вектора. \en Get a size of weights vector.
size_t GetWeightsCount() const { return weights.size(); }
size_t GetWeightsCount() const { return weights.Count(); }
/// \ru Получить весовой вектор. \en Get a weights vector.
template <class WeightsVector>
void GetWeights( WeightsVector & wts, bool justSet = true ) const { if ( justSet ) { wts.clear(); }; std::copy( weights.begin(), weights.end(), std::back_inserter( wts ) ); }
void GetWeights( WeightsVector & wts, bool justSet = true ) const { if ( justSet ) { wts.clear(); }; weights.GetWeights( wts ); }
/// \ru Получить весовой вектор. \en Get a weights vector.
const MbWeightVector & GetWeights() const { return weights; }
/// \ru Получить значение элемента весового вектора по индексу. \en Get a weights vector element value by index.
double GetWeight( size_t ind ) const { return weights[ind]; }
/// \ru Получить значение элемента весового вектора по индексу. \en Get a weights vector element value by index.
double & SetWeight( size_t ind ) { return weights[ind]; }
double GetWeight( size_t ind ) const { return weights.GetWeight( ind ); }
/// \ru Получить значение элемента весового вектора по индексу. Устаревшая функция, не рекомендуется к использованию.
/// \en Get a weights vector element value by index. Deprecated function, not recommended for use.
DEPRECATE_DECLARE_REPLACE( SetWeight( ptrdiff_t pointNumber, double newWeight ) )
double & SetWeight( size_t ind ) { return weights.SetWeight( ind ); }
/// \ru Получить размер узлового вектора. \en Get a size of knots vector.
size_t GetKnotsCount() const { return knots.size(); }
+1
View File
@@ -305,6 +305,7 @@ public :
void GetBasisPoints( MbControlData & ) const override; // \ru Выдать контрольные точки объекта. \en Get control points of object.
void SetBasisPoints( const MbControlData & ) override; // \ru Изменить объект по контрольным точкам. \en Change the object by control points.
bool IsSimilarToCurve( const MbCurve & curve, double precision = PARAM_PRECISION ) const override; // \ru Подобные ли кривые для объединения (слива). \en Whether the curves for union (joining) are similar.
bool SetLimitParam( double newTMin, double newTMax ); // \ru Установить область изменения параметра \en Set range of parameter
/** \} */
private:
+2 -2
View File
@@ -80,11 +80,11 @@ public :
/// \ru Установить параметрическую область кривой пропорциональную метрической длине кривой. Ожидается, что первая производная базовой кривой r'(t) является непрерывной функцией параметра t по всей ее длине \en Set the parametric area of the curve proportional to the metric length of the curve. The first derivative of the base curve r'(t) is expected to be a continuous function of the parameter t over its entire length
bool InitProportional( double t1, double t2 );
/// \ru Установить пользовательскую функцию репараметризации. \en Set users reparameterization function.
bool InitByUsersFunction( MbFunction & repFunc );
bool InitByUsersFunction( MbFunction & repFunc, MbeReparamType tp = rt_User );
/// \ru Установить параметрическую область кривой пропорциональную метрической длине кривой. \en Set the parametric area of the curve proportional to the metric length of the curve.
static MbReparamCurve * CreateProportional( const MbCurve & curve, double t1, double t2 );
/// \ru Установить пользовательскую функцию репараметризации. \en Set users reparameterization function.
static MbReparamCurve * CreateByFunction( const MbCurve & curve, MbFunction & repFunc );
static MbReparamCurve * CreateByFunction( const MbCurve & curve, MbFunction & repFunc, MbeReparamType tp = rt_User );
/** \ru \name Общие функции геометрического объекта.
\en \name Common functions of a geometric object.
+2 -2
View File
@@ -79,11 +79,11 @@ public :
/// \ru Установить параметрическую область кривой пропорциональную метрической длине кривой. Ожидается, что первая производная базовой кривой r'(t) является непрерывной функцией параметра t по всей ее длине \en Set the parametric area of the curve proportional to the metric length of the curve. The first derivative of the base curve r'(t) is expected to be a continuous function of the parameter t over its entire length
bool InitProportional( double t1, double t2 );
/// \ru Установить пользовательскую функцию репараметризации. \en Set users reparameterization function.
bool InitByUsersFunction( MbFunction & repFunc );
bool InitByUsersFunction( MbFunction & repFunc, MbeReparamType tp = rt_User );
/// \ru Установить параметрическую область кривой пропорциональную метрической длине кривой. \en Set the parametric area of the curve proportional to the metric length of the curve.
static MbReparamCurve3D * CreateProportional( const MbCurve3D & curve, double t1, double t2 );
/// \ru Установить пользовательскую функцию репараметризации. \en Set users reparameterization function.
static MbReparamCurve3D * CreateByFunction( const MbCurve3D & curve, MbFunction & repFunc );
static MbReparamCurve3D * CreateByFunction( const MbCurve3D & curve, MbFunction & repFunc, MbeReparamType tp = rt_User );
// \ru Общие функции математического объекта \en Common functions of the mathematical object
+4 -1
View File
@@ -284,7 +284,7 @@ public:
MbCurve3D * MakeCurve( VERSION version ) const;
/// \ru Построить точную пространственную копию кривой. \en Construct the exact spatial curve copy.
MbCurve3D * CreateCurve() const;
/// \ru Создать пространственную кривую по линии u, v. \en Create a spatial curve by u, v lines.
/// \ru Создать пространственную кривую по линии u, v. \en Create a spatial curve by u, v lines.
MbCurve3D * CreateUV() const;
/// \ru Вычислить левый перпендикуляр к кривой в плоскости поверхности. \en Calculate the left perpendicular to a curve at level of surface.
@@ -369,6 +369,9 @@ protected:
double CalcLengthEvaluation( bool force = false ) const; // \ru Оценить метрическую длину кривой. \en Estimate the metric length of a curve.
void CalcWeightCentre( MbCartPoint3D & wc, bool force = false ) const; // \ru Выдать центр тяжести кривой. \en Get center of mass of curve.
/// \ru Создать приближенную пространственную кривую. \en Create an approximated spatial curve.
MbCurve3D * CreateUVSpecial( VERSION ) const;
private:
// \ru Объявить оператор приравнивания по ссылке, \en Declare operator of assignment by reference
// \ru чтобы не был вызван по умолчанию оператор приравнивания по значению \en To prevent default calling of the assignment operator by value
+2
View File
@@ -664,6 +664,8 @@ public:
void InitProgress( IProgressIndicator * pr );
void InitProgress( ProgressBarWrapper & pr );
// \ru Тестовые функции. \en Testing functions.
virtual void SetTestData( const TapeBase * ) {}
protected:
/// \ru Записать объект и тип. \en Write the object and type.
+48
View File
@@ -116,4 +116,52 @@ struct MATH_CLASS MbCurvature
};
//------------------------------------------------------------------------------
/** \brief \ru Тип кривизны.
\en Curvature type. \~
\warning \ru В разработке.
\en Under development. \~
*/
// ---
enum class MbeCurvatureType
{
mean, ///< \ru Средняя кривизна. \en Mean curvature.
gaussian, ///< \ru Гауссова кривизна. \en Gaussian curvature.
maximum, ///< \ru Максимальная кривизна. \en Maximum principal curvature.
minimum, ///< \ru Минимальная кривизна. \en Minimum principal curvature.
index, ///< \ru Индекс кривизны. \en Curvature indexr.
curvedness, ///< \ru Изогнутость. \en Curvednessr.
};
/// \ru Получить значение кривизны заданного типа. \en Get the curvature value of a given type.
inline double GetCurvatureValue( MbeCurvatureType type, const MbCurvature & curv )
{
double value = 0.;
switch ( type )
{
case MbeCurvatureType::mean:
value = curv.k_h;
break;
case MbeCurvatureType::gaussian:
value = curv.k_g;
break;
case MbeCurvatureType::maximum:
value = curv.k1;
break;
case MbeCurvatureType::minimum:
value = curv.k2;
break;
case MbeCurvatureType::index:
value = curv.CurvatureIndex();
break;
case MbeCurvatureType::curvedness:
value = curv.Curvedness();
break;
default:
break;
}
return value;
}
#endif // __M2B_MESH_CURVATURE_H
+2
View File
@@ -106,6 +106,8 @@
#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
#define MATH_24_VERSION 0x18000001L ///< \ru Версия файла - 24.0. \en The file version - 24.0. \~ \ingroup Base_Tools
#define MATH_24_HF1_VERSION 0x18000003L ///< \ru Версия файла - 24.0 HF1. \en The file version - 24.0 HF1. \~ \ingroup Base_Tools
#define MATH_24_HF2_VERSION 0x18000004L ///< \ru Версия файла - 24.0 HF2. \en The file version - 24.0 HF2. \~ \ingroup Base_Tools
#define MATH_24_UHF_VERSION 0x18000101L ///< \ru Версия файла - 24.0 UHF (Upper Hot Fix). \en The file version - 24.0 UHF (Upper Hot Fix). \~ \ingroup Base_Tools
#define C3D_2025_VERSION 0x18001001L ///< \ru Версия файла - C3D 2025. \en The file version - C3D 2025. \~ \ingroup Base_Tools
+1 -1
View File
@@ -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 2025!" // Message about a deprecated API.
#define DEPR_MSG "This is a deprecated API that will be removed in version 2026!" // 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.
+8 -7
View File
@@ -356,13 +356,14 @@ enum MbeLabelState {
*/
// ---
enum MbeSmoothForm {
st_Unknown = -3, ///< \ru Неопределенное сопряжение. \en Undefined blend item.
st_Ellipse = -2, ///< \ru Скругление дугой эллипса с пересчетом радиусов!!! \en Filleting by ellipical arc with recalculating the radii!!!
st_Span = -1, ///< \ru Скругление с заданной хордой. \en Fillet with a given chord.
st_Fillet = 0, ///< \ru Скругление с заданными радиусами. \en Fillet with given radii.
st_Chamfer = 1, ///< \ru Фаска с заданными катетами. \en Chamfer with given cathetuses.
st_Slant1 = 2, ///< \ru Фаска по катету и углу (катет distance2 рассчитан для прямого угла между гранями и определяет прилегающий к катету distance1 угол). \en Chamfer by cathetus and angle (distance2 cathetus is calculated for right angle between faces and defines angle adjacent to the distance1 cathetus).
st_Slant2 = 3, ///< \ru Фаска по углу и катету (катет distance1 рассчитан для прямого угла между гранями и определяет прилегающий к катету distance2 угол). \en Chamfer by angle and cathetus (distance1 cathetus is calculated for right angle between faces and defines angle adjacent to the distance2 cathetus).
st_Unknown = -3, ///< \ru Неопределенное сопряжение. \en Undefined blend item.
st_Ellipse = -2, ///< \ru Скругление дугой эллипса с пересчетом радиусов!!! \en Filleting by ellipical arc with recalculating the radii!!!
st_Span = -1, ///< \ru Скругление с заданной хордой. \en Fillet with a given chord.
st_Fillet = 0, ///< \ru Скругление с заданными радиусами. \en Fillet with given radii.
st_Chamfer = 1, ///< \ru Фаска с заданными катетами. \en Chamfer with given cathetuses.
st_Slant1 = 2, ///< \ru Фаска по катету и углу (катет distance2 рассчитан для прямого угла между гранями и определяет прилегающий к катету distance1 угол). \en Chamfer by cathetus and angle (distance2 cathetus is calculated for right angle between faces and defines angle adjacent to the distance1 cathetus).
st_Slant2 = 3, ///< \ru Фаска по углу и катету (катет distance1 рассчитан для прямого угла между гранями и определяет прилегающий к катету distance2 угол). \en Chamfer by angle and cathetus (distance1 cathetus is calculated for right angle between faces and defines angle adjacent to the distance2 cathetus).
st_ByCurvature = 4, ///< \ru Скругление с непрерывной кривизной на границе c опорными поверхностями. \en Fillet with continuous curvature on the boundary with rail surfaces.
};
+132
View File
@@ -378,6 +378,138 @@ public:
}; //MbNurbsPointInfo
//------------------------------------------------------------------------------
/** \brief \ru Веса NURBS кривой.
\en Weights of a NURBS curve. \~
\details \ru Веса NURBS кривой.
\en Weights of a NURBS curve. \~
\ingroup Data_Structures
*/ // ---
class MATH_CLASS MbWeightVector {
private:
size_t m_count; ///< \ru Количество весов контрольных точек. \en A number of weights of the control points.
double m_commonWeight; ///< \ru Общий вес контрольных точек. \en A common weight of control points.
c3d::DoubleVector m_weights; ///< \ru Множество весов контрольных точек. \en Set of weights of the control points.
public:
/// \ru Конструктор по умолчанию. \en Default constructor.
MbWeightVector() : m_count( 0 ), m_commonWeight( UNDEFINED_DBL ), m_weights() {}
/// \ru Конструктор копирования. \en Copy-constructor.
MbWeightVector( const MbWeightVector & wv ) : m_count( wv.m_count ), m_commonWeight( wv.m_commonWeight ), m_weights( wv.m_weights ) {}
~MbWeightVector() {}
/// \ru Количество весов. \en Number of weights.
size_t Count() const { return m_count; }
/// \ru Общий вес? \en Is it used a common weight?
bool IsCommonWeight() const {
C3D_ASSERT( ( m_commonWeight != UNDEFINED_DBL ) == ( m_weights.size() < 1 ) );
return ( m_commonWeight != UNDEFINED_DBL );
}
/// \ru Инициализация по общему весу. \en Initialize by common weight.
bool InitWeights( double wt, size_t cnt ) {
ClearVector();
m_count = cnt;
m_commonWeight = wt;
return ( m_commonWeight > -MB_MAXDOUBLE && m_commonWeight < MB_MAXDOUBLE );
}
/// \ru Инициализация по массиву весов. \en Initialize by weights array.
template<class Vector>
bool InitWeights( const Vector & wts ) {
bool res = false;
m_count = wts.size();
m_commonWeight = UNDEFINED_DBL;
if ( CanAdjust(wts) ) {
m_commonWeight = wts[0];
ClearVector();
res = true;
}
else {
m_weights.assign( wts.begin(), wts.end() );
res = wts.size() > 0;
}
return res;
}
/// \ru Инициализация по вектору весов. \en Initialize by weights vector.
bool InitWeights( const MbWeightVector & wv ) {
m_count = wv.m_count;
m_commonWeight = wv.m_commonWeight;
m_weights = wv.m_weights;
return true;
}
/// \ru Получить веса. \en Get weights array.
template<class Vector>
void GetWeights( Vector & wts, bool clear = false ) const {
C3D_ASSERT( (m_commonWeight != UNDEFINED_DBL) == (m_weights.size() < 1) );
if ( clear )
wts.clear();
if ( m_commonWeight != UNDEFINED_DBL )
wts.resize( m_count + wts.size(), m_commonWeight);
else
std::copy( m_weights.begin(), m_weights.end(), std::back_inserter( wts ) );
}
/// \ru Установить веса. \en Get weights array.
template<class Vector>
bool SetWeights( const Vector & wts ) { return InitWeights( wts ); }
/// \ru Получить вес по индексу. \en Get weight by index.
double GetWeight( size_t index ) const { return index < m_weights.size() ? m_weights[index] : m_commonWeight; }
/// \ru Получить вес по индексу. Устаревшая функция, не рекомендуется к использованию.
/// \en Get weight by index. Deprecated function, not recommended for use.
DEPRECATE_DECLARE_REPLACE( SetWeight( size_t index, double wt ) )
double & SetWeight( size_t index );
/// \ru Установить вес по индексу. \en Set weight by index.
bool SetWeight( size_t index, double wt );
/// \ru Добавить вес. \en Add weight.
void AddWeight( double wt );
/// \ru Вставить вес. \en Insert weight.
void InsertWeight( size_t index, double wt );
/// \ru Удалить вес по индексу. \en Remove weight at index.
bool RemoveWeight( size_t index );
/// \ru Удалить группу весов в интервале [index1, index2). \en Remove group of weights in the [index1, index2) interval.
bool RemoveWeights( size_t index1, size_t index2 );
/// \ru Получить общий вес (использовать после проверки IsCommonWeight). \en Get common weight (to be used after checking IsCommonWeight).
double GetCommonWeight() const { return m_commonWeight; }
/// \ru Инвертировать веса. \en Reverse weights.
void Reverse() { if ( m_commonWeight == UNDEFINED_DBL ) std::reverse( m_weights.begin(), m_weights.end() ); }
/// \ru Сбросить данные. \en Flush data.
void FlushData() { m_count = 0; m_commonWeight = UNDEFINED_DBL; ClearVector(); }
/// \ru Можно ли оптимизировать расход памяти? \en Is it possible to adjust memory of weights array?
template<class Vector>
bool CanAdjust( const Vector & wts, double eps = DOUBLE_REGION ) const {
bool res = wts.size() > 0;
if ( res ) {
const double & w0 = wts[0];
for ( size_t i = 1; res && i < m_count; i++ )
res = ::fabs( wts[i] - w0 ) < eps;
}
return res;
}
/// \ru Оптимизировать расход памяти. \en Adjust memory of weights array.
bool Adjust( double eps = DOUBLE_REGION );
/// \ru Оператор присваивания. \en Assignment operator.
MbWeightVector & operator = ( const MbWeightVector & wv ) { InitWeights( wv ); return *this; }
/// \ru Оператор присваивания. \en Assignment operator.
template<class Vector>
MbWeightVector & operator = ( const Vector & wv ) { InitWeights( wv ); return *this; }
/// \ru Сравнение. \en Comparison.
bool IsSame( const MbWeightVector & wv, double eps ) const;
private:
bool FillVector();
void ClearVector();
MbWeightVector( const c3d::DoubleVector & wv ); // Запрещено.
MbWeightVector( const SArray<double> & wv ); // Запрещено.
};
//------------------------------------------------------------------------------
/** \brief \ru Дать меру расстояния.
\en Get a measure of the distance. \~
+2
View File
@@ -1345,6 +1345,8 @@ enum MbePrompt
IDS_PROP_2035, ///< \ru Режим адаптации. \en Adaptation mode.
IDS_PROP_2036, ///< \ru Создавать проекции на поверхностях параллельных вектору проецирования. \en Project onto surfaces parallel to a direction of the vector projection.
IDS_PROP_LAST = 9999, ///< \ru Наибольшее значение. \en The greatest value.
};
+1 -1
View File
@@ -1496,7 +1496,7 @@ bool IsEqualPaths( const SimpleNameVector & path1, const SimpleNameVector & path
\en Path as array of identifiers (path to component from upper component). \n \~
\ingroup Names
*/ // ---
class MbPath : public SArray<SimpleName> {
class MATH_CLASS MbPath : public SArray<SimpleName> {
public:
/// \ru Конструктор. \en Constructor.
MbPath() : SArray<SimpleName> ( 0, 1 ) {}
+26 -20
View File
@@ -262,7 +262,7 @@ enum MbeIntCurveBuildType {
\en Parameters of a surface intersection curve. Work cases are in #MbeIntCurveBuildType. \n \~
\ingroup Curve3D_Building_Parameters
*/ // ---
class MATH_CLASS MbIntCurveParams {
class MATH_CLASS MbIntCurveParams : public MbPrecision {
public:
bool mergeCurves; ///< \ru Объединять кривые, разрезанные швом. \en Merge curves cut by a surface seam.
bool cutCurves; ///< \ru Разрезать кривые в точках пересечения. \en Cut curves at intersection points.
@@ -285,7 +285,8 @@ public:
\en Names maker with operation version. \~
*/
MbIntCurveParams( const MbSNameMaker & snMaker )
: mergeCurves( true )
: MbPrecision( )
, mergeCurves( true )
, cutCurves ( false )
, _type ( ict_General )
, _snMaker ( &snMaker.Duplicate() )
@@ -303,7 +304,8 @@ public:
\en Names maker with operation version. \~
*/
MbIntCurveParams( bool _cutCurves, const MbSNameMaker & snMaker )
: mergeCurves( true )
: MbPrecision( )
, mergeCurves( true )
, cutCurves ( _cutCurves )
, _type ( ict_General )
, _snMaker ( &snMaker.Duplicate() )
@@ -320,7 +322,8 @@ public:
\en Names maker with operation version. \~
*/
MbIntCurveParams( bool _mergeCurves, bool _cutCurves, const MbSNameMaker & snMaker )
: mergeCurves( _mergeCurves )
: MbPrecision( )
, mergeCurves( _mergeCurves )
, cutCurves ( _cutCurves )
, _type ( ict_General )
, _snMaker ( &snMaker.Duplicate() )
@@ -349,10 +352,11 @@ public:
const MbCartPoint & uvInitOnSurface2,
const MbVector3D & initDirection,
const MbSNameMaker & nameMaker )
: mergeCurves( true )
, cutCurves ( true )
, _type ( ict_OnePoint )
, _snMaker ( &nameMaker.Duplicate() )
: MbPrecision( )
, mergeCurves( true )
, cutCurves ( true )
, _type ( ict_OnePoint )
, _snMaker ( &nameMaker.Duplicate() )
, _values ( new MbIntCurveOnePointValues(
surface1Domain, surface2Domain, uvInitOnSurface1, uvInitOnSurface2, initDirection) )
{}
@@ -386,10 +390,11 @@ public:
bool ext2,
const MbVector3D & dir,
const MbSNameMaker & nameMaker )
: mergeCurves( true )
, cutCurves ( true )
, _type ( ict_TwoPoints )
, _snMaker ( &nameMaker.Duplicate() )
: MbPrecision( )
, mergeCurves( true )
, cutCurves ( true )
, _type ( ict_TwoPoints )
, _snMaker ( &nameMaker.Duplicate() )
, _values ( new MbIntCurveLimitPointsValues(uv1beg, uv1end, ext1, uv2beg, uv2end, ext2, dir) )
{}
@@ -429,10 +434,11 @@ public:
bool useRedetermination,
bool checkPoles,
const MbSNameMaker & nameMaker )
: mergeCurves( true )
, cutCurves ( true )
, _type ( ict_TwoPointsGuide )
, _snMaker ( &nameMaker.Duplicate() )
: MbPrecision( )
, mergeCurves( true )
, cutCurves ( true )
, _type ( ict_TwoPointsGuide )
, _snMaker ( &nameMaker.Duplicate() )
, _values ( new MbIntCurveLimitPointsValues(
uv1beg, uv1end, ext1, uv2beg, uv2end, ext2, guideCurve, useRedetermination, checkPoles) )
{}
@@ -578,7 +584,7 @@ public:
bool Same2() const { return _same2; }
/// \ru Получить флаг использования построителей. \en Get the flag of using creators.
bool UseCreators() const { return _same2; }
bool UseCreators() const { return _useCreators; }
OBVIOUS_PRIVATE_COPY( MbIntCurveShellParams )
};
@@ -654,7 +660,7 @@ public:
, 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 )
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 )
@@ -664,8 +670,8 @@ public:
, surface ( nullptr )
, snMaker ( &nm.Duplicate() )
{
if ( surface != nullptr )
SetBySurfaceNormal( useSurfaceNormal, &surface );
if ( surf != nullptr )
SetBySurfaceNormal( useSurfaceNormal, &surf );
}
/// \ru Конструктор копирования. \en Copy constructor.
MbSpatialOffsetCurveParams( const MbSpatialOffsetCurveParams & other );
+26 -1
View File
@@ -31,9 +31,15 @@ class MbStepData;
\details \ru Параметры операции упрощения триангуляции.
Упрощение может производиться до достижения заданного количества треугольников,
либо до превышения заданной точности.
Пользователь может задать порог двугранного угла - рёбра с углом больше порога не участвуют в процедуре упрощения.
Пользователь может задать порог угла между соседними граничными рёбрами -
участки слома границы не участвуют в процедуре упрощения.
\en Triangulation simplification parameters.
Simplification can be carried out until target triangles count reaching or until
exceeding of specified tolerance. \~
exceeding of specified tolerance.
The dihedral angle threshold can be specified - edges with a bigger angle will be skipped during simplification.
The threshold of the angle between adjacent boundary edges can be specified -
boundary cracks will be skipped during simplification. \~
\ingroup Shell_Building_Parameters
*/
// ---
@@ -61,6 +67,9 @@ private:
c3d::DoubleVector _toleranceLevels; ///< \ru Уровни точностей для упрощения. \en Tolerance levels for simplification. \~
c3d::IndicesVector _triangleCountLevels; ///< \ru Уровни количества треугольников для упрощения. \en Triangle count levels for simplification. \~
MbeMeshSimplificationMethod _method; ///< \ru Метод упрощения триангуляции. \en Triangulation simplification method. \~
double _thresholdEdAngle; ///< \ru Порог двугранного угла (в градусах). \en The dihedral angle threshold (in degrees). \~
double _thresholdVxAngle; ///< \ru Порог угла между соседними рёбрами границы (в градусах). \en The threshold of the angle between adjacent boundary edges (in degrees). \~
public:
mutable IProgressIndicator * _progress; ///< \ru Индикатор прогресса выполнения операции. \en A progress indicator of the operation.
@@ -70,6 +79,8 @@ public:
: _toleranceLevels ( toleranceLevels )
, _triangleCountLevels( )
, _method ( MbeMeshSimplificationMethod::fast )
, _thresholdEdAngle ( -1. )
, _thresholdVxAngle ( -1. )
, _progress ( prog )
{}
@@ -78,6 +89,8 @@ public:
: _toleranceLevels ( )
, _triangleCountLevels( triangleCountLevels )
, _method ( MbeMeshSimplificationMethod::fast )
, _thresholdEdAngle ( -1. )
, _thresholdVxAngle ( -1. )
, _progress ( prog )
{}
@@ -143,6 +156,18 @@ public:
///< \ru Получить метод упрощения. \en Get the simplification method. \~
MbeMeshSimplificationMethod GetSimplificationMethod() const { return _method; }
///< \ru Установить порог двугранного угла для коллапса рёбер (в градусах). \en Set the dihedral angle threshold for collapsing edges (in degrees). \~
void SetDihedralAngleThreshold( double angle ) { _thresholdEdAngle = angle; }
///< \ru Получить порог двугранного угла для коллапса рёбер (в градусах). \en Get the dihedral angle threshold for collapsing edges (in degrees). \~
double GetDihedralAngleThreshold() const { return _thresholdEdAngle; }
///< \ru Установить порог угла между соседними рёбрами границы (в градусах). \en Set the threshold of the angle between adjacent boundary edges (in degrees). \~
void SetAdjacentBoundaryEdgesAngleThreshold( double angle ) { _thresholdVxAngle = angle; }
///< \ru Получить порог угла между соседними рёбрами границы (в градусах). \en Get the threshold of the angle between adjacent boundary edges (in degrees). \~
double GetAdjacentBoundaryEdgesAngleThreshold() const { return _thresholdVxAngle; }
OBVIOUS_PRIVATE_COPY( MbMeshSimplificationParams )
};
+424 -4
View File
@@ -11,13 +11,14 @@
#define __OP_POLYMESH_PARAMETERS_H
#include <math_define.h>
#include <polymesh.h>
#include <mb_placement3d.h>
#include <mb_data.h>
#include <templ_sptr.h>
#include <topology.h>
#include <curve3d.h>
#include <m2b_mesh_curvature.h>
class MbPolymesh;
class MbFaceShell;
class MbHalfedgeAttrSizetEdge;
class MbHalfedgeAttrDoubleEdge;
@@ -483,6 +484,7 @@ public:
Parameters may contain information about corresponding edges from polymeshes being merged - these edges will be marked as twins.
The first pair element is the edge index from the topology of a polymesh being copied.
The second pair element is the edge index from the topology of a polymesh accumulating merged objects. \~
\ingroup Polygonal_Objects
\warning \ru В разработке.
\en Under development. \~
*/
@@ -651,6 +653,7 @@ public:
Результаты содержат массив цепочек пар рёбер вдоль проекции.
\en Results of projecting a polyline on a polymesh. \n
Results contain paths of edge pairs along the projection. \~
\ingroup Polygonal_Objects
\warning \ru В разработке.
\en Under development. \~
*/
@@ -676,6 +679,193 @@ public:
};
//------------------------------------------------------------------------------
/** \brief \ru Перечисление для способа обработки результатов проецирования и других операций.
\en Enumeration for projection results processing method and other operations. \~
*/
// ---
enum class ProjProcessingMethod : uint
{
insert, ///< \ru Просто врезать в сетку. \en Just embed into a mesh.
splitSegmentation, ///< \ru Разбить сегментацию. \en Split a segmentation.
keepOuterPart, ///< \ru Оставить в сетке только внешнюю часть контура. \en Keep only outer part of contour.
keepInnerPart ///< \ru Оставить в сетке только внутреннюю часть контура. \en Keep only inner part of a contour.
};
//------------------------------------------------------------------------------
/** \brief \ru Параметры обрезки полигонального объекта набором кривых.
\en Parameters for cutting a polymesh with a set of curves. \~
\details \ru Параметры обрезки полигонального объекта набором кривых. \n
Сначала кривые линеаризуются с указанной точностью. Далее полученные
полилинии проецируются на сетку. Результат проецирования обрабатывается
указанным способом.
\en Parameters for cutting a polymesh with a set of curves. \n
First, curves are linearized with a given tolerance. Then the resulting
polylines are projected on a mesh. The projection results are processed
with a given method. \~
\ingroup Polygonal_Objects
\warning \ru В разработке.
\en Under development. \~
*/
// ---
class MATH_CLASS MbCurvePolymeshProjectParams : public MbPrecision
{
protected:
c3d::ConstSpaceCurvesSPtrVector _curves; ///< \ru Кривые. \en Curves. \~
std::vector<ProjProcessingMethod> _types; ///< \ru Способ обработки для каждой кривой. \en Processing method for an each curve. \~
MbStepData _stepData; ///< \ru Данные для расчета шага. \en Data for the step calculation. \~
public:
/// \ru Конструктор. \en Constructor.
MbCurvePolymeshProjectParams();
/// \ru Деструктор. \en Destructor.
~MbCurvePolymeshProjectParams();
public:
// \ru Получить кривую по индексу. \en Get the curve by index. \~
const c3d::ConstSpaceCurveSPtr & GetCurve( size_t iCrv ) const { return _curves[iCrv]; }
// \ru Получить способ обработки кривой по индексу. \en Get the curve processing method by index. \~
ProjProcessingMethod GetProcessingType( size_t iCrv ) const { return _types[iCrv]; }
// \ru Получить количество кривых. \en Get the curves count. \~
size_t CurveCount() const { return _curves.size(); }
// \ru Получить данные для расчета шага. \en Get data for the step calculation. \~
const MbStepData & GetStepData() const { return _stepData; }
// \ru Добавить кривую. \en Add the curve. \~
void AddCurve( const c3d::ConstSpaceCurveSPtr & crv, ProjProcessingMethod type );
// \ru Установить данные для расчета шага. \en Set data for the step calculation. \~
void SetStepData( const MbStepData & data ) { _stepData = data; }
OBVIOUS_PRIVATE_COPY( MbCurvePolymeshProjectParams );
};
//------------------------------------------------------------------------------
/** \brief \ru Параметры оффсета цепочки ребер полигонального объекта.
\en Parameters for polymesh edge pathes offsetting. \~
\details \ru Параметры оффсета цепочки ребер полигонального объекта. \n
\en Parameters for polymesh edge pathes offsetting. \~
\ingroup Polygonal_Objects
\warning \ru В разработке.
\en Under development. \~
*/
// ---
class MATH_CLASS MbPathPolymeshOffsetParams
{
public:
//------------------------------------------------------------------------------
/** \brief \ru Перечисление для способа обработки концов незамкнутых оффсетированных кривых.
\en Enumeration for ends processing method for open (non-closed) offset curves. \~
*/
// ---
enum class EndProcessingMethod
{
doNothing, ///< \ru Оставить как есть. \en Do nothing.
growToBoundary, ///< \ru Дорастить до открытой границы. \en Grow to the open mesh boundary.
connect, ///< \ru Соединить отрезком. \en Connect by the straight line.
round ///< \ru Скруглить. \en Make rounded.
};
private:
std::vector<c3d::IndicesPairsVector> _paths; ///< \ru Цепочки пар рёбер. \en Paths of edge pairs. \~
c3d::DoubleVector _offsetsLeft; ///< \ru Величина оффсета влево. \en Left offset value. \~
c3d::DoubleVector _offsetsRight; ///< \ru Величина оффсета вправо. \en Right offset value. \~
std::vector<EndProcessingMethod> _typesBeg; ///< \ru Способ обработки начал. \en Beginning processing method. \~
std::vector<EndProcessingMethod> _typesEnd; ///< \ru Способ обработки концов. \en End processing method. \~
std::vector<ProjProcessingMethod> _types; ///< \ru Способ обработки для каждой цепочки. \en Processing method for an each path. \~
public:
/// \ru Конструктор. \en Constructor.
MbPathPolymeshOffsetParams();
/// \ru Деструктор. \en Destructor.
~MbPathPolymeshOffsetParams();
// \ru Получить количество цепочек. \en Get the path count. \~
size_t PathCount() const { return _paths.size(); }
// \ru Получить цепочку. \en Get the path. \~
const c3d::IndicesPairsVector & GetEdgePairPath( size_t iPath ) const { return _paths[iPath]; }
// \ru Получить величину оффсета влево. \en Get the left offset value. \~
double GetOffsetLeft( size_t iPath ) const { return _offsetsLeft[iPath]; }
// \ru Получить величину оффсета вправо. \en Get the right offset value. \~
double GetOffsetRight( size_t iPath ) const { return _offsetsRight[iPath]; }
// \ru Получить способ обработки концов. \en Get the end processing method. \~
EndProcessingMethod GetEndProcessingMethod( size_t iPath, bool bEnd ) const { return bEnd ? _typesEnd[iPath] : _typesBeg[iPath]; }
// \ru Получить способ обработки цепочки. \en Get the path processing method. \~
ProjProcessingMethod GetProjProcessingMethod( size_t iPath ) const { return _types[iPath]; }
/** \brief \ru Добавить цепочку.
\en Add a path. \~
\details \ru Добавить цепочку.
\en Add a path. \~
\param[in] path - \ru Цепочка. \n
\en Path. \~
\param[in] offsetLeft - \ru Величина оффсета влево. \n
\en Left offset value. \~
\param[in] offsetRight - \ru Величина оффсета вправо. \n
\en Right offset value. \~
\param[in] typeBeg - \ru Способ обработки начала. \n
\en Method for the offset beginning processing. \~
\param[in] typeEnd - \ru Способ обработки конца. \n
\en Method for the offset end processing. \~
\param[in] method - \ru Способ обработки результата оффсета. \n
\en Method for the offset results processing. \~
*/
void AddPath( const c3d::IndicesPairsVector & path, double offsetLeft, double offsetRight, EndProcessingMethod typeBeg, EndProcessingMethod typeEnd, ProjProcessingMethod method );
// \ru Получить все цепочки. \en Get all pathes. \~
const std::vector<c3d::IndicesPairsVector> & GetEdgePairPathes() const { return _paths; }
OBVIOUS_PRIVATE_COPY( MbPathPolymeshOffsetParams );
};
//------------------------------------------------------------------------------
/** \brief \ru Результаты обрезки полигонального объекта набором кривых.
\en Results of cutting a polymesh with a set of curves. \~
\details \ru Результаты обрезки полигонального объекта набором кривых. \n
Результаты содержат массивы цепочек пар рёбер вдоль проекции каждой кривой
и флаги пересечения и самопересечения.
\en Results of cutting a polymesh with a set of curves. \n
Results contain paths of edge pairs along the projection of an each curve,
and intersection and self-intersection flags. \~
\ingroup Polygonal_Objects
\warning \ru В разработке.
\en Under development. \~
*/
// ---
class MATH_CLASS MbPolymeshProjectResults
{
private:
std::vector<std::vector<c3d::IndicesPairsVector>> _paths; //< \ru Цепочки пар рёбер. \en Paths of edge pairs. \~
bool _bIntersection; ///< \ru Флаг наличия пересечений. \en An intersections flag. \~
bool _bSelfIntersection; ///< \ru Флаг наличия самопересечений. \en A self-intersections flag. \~
public:
/// \ru Конструктор. \en Constructor.
MbPolymeshProjectResults();
/// \ru Деструктор. \en Destructor.
~MbPolymeshProjectResults();
public:
// \ru Получить количество кривых. \en Get the curves count. \~
size_t CurveCount() const { return _paths.size(); }
// \ru Получить количество цепочек для кривой. \en Get the pathes count for a curve. \~
size_t CurvePathCount( size_t iCrv ) const { return _paths[iCrv].size(); }
// \ru Получить цепочку для кривой. \en Get the path for a curve. \~
const c3d::IndicesPairsVector & GetEdgePairPath( size_t iCrv, size_t iPath ) const { return _paths[iCrv][iPath]; }
// \ru Получить цепочку для кривой. \en Get the path for a curve. \~
c3d::IndicesPairsVector & GetEdgePairPath( size_t iCrv, size_t iPath ) { return _paths[iCrv][iPath]; }
// \ru Проверить наличие пересечений. \en Check for intersections. \~
bool HasIntersections() const { return _bIntersection; }
// \ru Проверить наличие самопересечений. \en Check for self-intersections. \~
bool HasSelfIntersections() const { return _bSelfIntersection; }
// \ru Инициализировать данные. \en Initialize data.
void Init( const std::vector<std::vector<c3d::IndicesPairsVector>> & paths, bool bIntersect, bool bSelfintersect );
OBVIOUS_PRIVATE_COPY( MbPolymeshProjectResults );
};
//------------------------------------------------------------------------------
/** \brief \ru Параметры заполнения отверстия, заданного замкнутой кривой.
\en Parameters for filling a hole defined by a closed curve. \~
@@ -683,6 +873,7 @@ public:
Параметры содержат точки на границе отверстия.
\en Parameters for filling a hole defined by a closed curve. \n
Parameters contain points on the hole's boundary. \~
\ingroup Polygonal_Objects
\warning \ru В разработке.
\en Under development. \~
*/
@@ -715,6 +906,7 @@ public:
Параметры содержат индексы рёбер на границе отверстия.
\en Parameters for filling a polygonal object hole. \n
Parameters contain the indices of the edges from the hole's boundary. \~
\ingroup Polygonal_Objects
\warning \ru В разработке.
\en Under development. \~
*/
@@ -723,10 +915,10 @@ class MATH_CLASS MbFillPolymeshHoleParams
{
public:
//------------------------------------------------------------------------------
/** \brief \ru Перечисление методов заполнения отверстия.
/** \brief \ru Перечисление методов заполнения отверстия.
\en Enumeration for filling methods. \~
*/
// ---
*/
// ---
enum class MethodFillPolymeshHole
{
full, ///< \ru Полный. \en Full.
@@ -775,6 +967,7 @@ public:
\en Parameters for calculation of normal vectors at the vertices of a polygonal object. \~
\details \ru Параметры расчета нормалей в вершинах полигонального объекта. \n
\en Parameters for calculation of normal vectors at the vertices of a polygonal object. \~
\ingroup Polygonal_Objects
\warning \ru В разработке.
\en Under development. \~
*/
@@ -799,4 +992,231 @@ public:
OBVIOUS_PRIVATE_COPY( MbPolymeshNormalsParams );
};
//------------------------------------------------------------------------------
/** \brief \ru Критерий сегментации полигонального объекта.
\en A criterion for segmenting a polygonal object. \~
\ingroup Polygonal_Objects
*/
// ---
enum class MbeSegmentationCriterion
{
openBoundary = 0, ///< \ru Критерий открытой границы. \en Open boundary criterion.
sharpEdges = 1, ///< \ru Критерий острых рёбер. \en Sharp edges criterion.
curvature = 2 ///< \ru Критерий кривизны. \en Curvature criterion.
};
//------------------------------------------------------------------------------
/** \brief \ru Параметры сегментации полигонального объекта.
\en Parameters for segmenting a polygonal object. \~
\details \ru Параметры сегментации полигонального объекта.
Есть возможность сегментировать по открытым границам, по острым сломам, по кривизне.
\en Parameters for segmenting a polygonal object.
It can be segmented based on open boundaries, on sharp edges, on curvature. \~
\warning \ru В разработке.
\en Under development. \~
*/
// ---
class MATH_CLASS MbSegmentationParams
{
private:
MbeSegmentationCriterion _criterion; ///< \ru Критерий сегментации. \en Segmentation criterion. \~
double _angleSharp; ///< \ru Порог угла для острых рёбер (в градусах). \en The angle threshold for sharp edges (in degrees). \~
double _curvMaxValue; ///< \ru Значение порога кривизны. \en The curvature threshold value. \~
MbeCurvatureType _curvType; ///< \ru Тип порога кривизны. \en The curvature threshold type. \~
c3d::IndicesVector _regions; ///< \ru Выбранные для сегментации регионы. \en The regions to be segmented. \~
bool _bKeep; ///< \ru Сохранять имеющуюся сегментацию (при наличии). \en Keep the existing segmentation (if exists). \~
public:
/// \ru Конструктор. \en Constructor.
MbSegmentationParams()
: _criterion ( MbeSegmentationCriterion::openBoundary )
, _angleSharp ( MB_MAXDOUBLE )
, _curvMaxValue( MB_MAXDOUBLE )
, _curvType ( MbeCurvatureType::mean )
, _regions ( )
, _bKeep ( true )
{
}
/// \ru Деструктор. \en Destructor.
~MbSegmentationParams() {}
public:
/// \ru Инициализировать параметры сегментации по острым углам (в градусах). \en Initialize the parameters with sharp edges (in degrees). \~
void InitializeWithSharpEdges( double angleSharp )
{
_criterion = MbeSegmentationCriterion::sharpEdges;
_angleSharp = angleSharp;
}
/// \ru Инициализировать параметры сегментации по кривизне. \en Initialize the parameters with a curvature value. \~
void InitializeWithCurvature( double curvMaxValue, MbeCurvatureType curvType )
{
_criterion = MbeSegmentationCriterion::curvature;
_curvMaxValue = curvMaxValue;
_curvType = curvType;
}
/// \ru Получить критерий сегментации. \en Get the segmentation criterion. \~
MbeSegmentationCriterion GetCriterion() const { return _criterion; }
/// \ru Получить порог угла для острых рёбер (в градусах). \en Get the angle threshold for sharp edges (in degrees). \~
double GetAngleSharp() const { return _angleSharp; }
/// \ru Получить порог кривизны. \en Get the curvature threshold value. \~
double GetMaxCurvatureValue() const { return _curvMaxValue; }
/// \ru Получить тип порога кривизны. \en Get the curvature threshold type. \~
MbeCurvatureType GetCurvatureType() const { return _curvType; }
/// \ru Получить выбранные регионы для редактирования. \en Get the selected regions for editing. \~
c3d::IndicesVector & GetSelectedRegions() { return _regions; }
/// \ru Получить выбранные регионы. \en Get the selected regions. \~
const c3d::IndicesVector & GetSelectedRegions() const { return _regions; }
/// \ru Установить флаг сохранения имеющейся сегментации. \en Set the flag of keeping the existing segmentation. \~
void SetKeepExisting( bool bKeep ) { _bKeep = bKeep; }
/// \ru Получить флаг сохранения имеющейся сегментации. \en Get the flag of keeping the existing segmentation. \~
bool GetKeepExisting() const { return _bKeep; }
/// \ru Установить параметры по умолчанию. \en Reset parameters. \~
void ResetParameters()
{
_criterion = MbeSegmentationCriterion::openBoundary;
_angleSharp = MB_MAXDOUBLE;
_curvMaxValue = MB_MAXDOUBLE;
_curvType = MbeCurvatureType::mean;
_regions.clear();
_bKeep = true;
}
OBVIOUS_PRIVATE_COPY( MbSegmentationParams );
};
//------------------------------------------------------------------------------
/** \brief \ru Параметры лечения сегментации полигонального объекта.
\en Parameters for repairing the segmentation of a polygonal object. \~
\details \ru Параметры лечения сегментации полигонального объекта.
После сегментирования полигонального объекта вероятно появление мелких регионов.
Их можно устранить за счет объединения с соседними регионами.
Также есть возможность удалить внутренние рёбра сегментации.
\en Parameters for repairing the segmentation of a polygonal object.
Segmenting can generate small regions - they can be fixed through merging with neighboring ones.
Is it also possible to remove inner segmentation edges. \~
\warning \ru В разработке.
\en Under development. \~
*/
// ---
class MATH_CLASS MbRepairSegmentationParams
{
private:
bool _bFixSmall; ///< \ru Устранить мелкие регионы. \en Fix small regions. \~
double _areaThreshold; ///< \ru Порог площади региона. \en Region area threshold. \~
bool _bRemoveInner; ///< \ru Удалить внутренние рёбра. \en Remove inner edges. \~
public:
/// \ru Конструктор по умолчанию. \en Default constructor.
MbRepairSegmentationParams()
: _bFixSmall ( true )
, _areaThreshold( -1. )
, _bRemoveInner ( true )
{
}
/// \ru Конструктор с параметрами. \en Constructor with parameters.
MbRepairSegmentationParams( bool bFixSmallRegions, double areaThreshold, bool bRemoveInnerEdges )
: _bFixSmall ( bFixSmallRegions )
, _areaThreshold( areaThreshold )
, _bRemoveInner ( bRemoveInnerEdges )
{
}
/// \ru Деструктор. \en Destructor.
~MbRepairSegmentationParams() {}
public:
/// \ru Установить флаг устранения мелких регионов. \en Set the flag of fixing small regions. \~
void SetFixSmallRegions( bool bFixSmallRegions ) { _bFixSmall = bFixSmallRegions; }
/// \ru Получить флаг устранения мелких регионов. \en Get the flag of fixing small regions. \~
bool GetFixSmallRegions() const { return _bFixSmall; }
/// \ru Установить порог площади региона. \en Set region area threshold. \~
void SetAreaThreshold( double areaThreshold ) { _areaThreshold = areaThreshold; }
/// \ru Получить порог площади региона. \en Get region area threshold. \~
double GetAreaThreshold() const { return _areaThreshold; }
/// \ru Установить флаг удаления внутренних рёбер. \en Set the flag of removing inner edges. \~
void SetRemoveInnerEdges( bool bRemoveInnerEdges ) { _bRemoveInner = bRemoveInnerEdges; }
/// \ru Получить флаг удаления внутренних рёбер. \en Get the flag of removing inner edges. \~
bool GetRemoveInnerEdges() const { return _bRemoveInner; }
OBVIOUS_PRIVATE_COPY( MbRepairSegmentationParams );
};
//------------------------------------------------------------------------------
/** \brief \ru Параметры булевой операции для двух полигональных объектов.
\en Parameters of a boolean operation with two polygonal objects. \~
\details \ru Параметры булевой операции для двух полигональных объектов. \n
\en Parameters of a boolean operation with two polygonal objects. \~
\ingroup Polygonal_Objects
\warning \ru В разработке.
\en Under development. \~
*/
// ---
class MATH_CLASS MbPolymeshBooleanParams : public MbPrecision
{
public:
//------------------------------------------------------------------------------
/** \brief \ru Перечисление типов булевой операции.
\en Enumeration for boolean operation type. \~
*/
// ---
enum class OpType
{
opUnion, ///< \ru Объединение. \en Union. \~
opSubtraction, ///< \ru Вычитание. \en Subtraction. \~
opIntersection, ///< \ru Пересечение. \en Intersection. \~
opNonManifold ///< \ru Неманифолдная сетка. \en Non-manifold mesh. \~
};
private:
OpType _type; ///< \ru Тип булевой операции. \en Boolean operation type. \~
public:
/// \ru Конструктор. \en Constructor.
MbPolymeshBooleanParams( OpType type, double tolerance );
/// \ru Деструктор. \en Destructor.
~MbPolymeshBooleanParams() {}
/// \ru Получить тип булевой операции. \en Get boolean operation type. \~
OpType GetOperationType() const { return _type; }
OBVIOUS_PRIVATE_COPY( MbPolymeshBooleanParams );
};
//------------------------------------------------------------------------------
/** \brief \ru Результаты булевой операции для двух полигональных объектов.
\en Results of a boolean operation with two polygonal objects. \~
\details \ru Результаты булевой операции для двух полигональных объектов. \n
\en Results of a boolean operation with two polygonal objects. \~
\ingroup Polygonal_Objects
\warning \ru В разработке.
\en Under development. \~
*/
// ---
class MATH_CLASS MbPolymeshBooleanResults
{
private:
c3d::IndicesVector _changedSubregions; ///< \ru Индексы измененных подрегионов. \en Changed subregions indicies. \~
c3d::IndicesVector _addedSubregions; ///< \ru Индексы добавленных подрегионов. \en Added subregions indicies. \~
c3d::IndicesVector _deletedSubregions; ///< \ru Индексы удаленных подрегионов. \en Deleted subregions indicies. \~
public:
/// \ru Конструктор. \en Constructor.
MbPolymeshBooleanResults() {}
/// \ru Деструктор. \en Destructor.
~MbPolymeshBooleanResults() {}
// \ru Инициализировать данные. \en Initialize data.
void Init( const c3d::IndicesVector & changed, const c3d::IndicesVector & added, const c3d::IndicesVector & deleted );
// \ru Получить индексы измененных подрегионов. \en Get changed subregions indicies.
const c3d::IndicesVector & GetChangedSubregions() const { return _changedSubregions; }
// \ru Получить индексы добавленных подрегионов. \en Get added subregions indicies.
const c3d::IndicesVector & GetAddedSubregions() const { return _addedSubregions; }
// \ru Получить индексы удаленных подрегионов. \en Get deleted subregions indicies.
const c3d::IndicesVector & GetDeletedSubregions() const { return _deletedSubregions; }
OBVIOUS_PRIVATE_COPY( MbPolymeshBooleanResults );
};
#endif // __OP_POLYMESH_PARAMETERS_H
+309 -10
View File
@@ -2203,6 +2203,8 @@ private:
bool defaultDir1; ///< \ru Направление сопряжения на границе 1 по умолчанию. \en Default mate direction through the boundary 1.
bool defaultDir2; ///< \ru Направление сопряжения на границе 2 по умолчанию. \en Default mate direction through the boundary 2.
bool defaultDir3; ///< \ru Направление сопряжения на границе 3 по умолчанию. \en Default mate direction through the boundary 3.
bool outDirs[4]; /// \ru Направления сопряжений для случая смены типа автопределения направления для сохранения формы ППСК.
/// \en Mating direction in case of changing the type of automatic direction detection to maintain the surface shape.
bool autoDirection; ///< \ru Тип автоопределения направления \en Type of automatic direction detection
mutable uint8 directOrderV;///< \ru По второму семейству кривых порядок кривых совпадает. \en Order of the curves coincides by the second set of curves.
bool tesselate; ///< \ru Достраивать ли дополнительные сечения. \en Whether to build additional sections.
@@ -2399,6 +2401,8 @@ public:
void SetSurface( size_t i, c3d::SurfacesVector & surfaces );
/// \ru Получить направление сопряжения на границе с номером i. \en Get i-th mate direction on the boundary.
bool IsDefaultDirection( size_t i ) const;
/// \ru Установить направление сопряжения на границе с номером i. \en Set mate direction at the i-th boundary.
void SetDefaultDirection( size_t i, bool fl );
/// \ru Замкнутость по U направлению. \en Closedness along U direction.
bool GetUClosed() const { return uClosed; }
@@ -2528,6 +2532,12 @@ public:
void SetAutoDirection( bool fl ) { autoDirection = fl; }
/// \ru Получить тип автоопределения направления \en Get the auto-detect direction type.
bool GetAutoDirection() const { return autoDirection; }
// \ru Установить направления сопряжений для случая смены типа автопределения направления для сохранения форма ППСК
// \en Set the mating direction in case of changing the type of automatic direction detection to maintain the surface shape.
void SetOutDirection( size_t bnd, bool outD ) { outDirs[bnd > 3 ? 3 : bnd] = outD; }
// \ru Получить направления сопряжений для случая смены типа автопределения направления для сохранения форма ППСК
// \en Get the mating direction in case of changing the type of automatic direction detection to maintain the surface shape.
bool GetOutDirection( size_t bnd ) const { return outDirs[bnd > 3 ? 3 : bnd]; }
/// \ru Получить поверхность сопряжения к граничной кривой по параметру на кривой.
/// \en Get the mating surface to the border curve by the curve parameter.
@@ -2573,6 +2583,60 @@ OBVIOUS_PRIVATE_COPY( MeshSurfaceValues )
};
//------------------------------------------------------------------------------
/** \brief \ru Результаты построения поверхности по сети кривых.
\en Results of construction of a shell by mesh of curves. \~
\details \ru Результаты построения поверхности по сети кривых.
\en Results of construction of a shell by mesh of curves. \~
\ingroup Shell_Building_Parameters
*/
// ---
class MATH_CLASS MbMeshShellResults : public MbOperationResults {
private:
c3d::SolidSPtr _solid; // \ru Оболочка \en Result shell.
bool _outDirs[4]; // \ru Направления сопряжений для случая смены типа автопределения направления для сохранения форма ППСК
// \en Mating direction in case of changing the type of automatic direction detection to maintain the surface shape.
public:
MbMeshShellResults()
: MbOperationResults()
, _solid ()
{
for( size_t i = 0; i < 4; i++ )
_outDirs[i] = false;
}
/// \ru Конструктор копирования. \en Copy-constructor.
MbMeshShellResults( const MbMeshShellResults & other )
: MbOperationResults( other )
, _solid ( other._solid )
{
for( size_t i = 0; i < 4; i++ )
_outDirs[i] = other._outDirs[i];
}
~MbMeshShellResults() {}
/// \ru Оператор присваивания. \en Assignment operator.
MbMeshShellResults & operator = ( const MbMeshShellResults & other ) {
MbOperationResults::operator =( static_cast<const MbOperationResults &>(other) );
_solid = other._solid;
for( size_t i = 0; i < 4; i++ )
_outDirs[i] = other._outDirs[i];
return *this;
}
/// \ru Получить результирующее тело. \en Get resulting solid.
c3d::SolidSPtr GetResultSolid() const { return _solid; }
/// \ru Получить результирующее тело. \en Get resulting solid.
c3d::SolidSPtr & SetResultSolid() { return _solid; }
// \ru Получить направления сопряжений для случая смены типа автопределения направления для сохранения форма ППСК
// \en Get the mating direction in case of changing the type of automatic direction detection to preserve the surface shape.
bool GetOutDirection( size_t bnd ) const { return _outDirs[bnd > 3 ? 3 : bnd]; }
/// \ru Функция инициализации. \en Initialization function.
void Init ( MbSolid & s, const bool (&dirFlags)[4] ){
_solid = &s;
for( size_t i = 0; i < 4; i++ )
_outDirs[i] = dirFlags[i];
}
};
//------------------------------------------------------------------------------
/** \brief \ru Параметры построения поверхности по сети кривых.
\en Parameters for creating the shell by mesh of curves. \~
@@ -2637,10 +2701,10 @@ private:
MbCurve3D * curve1; ///< \ru Вторая кривая. \en The second curve.
SArray<double> breaks0; ///< \ru Параметры разбиения первой кривой curve0. \en Splitting parameters of the first curve0 curve.
SArray<double> breaks1; ///< \ru Параметры разбиения второй кривой curve1. \en Splitting parameters of the second curve1 curve.
bool joinByVertices; ///< \ru Соединять контура с одинаковым количеством сегментов через вершины. \en Join contour with the same count of segments through vertices.
bool joinByVertices; ///< \ru Соединять контура с одинаковым количеством сегментов через вершины. \en Join contours with the same count of segments through vertices.
bool checkSelfInt; ///< \ru Искать самопересечения. \en Find self-intersections.
bool simplifyFaces; ///< \ru Упрощать грани. \en SimplifyFaces.
bool proportional; ///< \ru Пропорциональная натуральной параметризация кривых. \en Proportional to the natural parameterization of curves.
bool simplifyFaces; ///< \ru Упрощать грани. \en Simplify faces.
bool proportional; ///< \ru Пропорциональная натуральной параметризация кривых. \en Parameterization of curves is proportional to the natural.
double mismatchMax; ///< \ru Допустимое несовпадение противолежащих точек стыковки сегментов. \en Permissible mismatch of opposite points of connecting segments.
bool segmentSplit; ///< \ru Разделять оболочку на грани по сегментам контуров. \en Divide the shell into faces by contour segments.
@@ -4309,6 +4373,194 @@ OBVIOUS_PRIVATE_COPY ( MbShellCuttingParams )
};
//------------------------------------------------------------------------------
/** \brief \ru Параметры операции усечения оболочки.
\en Shell truncating operation parameters. \~
\details \ru Параметры операции усечения оболочки. \n
\en Shell truncating operation parameters. \n \~
\ingroup Shell_Building_Parameters
\warning \ru В разработке.
\en Under development. \~
*/
// ---
class MATH_CLASS MbTruncateShellParams : public MbPrecision {
private:
c3d::IndicesVector _selIndices; ///< \ru Номера выбранных граней (если массив пуст, то вся оболочка). \en The numbers of selected faces (if the array is empty, the whole shell is selected).
c3d::SpaceItemsSPtrVector _truncatingItems; ///< \ru Усекающие объекты ( кривые, поверхности или тела ). \en Truncating objects ( curves, surfaces or solids ).
c3d::BoolVector _truncatingOrients; ///< \ru Ориентации усекающих объектов. \en The truncating objects orientations.
MbeCopyMode _truncatingCopyMode; ///< \ru Режим копирования усекающих оболочек. \en Whether to copy the truncating shells.
bool _truncatingSplitMode; ///< \ru Кривые используются как линии разъема. \en The curves are used as parting lines.
MbMergingFlags _mergeFlags; ///< \ru Флаги слияния элементов оболочки. \en Control flags of shell items merging.
c3d::SNameMakerSPtr _nameMaker; ///< \ru Именователь. \en An object for naming the new objects.
private:
MbTruncateShellParams(); /// \ru Конструктор по умолчанию. Запрещен. \en. Default constructor. Forbidden.
public:
/** \brief \ru Конструктор.
\en Constructor. \~
\details \ru Конструктор по набору граней, усекающим объектам и их ориентациям. \n
\en Constructor by set of curves and object defining names generation in the operation. \n \~
\param[in] selIndices - \ru Номера выбранных граней.
\en The numbers of selected faces. \~
\param[in] truncatingItems - \ru Усекающие объекты ( кривые, поверхности или тела ).
\en Truncating objects ( curves, surfaces or solids ). \~
\param[in] truncatingOrients - \ru Ориентации усекающих объектов.
\en The truncating objects orientations. \~
\param[in] truncatingCopyMode - \ru Режим копирования усекающих оболочек.
\en Whether to copy the truncating shells. \~
\param[in] truncatingSplitMode - \ru Кривые используются как линии разъема.
\en The curves are used as parting lines. \~
\param[in] mergeFlags - \ru Флаги слияния элементов оболочки.
\en Control flags of shell items merging. \~
\param[in] nameMaker - \ru Именователь.
\en An object for naming the new objects. \~
*/
template<class IndicesVec, class ItemVec, class BoolVec>
MbTruncateShellParams( const IndicesVec & selIndices,
ItemVec & truncatingItems,
const BoolVec & truncatingOrients,
MbeCopyMode truncatingCopyMode,
bool truncatingSplitMode,
MbMergingFlags mergeFlags,
const MbSNameMaker & nameMaker );
/// \ru Деструктор. \en Destructor. \~
~MbTruncateShellParams() {};
public:
/// \ru Получить номера выбранных граней. \en Get the numbers of selected faces.
void GetIndices( c3d::IndicesVector & indices ) const { indices.assign( _selIndices.begin(), _selIndices.end() ); }
/// \ru Получить усекающие объекты. \en Get the truncating objects.
void GetTruncateItems( c3d::SpaceItemsSPtrVector & items ) const { items.assign( _truncatingItems.begin(), _truncatingItems.end() ); }
/// \ru Получить ориентации усекающих объектов. \en Get the truncating objects orientation.
void GetTruncateOrients( c3d::BoolVector & orients ) const { orients.assign( _truncatingOrients.begin(), _truncatingOrients.end() ); }
/// \ru Режим копирования усекающих оболочек. \en Whether to copy the truncating shells.
MbeCopyMode GetTruncateCopyMode() const { return _truncatingCopyMode; }
/// \ru Кривые используются как линии разъема. \en The curves are used as parting lines.
bool GetTruncateSplitMode() const { return _truncatingSplitMode; }
/// \ru Флаги слияния элементов оболочки. \en Control flags of shell items merging.
const MbMergingFlags & GetMerging() const { return _mergeFlags; }
/// \ru Получить именователь операции. \en Get the object defining names generation in the operation.
const MbSNameMaker & GetNameMaker() const { return *_nameMaker; }
private:
/// \ru Инициализация параметров операции усечения. \en The initialization of truncating operation parameters.
template<class IndicesVec, class ItemVec, class BoolVec>
void InitTruncateParams( const IndicesVec & indices, ItemVec & items, const BoolVec & orients );
OBVIOUS_PRIVATE_COPY( MbTruncateShellParams )
};
//------------------------------------------------------------------------------
// \ru Шаблонный конструктор. \en The Template constructor.
// ---
template<class IndicesVec, class ItemVec, class BoolVec >
MbTruncateShellParams::MbTruncateShellParams( const IndicesVec & indices,
ItemVec & items,
const BoolVec & orients,
MbeCopyMode copyMode,
bool splitMode,
MbMergingFlags mergeFlags,
const MbSNameMaker & names )
: MbPrecision()
, _selIndices( )
, _truncatingItems( )
, _truncatingOrients( )
, _truncatingCopyMode( copyMode )
, _truncatingSplitMode( splitMode )
, _mergeFlags( mergeFlags )
, _nameMaker ( &(names.Duplicate()) )
{
InitTruncateParams( indices, items, orients );
}
//------------------------------------------------------------------------------
// \ru Инициализация параметров операции усечения. \en The initialization of truncating operation parameters.
// ---
template<class IndicesVec, class ItemVec, class BoolVec>
void MbTruncateShellParams::InitTruncateParams( const IndicesVec & indices, ItemVec & items, const BoolVec & orients )
{
const size_t indicesCnt = indices.size();
const size_t itemsCnt = items.size();
const size_t orientsCnt = orients.size();
_truncatingItems.clear();
_truncatingItems.reserve( itemsCnt );
for ( size_t i = 0; i < itemsCnt; ++i ) {
MbSpaceItem * item = items[i];
if ( item != nullptr )
_truncatingItems.emplace_back( item );
}
_truncatingOrients.clear();
_truncatingOrients.reserve( orientsCnt );
for ( size_t i = 0; i < orientsCnt; ++i )
_truncatingOrients.push_back( orients[i] );
_selIndices.clear();
_selIndices.reserve( indicesCnt );
for ( size_t i = 0; i < indicesCnt; ++i )
_selIndices.push_back( indices[i] );
}
//------------------------------------------------------------------------------
/** \brief \ru Результаты операции усечения оболочки.
\en Results of shell truncating operation. \~
\details \ru Результаты операции усечения оболочки.
\en Results of shell truncating operation. \~
\ingroup ingroup Shell_Building_Parameters
\warning \ru В разработке.
\en Under development. \~
*/
// ---
class MbTruncateShellResults {
private:
c3d::SolidSPtr _solid; ///< \ru Результирующее тело. \en The resulting solid.
MbPlacement3D _resultPlace; ///< \ru Фантомное направление усечения. \en A phantom direction of truncation.
public:
/// \ru Конструктор. \en Constructor.
MbTruncateShellResults()
: _solid()
, _resultPlace()
{}
/// \ru Деструктор. \en Destructor.
~MbTruncateShellResults() {}
/// \ru Конструктор копирования. \en Copy-constructor.
MbTruncateShellResults( const MbTruncateShellResults & other )
: _solid( other._solid )
, _resultPlace( other._resultPlace )
{
}
/// \ru Оператор присваивания. \en Assignment operator.
MbTruncateShellResults & operator = ( const MbTruncateShellResults & other ) {
_solid = other._solid;
_resultPlace = other._resultPlace;
return *this;
}
public:
/// \ru Функция инициализации. \en Initialization function.
void Init( const c3d::SolidSPtr & solid, const MbPlacement3D & resultPlace ) {
_solid = solid;
_resultPlace = resultPlace;
}
/// \ru Получить результирующее тело. \en Get resulting solid.
c3d::SolidSPtr GetResultSolid() const { return _solid; }
/// \ru Получить фантомное направление усечения. \en Get phantom direction of truncation.
const MbPlacement3D & GetResultPlace() const { return _resultPlace; }
/// \ru Отцепить результирующее тело. \en Detach resulting solid.
MbSolid * DetachSolid() { return _solid.detach(); }
};
//------------------------------------------------------------------------------
// \ru Установить требование по оставляемой части. \en Set retained part demand.
// ---
@@ -4735,6 +4987,7 @@ private:
MbSNameMaker _names; ///< \ru Именователь. \en An object defining names generation in the operation.
SimpleName _name; ///< \ru Идентификатор. \en An identifier.
private:
MbLoftedCurvesShellParams(); /// \ru Конструктор по умолчанию. Запрещен. \en. Default constructor. Forbidden.
public:
@@ -5573,7 +5826,7 @@ public:
\ingroup Shell_Building_Parameters
*/
// ---
class MATH_CLASS MbRuledShellParams
class MATH_CLASS MbRuledShellParams : public MbPrecision
{
private:
RuledSurfaceValues _pars; ///< \ru Параметры операции.\en The operation parameters. \~
@@ -5607,6 +5860,8 @@ public:
void SetPhantom ( bool isPhantom ) { _isPhantom = isPhantom; }
/// \ru Получить параметры операции. \en Get the operation parameters. \~
const RuledSurfaceValues & GetParams() const { return _pars; }
/// \ru Изменить параметры операции. \en Change the operation parameters. \~
RuledSurfaceValues & SetParams() { return _pars; }
/// \ru Оператор копирования. \en Copy operator. \~
void operator = ( const MbRuledShellParams & other );
@@ -6827,9 +7082,9 @@ public:
class MATH_CLASS MbJoinShellParams
{
protected:
c3d::EdgesSPtrVector _edges1; ///< \ru Первый набор ребер. \en The first set of edges. \~
c3d::ConstEdgesSPtrVector _edges1; ///< \ru Первый набор ребер. \en The first set of edges. \~
c3d::BoolVector _orients1; ///< \ru Ориентация рёбер первого набора. \en Orientation of edges from the first set. \~
c3d::EdgesSPtrVector _edges2; ///< \ru Второй набор ребер. \en The second set of edges. \~
c3d::ConstEdgesSPtrVector _edges2; ///< \ru Второй набор ребер. \en The second set of edges. \~
c3d::BoolVector _orients2; ///< \ru Ориентация рёбер второго набора. \en Orientation of edges of the second set. \~
MbMatrix3D _matr1; ///< \ru Матрица преобразования рёбер первого набора. \en Transformation matrix of edges from the first set. \~
MbMatrix3D _matr2; ///< \ru Матрица преобразования рёбер второго набора. \en Transformation matrix of edges from the second set. \~
@@ -6863,13 +7118,14 @@ public:
\param[in] isPhantom - \ru Режим создания фантома.
\en Create in the phantom mode. \~
*/
DEPRECATE_DECLARE_REPLACE ( Constructor with ConstEdgesSPtrVector )
MbJoinShellParams( const c3d::EdgesSPtrVector & edges1, const c3d::BoolVector & orients1,
const c3d::EdgesSPtrVector & edges2, const c3d::BoolVector & orients2,
const MbMatrix3D & matr1, const MbMatrix3D & matr2, const JoinSurfaceValues & parameters,
const MbSNameMaker & names, bool isPhantom = false )
: _edges1 ( edges1 )
: _edges1 ( )
, _orients1 ( orients1 )
, _edges2 ( edges2 )
, _edges2 ( )
, _orients2 ( orients2 )
, _matr1 ( matr1 )
, _matr2 ( matr2 )
@@ -6878,6 +7134,49 @@ public:
, _isPhantom ( isPhantom )
, _curve1 ( )
, _curve2 ( )
{
_edges1.assign( edges1.begin(), edges1.end() );
_edges2.assign( edges2.begin(), edges2.end() );
}
/** \brief \ru Конструктор параметров оболочки соединения.
\en A shell of join parameter constructor. \~
\details \ru Конструктор параметров оболочки соединения по двум наборам ребер.
\en Constructor of parameters for creating a shell of join given two sets of edges. \~
\param[in] edges1 - \ru Первый набор ребер.
\en The first set of edges. \~
\param[in] orients1 - \ru Ориентации ребер первого набора.
\en The edges senses in the first set. \~
\param[in] edges2 - \ru Второй набор ребер.
\en The second set of edges. \~
\param[in] orients2 - \ru Ориентации ребер второго набора.
\en The edges senses in the second set. \~
\param[in] matr1 - \ru Матрица преобразования первого набора ребер в единую систему координат.
\en The matrix of transformation of the first set of edges to the common coordinate system. \~
\param[in] matr2 - \ru Матрица преобразования второго набора ребер в единую систему координат.
\en The matrix of transformation of the second set of edges to the common coordinate system. \~
\param[in] parameters - \ru Параметры операции.
\en The operation parameters. \~
\param[in] names - \ru Именователь операции.
\en An object for naming the new objects. \~
\param[in] isPhantom - \ru Режим создания фантома.
\en Create in the phantom mode. \~
*/
MbJoinShellParams( const c3d::ConstEdgesSPtrVector & edges1, const c3d::BoolVector & orients1,
const c3d::ConstEdgesSPtrVector & edges2, const c3d::BoolVector & orients2,
const MbMatrix3D & matr1, const MbMatrix3D & matr2, const JoinSurfaceValues & parameters,
const MbSNameMaker & names, bool isPhantom = false )
: _edges1 ( edges1 )
, _orients1 ( orients1 )
, _edges2 ( edges2 )
, _orients2 ( orients2 )
, _matr1 ( matr1 )
, _matr2 ( matr2 )
, _parameters( parameters )
, _names ( &names.Duplicate() )
, _isPhantom ( isPhantom )
, _curve1 ( )
, _curve2 ( )
{
}
@@ -6919,9 +7218,9 @@ public:
/// \ru Установить параметры операции. \en Set the operation parameters.
JoinSurfaceValues & SetParams() { return _parameters; }
/// \ru Получить исходный набор первых ребер. \en Get the initial set of the first edges.
const c3d::EdgesSPtrVector & GetFirstEdges() const { return _edges1; }
const c3d::ConstEdgesSPtrVector & GetFirstEdges() const { return _edges1; }
/// \ru Получить исходный набор вторых ребер. \en Get the initial set of the second edges.
const c3d::EdgesSPtrVector & GetSecondEdges() const { return _edges2; }
const c3d::ConstEdgesSPtrVector & GetSecondEdges() const { return _edges2; }
/// \ru Получить исходный набор ориентации первых ребер. \en Get the initial set of the first edges orientations.
const c3d::BoolVector & GetFirstOrientations() const { return _orients1; }
/// \ru Получить исходный набор ориентации вторых ребер. \en Get the initial set of the second edges orientations.
+214
View File
@@ -17,6 +17,8 @@
class MbTrimmedWireFrameInfo;
class MbProjWireFrameParamsData;
class MbSolid;
//------------------------------------------------------------------------------
@@ -543,4 +545,216 @@ public:
};
//------------------------------------------------------------------------------
/** \brief \ru Параметры операции построения проекции каркаса на тело, набор
граней или поверхность.
\en The parameters for creating a projection of a wireframe to a
solid, set of faces or a surface. \~
\details \ru Содержит параметры, необходимые для построения проекции набора кривых по нормали или по направлению
на тело, набор граней или поверхность. \n
\en Contains parameters required for normal or vector projection of a set of curves to a solid, set of faces
or a surface. \n \~
\ingroup WireFrame_Parameters
\warning \ru В разработке.
\en Under development. \~
*/
// ---
class MATH_CLASS MbProjectionWireFrameParams : public MbPrecision {
private:
const MbVector3D * _direction; ///< \ru Вектор направления проецирования (если не задан, то проекция по нормали). \en The direction of the vector projection (if not provided, normal projection is performed).
bool _projOnParallel; ///< \ru Создавать ли проекции на поверхностях параллельных заданному вектору проецирования. \en Should the projection be performed onto surfaces parallel to a provided direction of the vector projection.
bool _createExact; ///< \ru Создавать проекционную кривую при необходимости. \en Create a projection curve if necessary.
bool _truncateByBounds; ///< \ru Усечь границами. \en Truncate by bounds.
MbSNameMaker _nameMaker; ///< \ru Именователь с версией. \en An object defining the names with the version.
std::unique_ptr<MbProjWireFrameParamsData> _paramsData; ///< \ru Для внутреннего использования. \en For internal use.
public:
/** \brief \ru Конструктор по параметрам.
\en Constructor by parameters. \~
\details \ru В этом конструкторе задаются данные для проецирования кривой на поверхность.
\en In this constructor, data is specified for projecting a curve onto a surface. \~
\param[in] surface - \ru Поверхность для проецирования заданной кривой.
\en A surface to project the specified curve onto. \~
\param[in] curve - \ru Кривая для проецирования на заданную поверхность.
\en A curve to project onto the specified surface. \~
\param[in] direction - \ru Вектор направления проецирования (если не задан, то проекция по нормали).
\en The direction of the vector projection (if not provided, normal projection is performed). \~
\param[in] createExact - \ru Создавать проекционную кривую при необходимости.
\en Create a projection curve if necessary. \~
\param[in] truncateByBounds - \ru Усекать границами поверхности.
\en Truncate by the surface bounds. \~
\param[in] version - \ru Версия исполнения.
\en The version. \~
*/
MbProjectionWireFrameParams( const MbSurface & surface,
const MbCurve3D & curve,
const MbVector3D * direction,
const bool createExact,
const bool truncateByBounds,
const VERSION version = Math::DefaultMathVersion() );
/** \brief \ru Конструктор по параметрам.
\en Constructor by parameters. \~
\details \ru В этом конструкторе задаются данные для проецирования кривой на набор граней.
\en In this constructor, data is specified for projecting a curve to a set of faces. \~
\param[in] curve - \ru Кривая для проецирования на заданный набор граней.
\en A curve to project to a specified set of faces. \~
\param[in] faces - \ru Связный набор граней для проецирования заданной кривой.
\en A connected set of faces to project the specified curve to. \~
\param[in] direction - \ru Вектор направления проецирования (если не задан, то проекция по нормали).
\en The direction of the vector projection (if not provided, normal projection is performed). \~
\param[in] projOnParallel - \ru Создавать ли проекции на поверхностях параллельных заданному вектору проецирования.
\en Should the projection be performed onto surfaces parallel to a provided direction of the vector projection. \~
\param[in] createExact - \ru Создавать проекционную кривую при необходимости.
\en Create a projection curve if necessary. \~
\param[in] truncateByBounds - \ru Усекать границами.
\en Truncate by bounds. \~
\param[in] snMaker - \ru Именователь с версией.
\en An object defining the names with the version. \~
*/
MbProjectionWireFrameParams( const MbCurve3D & curve,
const c3d::FacesVector & faces,
const MbVector3D * direction,
const bool projOnParallel,
const bool createExact,
const bool truncateByBounds,
const MbSNameMaker & snMaker );
/** \brief \ru Конструктор по параметрам.
\en Constructor by parameters. \~
\details \ru В этом конструкторе задаются данные для проецирования проволочного каркаса на тело.
\en In this constructor, data is specified for projecting a wireframe to a solid. \~
\param[in] wireFrame - \ru Проволочный каркас для проецирования на заданное тело.
\en A wireframe to project to a specified solid. \~
\param[in] sameWireFrame - \ru Использовать тот же экземпляр проволочного каркаса или создать копию.
\en Use the same wireframe or copy it. \~
\param[in] solid - \ru Тело для проецирования заданного проволочного каркаса.
\en A solid to project the specified wireframe to. \~
\param[in] sameCreators - \ru Использовать ли тот же экземпляр журнала тела или создать копию.
\en Use the same creators of the solid or make a copy. \~
\param[in] faceIndices - \ru Индексы граней оболочки тела.
\en Indices of faces in the solid's shell. \~
\param[in] direction - \ru Вектор направления проецирования (если не задан, то проекция по нормали).
\en The direction of the vector projection (if not provided, normal projection is performed). \~
\param[in] projOnParallel - \ru Создавать ли проекции на поверхностях параллельных заданному вектору проецирования.
\en Should the projection be performed onto surfaces parallel to a provided direction of the vector projection. \~
\param[in] createExact - \ru Создавать проекционную кривую при необходимости.
\en Create a projection curve if necessary. \~
\param[in] truncateByBounds - \ru Усекать границами.
\en Truncate by bounds. \~
\param[in] snMaker - \ru Именователь с версией.
\en An object defining the names with the version. \~
*/
MbProjectionWireFrameParams( const MbWireFrame & wireFrame,
const bool sameWireFrame,
const MbSolid & solid,
const bool sameCreators,
const c3d::IndicesVector & faceIndices,
const MbVector3D * direction,
const bool projOnParallel,
const bool createExact,
const bool truncateByBounds,
const MbSNameMaker & snMaker );
/// \ru Деструктор. \en Destructor.
~MbProjectionWireFrameParams();
public:
/// \ru Выдать вектор направления проецирования (nullptr если не задан). \en Get the direction of the vector projection (nullptr if not provided).
const MbVector3D * GetDirection() const { return _direction; }
/// \ru Создавать ли проекции на поверхностях параллельных заданному вектору проецирования. \en Whether the projection should be performed onto surfaces parallel to a provided direction of the vector projection.
bool GetProjectOnParallel() const { return _projOnParallel; }
/// \ru Создавать ли проекционную кривую при необходимости. \en Whether to create a projection curve if necessary.
bool GetCreateExact() const { return _createExact; }
/// \ru Усекать ли границами. \en Whether to truncate by bounds.
bool GetTruncateByBounds() const { return _truncateByBounds; }
/// \ru Получить именователь. \en Get an object defining the names.
const MbSNameMaker & GetNameMaker() const { return _nameMaker; }
/// \ru Для внутреннего использования. \en For internal use.
const MbProjWireFrameParamsData * GetParametersData() const { return _paramsData.get(); }
OBVIOUS_PRIVATE_COPY( MbProjectionWireFrameParams )
};
//------------------------------------------------------------------------------
/** \brief \ru Результаты операции построения проекционного проволочного каркаса.
\en The results of creating a projection wireframe. \~
\details \ru Результаты, полученные при построении проекции набора кривых по нормали или по направлению
на тело, набор граней или поверхность. Результаты содержат полученный проекционный проволочный каркас.
При проецировании на тело в атрибутах ребер лежат имена соответствующих граней этого тела.
При проецировании на набор граней в результатах операции будет заполнен массив индексы которого являются
индексами ребер каркаса, а значения являются индексами граней в исходном массиве. \n
\en Results of normal or vector projection of a set of curves to a solid, set of faces
or a surface. Results contain obtained projection wireframe.
When projecting a wireframe to a solid, the attributes of the edges contain the names of corresponding faces.
When projecting to a set of faces results of the operation contain an array where the indices are the indices
of the edges in a wireframe, and the values are the indices of the faces in the input array. \n \~
\ingroup WireFrame_Parameters
\warning \ru В разработке.
\en Under development. \~
*/
// ---
class MATH_CLASS MbProjectionWireFrameResults : public MbOperationResults {
private:
c3d::IndicesVector _resIndices; ///< \ru Индексы граней в исходном массиве, соответствующие ребрам полученного каркаса. \en The indices of faces in the input array corresponding to the edges of the obtained wireframe.
c3d::WireFrameSPtr _resWireFrame; ///< \ru Проволочный каркас, построенный по полученным проекционным кривым. \en The resulting wireframe constructed using obtained projection curves.
public:
/// \ru Конструктор по умолчанию. \en Default constructor.
MbProjectionWireFrameResults()
: MbOperationResults( )
, _resIndices ( )
, _resWireFrame ( nullptr )
{}
public:
/// \ru Инициализировать результаты по проволочному каркасу и индексам граней в исходном массиве, соответствующим полученным проекционным кривым. \en Initialize the results by the projection wireframe and the indices of faces in the input array corresponding to the obtained projection curves.
template<class IndicesVector>
void Init( MbWireFrame * resWireFrame, const IndicesVector & copyFrom ) {
_resWireFrame = resWireFrame;
_resIndices.clear();
_resIndices.reserve( copyFrom.size() );
for ( size_t id : copyFrom ) {
_resIndices.push_back( id );
}
}
/// \ru Выдать индексы граней в исходном массиве, соответствующие полученным проекционным кривым. \en Get the indices of faces in the input array corresponding to the obtained projection curves.
template<class IndicesVector>
void GetResIndices( IndicesVector & copyTo ) {
copyTo.reserve( copyTo.size() + _resIndices.size() );
for ( size_t id : _resIndices ) {
copyTo.push_back( id );
}
}
/// \ru Отцепить полученные проекционные кривые в заданный массив. \en Detach obtained projection curves into the specified array.
template <class SpaceCurvesVector>
void DetachCurves( SpaceCurvesVector & curves ) {
MbWireFrame * wf = _resWireFrame.detach();
::ExtractCurvesDeleteFrame( wf, curves );
};
/// \ru Выдать проекционный проволочный каркас. \en Get the projection wireframe.
const c3d::WireFrameSPtr & GetResWireFrame() { return _resWireFrame; }
/// \ru Отцепить проекционный проволочный каркас. \en Detach the projection wireframe.
MbWireFrame * DetachWireFrame() { return _resWireFrame.detach(); }
/// \ru Очистить результаты. \en Clear the results.
void Clear() { _resIndices.clear(); _resWireFrame.reset(); }
OBVIOUS_PRIVATE_COPY( MbProjectionWireFrameResults )
};
#endif // __OP_WIREFRAME_PARAMETERS_H
+8
View File
@@ -307,6 +307,14 @@ public:
\en Returns true, if the triangulation is successful. \~
*/
virtual bool TriangulateFacet( size_t iFacet ) = 0;
/** \brief \ru Выделить набор фасетов в отдельный объект.
\en Gather selected facets into a separate object. \~
\param[in] facets - \ru Набор фасетов.
\en Facets forming a part. \~
\param[out] part - \ru Отдельный объект.
\en A separate object. \~
*/
virtual void GetPart( const c3d::IndicesVector & facets, MbPolymeshTopo & part ) const = 0;
// \ru Функции для работы с топологией сегментации. \en Functions for working with the topology of a segmentation.
+12 -1
View File
@@ -45,6 +45,7 @@ enum MbeRefType
class MbRefItem;
class MbRegDuplicate;
namespace c3d // namespace C3D
{
typedef SPtr<MbRefItem> RefItemSPtr;
@@ -93,7 +94,8 @@ class MATH_CLASS MbRefItem {
class MATH_CLASS MbRefItem: virtual public c3d::MemoryLeaksVerifiable {
#endif
private:
mutable use_count_type useCount; ///< \ru Счетчик ссылок на объект, изменяемый владельцами объекта. \en A counter of references to an object modifiable by owners of object.
mutable use_count_type useCount; ///< \ru Счетчик ссылок на объект, изменяемый владельцами объекта. \en A counter of references to an object modifiable by owners of object.
mutable MbRegDuplicate * registrator; ///< \ru Регистратор, который создал данный объект как копию. \en A registrator which created the object as a copy.
protected:
/// \ru Конструктор без параметров. \en Constructor without parameters.
MbRefItem();
@@ -113,6 +115,15 @@ public:
/// \ru Уменьшить количество ссылок на единицу и, если количество ссылок стало равным нулю, удалить себя. \en Decrease count of references by one and if count of references became zero, then remove itself.
refcount_t Release() const;
/** \} */
/// \ru Запомнить регистратор, который создал данный объект. \en Set a register which has created the object.
void SetReg( MbRegDuplicate * reg ) const {
registrator = reg ;
}
/// \ru Очистить регистратор. \en Unset the register.
void UnsetReg() {
registrator = nullptr;
}
public:
/// \ru Регистрационный тип (для копирования, дублирования). \en Registration type (for copying, duplication).
virtual MbeRefType RefType() const;
+2 -2
View File
@@ -216,8 +216,8 @@ public:
MbSmoothSurface & CurvesDuplicate() const override; // \ru Копия с теми же опорными поверхностями. \en Copy with the same support surfaces.
// \ru Объединить поверхности путём включения поверхности init в данную поверхность. \en Unite surface by inclusion of 'init' surface to the given surface.
bool SurfacesCombine( const MbSurfaceIntersectionCurve & edge,
const MbSurface & init, bool add, MbMatrix & matr,
const MbSurfaceIntersectionCurve * seam ) override;
const MbSurface & init, bool add, bool inv, MbMatrix & matr,
const MbSurfaceIntersectionCurve * seam, VERSION vers ) override;
//virtual void InsertPointsToCurves( double u ); // \ru Добавить точки в опорные кривые поверхности. \en Add points to support curves of surface.
/** \} */
+1 -1
View File
@@ -261,7 +261,7 @@ public:
// \ru Определение точки касания поверхностей с одним неподвижным параметром. \en Determination of tangency point of surfaces with one fixed parameter.
MbeNewtonResult SurfaceTangentNewton( const MbSurface & surf1, MbeParamDir switchPar, double funcEpsilon, size_t iterLimit,
double & u0, double & v0, double & u1, double & v1, bool ext0, bool ext1 ) const override;
double & u0, double & v0, double & u1, double & v1, bool ext0, bool ext1, VERSION version = Math::DefaultMathVersion() ) const override;
// \ru Определение точки пересечения цилиндрической поверхности и кривой. \en Determination of intersection point of cylindrical surface and curve.
MbeNewtonResult CurveIntersectNewton( const MbCurve3D & curve, double funcEpsilon, size_t iterLimit,
+39 -9
View File
@@ -72,11 +72,13 @@ public:
ft_KerbFillet = 4, ///< \ru Скругление поверхности и кромки с постоянным радиусом. \en Fillet surface and kerb-curve with constant radius.
ft_KerbLawFillet = 5, ///< \ru Скругление поверхности и кромки с радиусом по закону. \en Fillet surface and kerb-curve with a radius that varies according to the law.
ft_KerbTouchingFillet = 6, ///< \ru Скругление двух поверхностей по кромке одной из них. \en Fillet of two surfaces with the specified kerb-curve of touching
ft_ChordLawFillet = 7 ///< \ru Скругление двух поверхностей с переменной хордой. \en Fillet of two surfaces with a constant chord.
ft_ChordLawFillet = 7, ///< \ru Скругление двух поверхностей с переменной хордой. \en Fillet of two surfaces with a constant chord.
ft_TwiceKerbTouchingFillet = 8 ///< \ru Скругление двух поверхностей по двум кромкам на каждой из них. \en Fillet of two surfaces with the specified kerb-curve of touching
};
protected:
MbCurve3D * curve0; ///< \ru Кривая пересечения касательных к поверхностям - всегда не nullptr. \en Intersection curve of tangents to surfaces - always not nullptr.
MbCurve3D * curve0; ///< \ru fsv_Ver0: Кривая пересечения касательных к поверхностям - всегда не nullptr. fsv_Ver1: Направляющая кривая, задающая параметризацию поверхности (может отсутствовать).
///< \en fsv_Ver0: Intersection curve of tangents to surfaces - always not nullptr.fsv_Ver1: A guide curve that defines the surface parameterization (may be absent).
MbFunction * weights0; ///< \ru Функция веса точек средней кривой curve0. \en Function of weight of points of curve0 mid-curve.
SPtr<MbFunction> conic; ///< \ru Коэффициент формы, изменяется от 0.05 до 0.95, определяет вес точек кривой curve0.Всегда не nullptr. \en Coefficient of shape is changed between 0.05 and 0.95 and determines weight of points of curve0 curve. Always not nullptr.
bool even; ///< \ru Равномерная параметризация по дуге или нет. \en Whether arc length parameterization is uniform or not.
@@ -411,8 +413,6 @@ static MbFilletSurface * CreateKerbFillet( double rad, MbSurfaceCurve & curv1, b
static MbFilletSurface * CreateKerbFillet( double rad, MbSurfaceCurve & curv1, bool sgn1,
MbSurfaceCurve & curv2, bool sgn2, bool byFirst, double conicFact, VERSION vers );
/// \ru Создать поверхность скругления по поверхности и кромке с касанием
/// \en
/** \brief \ru Создать поверхность скругления по двум поверхностям с указанием кромки касания
\en Create a fillet surface by two support surfaces, specifying the kerb-curve of touching \~
\details \ru В случае успеха создается поверхность скругления с версией >= fsv_Ver1.
@@ -435,6 +435,24 @@ static MbFilletSurface * CreateKerbFillet( double rad, MbSurfaceCurve & curv1, b
static MbFilletSurface * CreateKerbTouchingFillet( MbSurfaceCurve & curv1, bool sgn1,
MbSurfaceCurve & curv2, bool sgn2, bool byFirst, VERSION vers );
/** \brief \ru Создать поверхность скругления по двум поверхностям с указанием для каждой из них кромки касания
\en Create a fillet surface by two support surfaces, specifying a kerb-curve of touching for each of them\~
\details \ru В случае успеха создается поверхность скругления с версией >= fsv_Ver1.
\en If successful, a fillet surface is created with version >= fsv_Ver1. \~
\param[in] curv1 - \ru Опорная кривая в параметрах первой поверхности
\en Support curve at parameters of the first surface \~
\param[in] curv2 - \ru Опорная кривая в параметрах второй поверхности
\en Support curve at parameters of the second surface \~
\param[in] cn - \ru Функция коэффициента формы. Если функция не задана или значение коэффициента 0,то в качестве профиля используется "дуга окружности".
Значения от 0.05 до 0.95 соответствуют коническому сечению. Переменный коэффициент формы используется только для создания скругления граней.
\en A function of the shape coefficient. If the function is not specified or the coefficient value is 0, then the "circle arc" profile is used.
Values between 0.05 and 0.95 represent to the conic section. A variable shape coefficient is only used to create faces fillets. \~
\param[in] vers - \ru Версия.
\en Version. \~
\return \ru Возвращает указатель на созданную поверхность скругления в случае успеха, иначе - nullptr.
\en Returns a pointer to the created fillet surface if successful, nullptr otherwise. \~
*/
static MbFilletSurface * CreateTwiceKerbTouchingFillet( MbSurfaceCurve & curv1, MbSurfaceCurve & curv2, MbFunction * cn, VERSION vers );
protected:
/// \ru Конструктор для наследников обычной поверхности скругления. \en Constructor for inheritors of ordinary fillet surface.
MbFilletSurface( MbSurfaceCurve & curv1, double d1,
@@ -578,7 +596,7 @@ public:
// \ru Нахождение точки касания поверхностей \en Searching of surfaces tangency point
MbeNewtonResult SurfaceTangentNewton( const MbSurface &, MbeParamDir switchPar, double funcEpsilon, size_t iterLimit,
double &u0, double &v0, double &u1, double &v1,
bool ext0, bool ext1 ) const override;
bool ext0, bool ext1, VERSION version ) const override;
// \ru Проекции точки на поверхность. \en The point projections onto the surface.
MbeNewtonResult PointProjectionNewton( const MbCartPoint3D & p, size_t iterLimit,
@@ -613,8 +631,8 @@ public:
double GetDistance( bool s ) const override; // \ru Дать радиус со знаком. \en Get radius with a sign.
// \ru Объединить поверхности путём включения поверхности init в данную поверхность. \en Unite surfaces by inclusion of 'init' surface into current surface.
bool SurfacesCombine( const MbSurfaceIntersectionCurve & edge,
const MbSurface & init, bool add, MbMatrix & matr,
const MbSurfaceIntersectionCurve * seam ) override;
const MbSurface & init, bool add, bool inv, MbMatrix & matr,
const MbSurfaceIntersectionCurve * seam, VERSION vers ) override;
/// \ru Дать коэффициент для радиуса. \en Get coefficient for radius.
double DistanceRatio( bool firstCurve, MbCartPoint3D & p, double distance ) const override;
// \ru Определение разбивки параметрической области поверхности вертикалями и горизонталями. \en Determine splitting of parametric region of surface by vertical and horizontal lines.
@@ -716,6 +734,10 @@ public:
/// \ru Кривая пересечения касательных к поверхностям. \en Intersection curve of tangents to surfaces.
const MbCurve3D * GetCurve0() const { return curve0; }
/// \ru Добавить точку в опорные кривые границы. \en Add a point to the support curves of the boundary.
virtual bool InsertPoints( double & t1, const MbCartPoint & p1, bool add1,
double & t2, const MbCartPoint & p2, bool add2, VERSION vers );
/** \brief \ru Скругление не круговое.
\en Fillet isn't circular. \~
\details \ru Скругление не круговое.
@@ -813,7 +835,8 @@ bool SetWeights( MbFunction & func );
MbCurve3D * GetSpine() const;
void SetSpine( MbCurve3D * );
MbeFilletSurfType GetFilletType() const; // \ru Выдать тип скругления. \en Get fillet type.
void MoveCurves ( const MbVector (&move)[2] ); // \ru Сдвинуть опорные кривые в параметрической области.
// \en Move the supporting curves in the parametric domain.
/** \} */
protected:
void WeightKoefficient( double u, double & w ) const; // \ru Вычисление веса при заданном коэффициенте \en Calculation of weight at given coefficient
@@ -822,7 +845,6 @@ protected:
double CalculateVParam( const MbCartPoint3D & p, double u ) const; // \ru Нахождение параметра v проекции точки на вырожденную поверхность \en Searching of v parameter of point projection onto degenerate surface
bool IsSimilarToFillet( const MbFilletSurface & surf, VERSION version, double precision ) const; // \ru Подобные ли поверхности для объединения (слива). \en Whether the surfaces to union (joining) are similar.
protected:
// \ru Вычисление точки \en Calculation of a point
// void CalculateSurface( double u ) const;
@@ -933,11 +955,18 @@ protected:
void KerbCaseDerivatives( ptrdiff_t ord, double u, MbFilletSurfaceCacheData & dat ) const;
// Расчет производных опорных кривых для случая поверхности скругления по двум поверхностям с кромкой на одной из них
void KerbTouchingCaseDerivatives( ptrdiff_t ord, double u, MbFilletSurfaceCacheData & dat ) const;
// Расчет производных для случая поверхности скругления по двум поверхностям и по двум кромкой на каждой из них
void TwiceKerbTouchingCaseDerivatives( ptrdiff_t ord, MbFilletSurfaceCacheData & dat ) const;
// Расчитать производные опорных кривых.
void CalculateCurvesDerivatives( double u, ptrdiff_t ord, MbFilletSurfaceCacheData & dat ) const;
void GetCurvesParams( double u, double (&uu)[2], MbVector (&move)[2] ) const;// Получить расчетные параметры для двумерных кривых + вектор сдвига.
// Расчитать производные поверхности.
void Explore( double & u, double & v, bool ext, ptrdiff_t ordU, MbFilletSurfaceCacheData & dat ) const;
// Изменить направление поверхности
void Inverse( bool byU, bool byV );
// Подготовить Эрмиты для слияния двух скруглений / усечения первого скругления
static void CreateHermits( const MbFilletSurface & cur, const MbRect1D & curRgn, const MbFilletSurface & next, const MbRect1D & nextRgn,
const MbVector (& move)[2], bool cls, double kf, SPtr<MbCurve> (&mergedCurves)[2] );
MbSurfaceCurve * GetExactCurve( size_t ind ); // Получить опорную кривую.
const MbSurfaceCurve * GetExactCurve( size_t ind ) const; // Получить опорную кривую.
@@ -946,6 +975,7 @@ protected:
bool TestDerivatives() const; // Тестирование корректности математики поверхности.
#endif // C3D_DEBUG
void operator = ( const MbFilletSurface & ); // \ru Не реализовано. \en Not implemented.
const MbCurve3D * GetParamCurve() const; // Получить кривую задающую параметризацию
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbFilletSurface )
}; // MbFilletSurface
+20
View File
@@ -344,6 +344,26 @@ private:
*/
static
MbMeshSurface * Create( const MeshSurfaceValues & pars, VERSION vers = Math::DefaultMathVersion() );
/** \brief \ru Функция создания поверхности.
\en Surface creation function. \~
\details \ru Функция создания поверхности по сети кривых. Возвращает созданную поверхность
в случае корректно переданных данных, в противном случае - нулевой указатель.
Результат операции синхронизован с работой строителя оболочки по сети кривых.
\en Function for creating a surface from a mesh of curves.
Returns the created surface if the data is passed correctly, otherwise a null pointer.
The result of the operation is synchronized with the work of the mesh shell creator.\~
\param[in] pars - \ru Параметры создания поверхности.
\en Surface creation parameters. \~
\param[in] acc - \ru Точность пересечения кривых.
\en Accuracy of curves intersection. \~
\param[in] vers - \ru Версия операции создания поверхности.
\en Version of the surface creation operation. \~
\return \ru Указатель на созданную поверхность, либо нулевой указатель.
\en A pointer to the created surface, or a null pointer. \~
*/
static
MbMeshSurface * Create( const MeshSurfaceValues & pars, double acc, VERSION vers );
private:
friend class CompositeMeshShellCreator;
friend class CompositeMeshShellCreatorV19;
+1 -1
View File
@@ -333,7 +333,7 @@ public:
bool ext0, bool ext, bool touchInclude = false ) const override; // \ru Все точки пересечения плоскости и кривой. \en All points of intersection between a plane and a curve.
// \ru Пересечение с поверхностью. \en Intersection with surface.
MbeNewtonResult SurfaceIntersectNewton( const MbSurface & surf, MbeParamDir switchPar, double funcEpsilon, size_t limit,
double & u0, double & v0, double & u1, double & v1, bool ext0, bool ext1 ) const override;
double & u0, double & v0, double & u1, double & v1, bool ext0, bool ext1, VERSION version = Math::DefaultMathVersion() ) const override;
// \ru Подобные ли поверхности для объединения (слива). \en Whether the surfaces are similar to merge.
bool IsSimilarToSurface( const MbSurface & surf, VERSION version, double precision = METRIC_PRECISION ) const override;
// \ru Дать двумерную матрицу преобразования из своей параметрической области в параметрическую область surf. \en Get two-dimensional matrix of transformation from its parametric region to the parametric region of 'surf'.
+11 -3
View File
@@ -222,8 +222,8 @@ public:
\en A curve of another splitting edge (possibly it is nullptr) \~
*/
virtual bool SurfacesCombine( const MbSurfaceIntersectionCurve & edge,
const MbSurface & init, bool add, MbMatrix & matr,
const MbSurfaceIntersectionCurve * seam );
const MbSurface & init, bool add, bool inv, MbMatrix & matr,
const MbSurfaceIntersectionCurve * seam, VERSION vers );
/// \ru Дать коэффициент для радиуса. \en Get coefficient for radius.
virtual double DistanceRatio( bool firstCurve, MbCartPoint3D & p, double distance ) const;
@@ -296,6 +296,10 @@ public:
\en Point on the second curve \~
\param[in] add2 - \ru Нужно ли добавлять точку во вторую кривую
\en Whether to add a point to the second curve \~
\param[in] version - \ru Версия операции.
\en Version of operation. \~
\result \ru true - если точка была добавлена.
\en true - if point was added. \~
*/
virtual bool InsertPoints( double & t1, const MbCartPoint & p1, bool add1,
double & t2, const MbCartPoint & p2, bool add2, VERSION vers );
@@ -314,8 +318,12 @@ public:
\en Point on the second curve \~
\param[in] anyCase - \ru Штатная работа со значением false (true исключение).
\en Regular work with the value false (true exception). \~
\param[in] version - \ru Версия операции.
\en Version of operation. \~
\result \ru true - в случае успеха.
\en true - if the operation was successful. \~
*/
bool ProlongSurface( double u, const MbCartPoint & p1, const MbCartPoint & p2, bool anyCase );
bool ProlongSurface( double u, const MbCartPoint & p1, const MbCartPoint & p2, bool anyCase, VERSION vers );
/** \brief \ru Скорректировать кривые.
\en Correct curves. \~
+1 -1
View File
@@ -205,7 +205,7 @@ public:
double CurvatureV ( double u, double v ) const override; // \ru Кривизна вдоль v. \en Curvature in v direction.
// \ru Определение точки касания поверхностей с одним неподвижным параметром. \en Determination of tangency point of surfaces with one fixed parameter.
MbeNewtonResult SurfaceTangentNewton( const MbSurface & surf1, MbeParamDir switchPar, double funcEpsilon, size_t iterLimit,
double & u0, double & v0, double & u1, double & v1, bool ext0, bool ext1 ) const override;
double & u0, double & v0, double & u1, double & v1, bool ext0, bool ext1, VERSION version = Math::DefaultMathVersion() ) const override;
// \ru Определение точки касания поверхности и кривой. \en Determination of tangency point between a surface and a curve.
MbeNewtonResult CurveTangentNewton( const MbCurve3D & curv, double funcEpsilon, size_t iterLimit,
double & u, double & v, double & t, bool ext0, bool ext1 ) const override;
+3
View File
@@ -65,6 +65,9 @@ public:
/// \ru Установить вес. \en Set weight.
bool SetWeight( size_t lineIndex, size_t columnIndex, double wt );
/// \ru Получить общий вес (использовать после проверки IsCommonWeight). \en Get common weight (to be used after checking IsCommonWeight).
double GetCommonWeight() const { return commonWeight; }
/// \ru Вставить строку. \en Insert a line.
void InsertLine ( size_t k, double wt = 1.0 );
/// \ru Вставить столбец \en Insert a column.
+1 -1
View File
@@ -240,7 +240,7 @@ public:
// \ru Определение точки касания поверхностей с одним неподвижным параметром. \en Determination of tangency point of surfaces with one fixed parameter.
MbeNewtonResult SurfaceTangentNewton( const MbSurface & surf1, MbeParamDir switchPar, double funcEpsilon, size_t iterLimit,
double & u0, double & v0, double & u1, double & v1, bool ext0, bool ext1 ) const override;
double & u0, double & v0, double & u1, double & v1, bool ext0, bool ext1, VERSION version = Math::DefaultMathVersion() ) const override;
// \ru Определение точки касания поверхности и кривой. \en Determination of tangency point between a surface and a curve.
MbeNewtonResult CurveTangentNewton( const MbCurve3D & curv, double funcEpsilon, size_t iterLimit,
double & u, double & v, double & t, bool ext0, bool ext1 ) const override;
+8 -10
View File
@@ -1038,14 +1038,12 @@ public:
/** \brief \ru Построить пространственную копию линии v = const.
\en Construct spatial copy of the line v = const. \~
\param[in] v - \ru Параметр по направлению V.
\en Parameter in V direction. \~
\param[in] pRgn - \ru Диапазон параметров по U.
\en A range of u-parameters. \~
\param[in] bApprox - \ru Если false, то вернет не ноль только в случае, если получится создать точную кривую. \n
Если true, то вернет не ноль, если кривая не вырождена.
\en If false, then it returns null only in a case when the exact curve has been successfully created. \n
If true, then it returns null in a case when the curve is not degenerate. \~
\param[in] v - \ru Параметр по направлению V. \en Parameter in V direction. \~
\param[in] pRgn - \ru Диапазон параметров по U. \en A range of u-parameters. \~
\param[in] bApprox - \ru Если false, то вернет не ноль только в случае, если получится создать точную кривую. \n
Если true, то вернет не ноль, если кривая не вырождена.
\en If false, then returns non-null only in a case when the exact curve has been successfully created. \n
If true, then returns non-null in a case when the curve is not degenerated. \~
\result \ru Построенная кривая.
\en Constructed curve. \~
*/
@@ -1297,10 +1295,10 @@ public:
/// \ru Решение системы уравнений для определения пересечения поверхностей. Для внутреннего использования. \en Solution of equation system for determination of surfaces intersections. For internal use only.
virtual MbeNewtonResult SurfaceIntersectNewton( const MbSurface & surf1, MbeParamDir switchPar, double funcEpsilon, size_t iterLimit,
double & u0, double & v0, double & u1, double & v1, bool ext0, bool ext1 ) const;
double & u0, double & v0, double & u1, double & v1, bool ext0, bool ext1, VERSION version = Math::DefaultMathVersion() ) const;
/// \ru Решение системы уравнений для определения касания поверхностей. Для внутреннего использования. \en Solution of equation system for determination of surfaces tangency. For internal use only.
virtual MbeNewtonResult SurfaceTangentNewton( const MbSurface & surf1, MbeParamDir switchPar, double funcEpsilon, size_t iterLimit,
double & u0, double & v0, double & u1, double & v1, bool ext0, bool ext1 ) const;
double & u0, double & v0, double & u1, double & v1, bool ext0, bool ext1, VERSION version = Math::DefaultMathVersion() ) const;
/// \ru Решение системы уравнений для определение точек очерка поверхности. Для внутреннего использования. \en Solution of equation system for determination of surface silhouette points. For internal use only.
virtual MbeNewtonResult SilhouetteNewton( const MbVector3D & eye, bool perspective, const MbAxis3D * axis, MbeParamDir switchPar,
double funcEpsilon, size_t iterLimit, double & u, double & v, bool ext ) const;
+7 -4
View File
@@ -15,6 +15,7 @@
#include <wchar.h>
#include <tool_string_util.h>
#include <fstream>
#include <sstream>
#include <math_define.h>
#ifndef C3D_WINDOWS //_MSC_VER
@@ -300,11 +301,13 @@ typedef std::string path_string;
#ifdef _UNICODE
typedef std::wofstream t_ofstream;
typedef std::wifstream t_ifstream;
typedef std::wofstream t_ofstream;
typedef std::wifstream t_ifstream;
typedef std::wostringstream t_stringstream;
#else // _UNICODE
typedef std::ofstream t_ofstream;
typedef std::ifstream t_ifstream;
typedef std::ofstream t_ofstream;
typedef std::ifstream t_ifstream;
typedef std::ostringstream t_stringstream_;
#endif // _UNICODE
+13 -38
View File
@@ -54,8 +54,8 @@ namespace c3d //namespace c3d
// ---
//------------------------------------------------------------------------------
// \ru Класс позволяет форматировать строку для лога и добавлять ее в лог.
// \en Class allows to format a line to the log and put it to the log.
// \ru Класс для форматирования строки для лога и добавления ее в лог.
// \en Class for formatting a line to the log and writing it to the log.
// ---
class MATH_CLASS Logger
{
@@ -108,7 +108,7 @@ public:
//------------------------------------------------------------------------------
/** \brief \ru Переключатель логирования в области видимости.
\en Logging switch in a scope. \~
\details \ru Вспомогательный класс для логирования в области видимости.
\details \ru Класс для логирования в области видимости.
В конструкторе логирование включается, в деструкторе - отключается.
Если в конструкторе было указано имя файла, то перед отключением логирования
деструктор записывает накопленный лог в файл.
@@ -146,14 +146,11 @@ public:
// ---
class MATH_CLASS LogHelper
{
#ifdef C3D_DEBUG
bool _enabled;
c3d::string_t _file;
#endif
public:
#ifdef C3D_DEBUG
// \ru Параметр enable определяет, стартовать ли логирование.
// \en The enable parameter defines whether to start logging.
LogHelper( bool enable = true, const TCHAR* file = nullptr );
@@ -161,33 +158,33 @@ public:
// \ru Если в конструкторе было указано имя файла, то деструктор записывает накопленный лог в файл.
// \en If a file name was defined in the contructor, the destructor writes the collected log to the file. \~
~LogHelper();
#else
LogHelper( bool, const TCHAR * ) {}
~LogHelper() {}
#endif
private:
void Init( bool enable, const TCHAR * file );
void Reset();
};
#ifdef C3D_DEBUG
//------------------------------------------------------------------------------
// \ru Функции логирования. \en Logging functions.
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
/** \brief \ru Установить директорию для логов. \en Set log directory. \~
\details \ru По умолчанию лог-файлы сохраняются в директорию, установленную переменной LOG_PATH.
\details \ru По умолчанию лог-файлы сохраняются в директорию %USERPROFILE%/Logs.
Функция позволяет изменить директорию для логов.
\en By default log-files are saved to the directory< defined by LOG_PATH variable.
\en By default log-files are saved to the directory %USERPROFILE%/Logs.
The function allows changing the directory for logs. \~
\param dirPath - \ru Полный путь к директории. \en Full path to log directory.
\return \ru true, если директория создана. \en true if directory is created.
\ingroup Base_Tools
*/
// ---
MATH_FUNC(void) SetLogDir( const TCHAR * name );
MATH_FUNC(bool) SetLogDir( const TCHAR * dirPath );
//------------------------------------------------------------------------------
/** \brief \ru Начать или закончить логирование. \en Start or stop logging. \~
\details \ru Начать или закончить логирование. \en Start or stop logging. \~
\param enable - \ru Полный путь к директории. \en Whether.
\ingroup Base_Tools
*/
// ---
@@ -238,7 +235,7 @@ inline std::string __location() {
#endif
// \ru Начать логирование. \en Start logging.
#define START_LOGGING c3d::SetLogging( true );
#define START_LOGGING(var) c3d::SetLogging( var );
// \ru Закончить логирование. \en Stop logging.
#define END_LOGGING c3d::SetLogging( false );
// \ru Записать лог в файл. Лог для каждого потока записывается в отдельный файл.
@@ -252,28 +249,6 @@ inline std::string __location() {
// \ru Положить в лог форматированную строку с типом сообщения и указанием места. \en Put a formatted string with the message type and the place to the log.
#define LOG_MSG_PLACE_TYPE(msg,type) c3d::Logger::Get() << __LOCATION__ << type << msg << Logger::Endl;
#else
//------------------------------------------------------------------------------
// \ru Логирование работает только в Debug. \en Logging works in Debug Only.
//------------------------------------------------------------------------------
inline void CALL_DECLARATION SetLogDir( const TCHAR * ) {}
inline void CALL_DECLARATION SetLogging( bool ){}
inline void CALL_DECLARATION WriteLog( const TCHAR * ){}
inline void CALL_DECLARATION LogMessage( const c3d::string_t & ){}
inline void CALL_DECLARATION LogMessage( const c3d::string_t &, Logger::MsgType ){}
#define __LOCATION__ ""
#define START_LOGGING c3d::SetLogging( true );
#define END_LOGGING c3d::SetLogging( false );
#define WRITE_LOG_FILE(fileName) c3d::WriteLog( fileName );
#define LOG_MSG(msg) c3d::LogMessage( msg );
#define LOG_MSG_PLACE(msg) LOG_MSG(msg)
#define LOG_MSG_PLACE_TYPE(msg,type) LOG_MSG(msg)
#endif
//------------------------------------------------------------------------------
/** \brief \ru Включить контроль утечек памяти.
\en Enable memory leakage control. \~
+47
View File
@@ -233,6 +233,29 @@ public:
operator const char * () const { return buf; }
/// \ru Оператор доступа. \en An access operator.
operator char * () { return buf; }
/// \ru Оператор присваивания. \en Assignment operator.
strbuf & operator = ( const wchar_t * str ) {
delete[] buf;
buf = wcsnewmbs( str );
return *this;
}
/// \ru Оператор присваивания. \en Assignment operator.
strbuf & operator = ( const char * str ) {
delete[] buf;
buf = strnewdup( str );
return *this;
}
/// \ru Оператор присваивания. \en Assignment operator.
strbuf & operator = ( const strbuf & wb ) {
if ( &wb != this ) {
delete[] buf;
buf = strnewdup( wb.buf );
}
return *this;
}
};
@@ -262,6 +285,9 @@ public:
buf = new wchar_t[len];
*buf = 0;
}
/// \ru Конструктор по умолчанию. \en Default constructor.
wcsbuf() : buf( nullptr ) {}
/// \ru Деструктор. \en Destructor.
~wcsbuf() {
delete [] buf;
@@ -270,6 +296,27 @@ public:
operator const wchar_t * () const { return buf; }
/// \ru Оператор доступа. \en An access operator.
operator wchar_t * () { return buf; }
/// \ru Оператор присваивания. \en Assignment operator.
wcsbuf & operator = ( const wchar_t * str ) {
delete [] buf;
buf = wcsnewdup( str );
return *this;
}
/// \ru Оператор присваивания. \en Assignment operator.
wcsbuf & operator = ( const char * str ) {
delete[] buf;
buf = mbsnewwcs( str );
return *this;
}
/// \ru Оператор присваивания. \en Assignment operator.
wcsbuf & operator = ( const wcsbuf & wb ) {
if ( &wb != this ) {
delete[] buf;
buf = wcsnewdup( wb.buf );
}
return *this;
}
};
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
+1 -1
View File
@@ -303,7 +303,7 @@ public :
\en Construct contours of curves copies.\~
\details \ru Построить контуры из копий кривых. Новые контуры прицепляются к массиву curves.\n
\en Construct contours of curves copies. New contours are added to the curves array.\n\~
\param[out] curves - \ru Массив, к которуму добавляются построенные контуры.
\param[out] curves - \ru Массив, к которому добавляются построенные контуры.
\en Array, to which created contours are added.\~
\result \ru Возвращает true, если хоть 1 контур был создан.
\en Returns true if at least one contour is created. \~
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.