diff --git a/C3d/Include/action.h b/C3d/Include/action.h index 6f37510..1683f37 100644 --- a/C3d/Include/action.h +++ b/C3d/Include/action.h @@ -77,7 +77,7 @@ MATH_FUNC (bool) IsMultiShell( const MbFaceShell * shell, bool checkNesting = tr \ingroup Algorithms_3D */ // --- -MATH_FUNC (size_t) DetachShells( MbFaceShell & shell, RPArray & parts, bool sort, c3d::IndicesVector * partIndices = c3d_null ); +MATH_FUNC (size_t) DetachShells( MbFaceShell & shell, RPArray & parts, bool sort, c3d::IndicesVector * partIndices = nullptr ); //------------------------------------------------------------------------------ @@ -102,7 +102,7 @@ MATH_FUNC (size_t) DetachShells( MbFaceShell & shell, RPArray & par \ingroup Algorithms_3D */ // --- -MATH_FUNC (size_t) DetachShells( MbFaceShell & shell, c3d::ShellsVector & parts, bool sort, c3d::IndicesVector * partIndices = c3d_null ); +MATH_FUNC (size_t) DetachShells( MbFaceShell & shell, c3d::ShellsVector & parts, bool sort, c3d::IndicesVector * partIndices = nullptr ); //------------------------------------------------------------------------------ @@ -127,7 +127,7 @@ MATH_FUNC (size_t) DetachShells( MbFaceShell & shell, c3d::ShellsVector & parts, \ingroup Algorithms_3D */ // --- -MATH_FUNC (size_t) DetachShells( MbFaceShell & shell, c3d::ShellsSPtrVector & parts, bool sort, c3d::IndicesVector * partIndices = c3d_null ); +MATH_FUNC (size_t) DetachShells( MbFaceShell & shell, c3d::ShellsSPtrVector & parts, bool sort, c3d::IndicesVector * partIndices = nullptr ); //------------------------------------------------------------------------------ @@ -153,7 +153,7 @@ size_t CreateShells( const MbFaceShell & shell, ShellsVector & parts, bool sort { c3d::ShellSPtr outer( new MbFaceShell( shell ) ); // new shell on the same faces (новая оболочка с теми же гранями) - c3d::IndicesVector * partIndices = c3d_null; + c3d::IndicesVector * partIndices = nullptr; if ( ::DetachShells( *outer, parts, sort, partIndices ) > 0 ) { parts.push_back( outer ); @@ -1350,13 +1350,13 @@ c3d::SolidSPtr GetTransformedSolid( c3d::SolidSPtr & solid, MbeCopyMode & copyMo { c3d::SolidSPtr resSolid( solid ); - if ( (resSolid != c3d_null) && !matr.IsSingle() ) { + if ( (resSolid != nullptr) && !matr.IsSingle() ) { MbSNameMaker n( transformedMainName, MbSNameMaker::i_SideNone, 0 ); - MbSolid * resSolidPtr = c3d_null; + MbSolid * resSolidPtr = nullptr; TransformValues tv( matr ); ::TransformedSolid( *solid, cm_Copy, tv, n, resSolidPtr ); - if ( resSolidPtr != c3d_null ) { + if ( resSolidPtr != nullptr ) { resSolid = resSolidPtr; copyMode = cm_Same; } @@ -1380,10 +1380,10 @@ c3d::SolidSPtr GetTransformedSolid( c3d::SolidSPtr & solid, MbeCopyMode & copyMo */ // --- template -SPtr GetTransformedItem( SPtr & item, const MbMatrix3D & matr, MbRegDuplicate * iDupReg = c3d_null, MbRegTransform * iTransReg = c3d_null ) +SPtr GetTransformedItem( SPtr & item, const MbMatrix3D & matr, MbRegDuplicate * iDupReg = nullptr, MbRegTransform * iTransReg = nullptr ) { SPtr resItem( item ); - if ( (resItem != c3d_null) && !matr.IsSingle() ) { + if ( (resItem != nullptr) && !matr.IsSingle() ) { resItem = static_cast( &item->Duplicate( iDupReg ) ); resItem->Transform( matr, iTransReg ); } diff --git a/C3d/Include/action_analysis.h b/C3d/Include/action_analysis.h index ec649fc..61dde7b 100644 --- a/C3d/Include/action_analysis.h +++ b/C3d/Include/action_analysis.h @@ -60,7 +60,7 @@ typedef void( *SurfaceFunction )( const MbSurface & surf, // Поверхно MATH_FUNC( void ) MinSurfaceCurvature( const MbSurface & surf, const MbCartPoint & pnt, double & func, - MbVector * der = c3d_null ); + MbVector * der = nullptr ); //------------------------------------------------------------------------------ @@ -81,7 +81,7 @@ MATH_FUNC( void ) MinSurfaceCurvature( const MbSurface & surf, MATH_FUNC( void ) MaxSurfaceCurvature( const MbSurface & surf, const MbCartPoint & pnt, double & func, - MbVector * der = c3d_null ); + MbVector * der = nullptr ); //------------------------------------------------------------------------------ @@ -102,7 +102,7 @@ MATH_FUNC( void ) MaxSurfaceCurvature( const MbSurface & surf, MATH_FUNC( void ) GaussCurvature( const MbSurface & surf, const MbCartPoint & pnt, double & func, - MbVector * der = c3d_null ); + MbVector * der = nullptr ); //------------------------------------------------------------------------------ @@ -123,7 +123,7 @@ MATH_FUNC( void ) GaussCurvature( const MbSurface & surf, MATH_FUNC( void ) MeanCurvature( const MbSurface & surf, const MbCartPoint & pnt, double & func, - MbVector * der = c3d_null ); + MbVector * der = nullptr ); //------------------------------------------------------------------------------ @@ -144,7 +144,7 @@ MATH_FUNC( void ) MeanCurvature( const MbSurface & surf, MATH_FUNC( void ) UNormalCurvature( const MbSurface & surf, const MbCartPoint & pnt, double & func, - MbVector * der = c3d_null ); + MbVector * der = nullptr ); //------------------------------------------------------------------------------ @@ -165,7 +165,7 @@ MATH_FUNC( void ) UNormalCurvature( const MbSurface & surf, MATH_FUNC( void ) VNormalCurvature( const MbSurface & surf, const MbCartPoint & pnt, double & func, - MbVector * der = c3d_null ); + MbVector * der = nullptr ); //------------------------------------------------------------------------------ @@ -322,7 +322,7 @@ MATH_FUNC( void ) FacesMinMaxCurvature( const RPArray & faces, */ MATH_FUNC( double ) CurveOrientedCurvature( const MbCurve3D & curve, double & param, - const MbVector3D * planeNorm = c3d_null ); + const MbVector3D * planeNorm = nullptr ); //------------------------------------------------------------------------------ @@ -359,10 +359,10 @@ MATH_FUNC( void ) CurveMinMaxCurvature( const MbCurve3D & curve, double & maxParam, double & minCurv, double & minParam, - c3d::DoubleVector * bendPoints = c3d_null, - c3d::DoubleVector * maxPoints = c3d_null, - c3d::DoubleVector * minPoints = c3d_null, - c3d::DoublePairsVector * rapPoints = c3d_null ); + c3d::DoubleVector * bendPoints = nullptr, + c3d::DoubleVector * maxPoints = nullptr, + c3d::DoubleVector * minPoints = nullptr, + c3d::DoublePairsVector * rapPoints = nullptr ); //------------------------------------------------------------------------------ @@ -407,12 +407,14 @@ protected: private: const MbSNameMaker & snMaker; ///< \ru Именователь с версией операции. \en Names maker with operation version. public: - /** \brief \ru Конструктор. - \en Constructor. \~ - \details \ru Конструктор по параметрам. + /** \brief \ru Конструктор по параметрам. \en Constructor by parameters. \~ + \details \ru Конструктор по кривой пересечения. + \en Constructor by . \~ \param[in] intCrv - \ru Кривая пересечения поверхностей. \en Surfaces intersection curve. \~ + \param[in] nm - \ru Именователь с версией операции. + \en Names maker with operation version. \~ */ MbNormalsMinMaxAnglesParams( const MbSurfaceIntersectionCurve & intCrv, const MbSNameMaker & nm ) : intCurve ( &intCrv ) @@ -422,75 +424,53 @@ public: , calcMode ( om_FuncDerCos2 ) , snMaker ( nm ) {} - /** \brief \ru Конструктор. - \en Constructor. \~ - \details \ru Конструктор по параметрам. + /** \brief \ru Конструктор по параметрам. \en Constructor by parameters. \~ - \param[in] intCrv - \ru Кривая пересечения поверхностей. - \en Surfaces intersection curve. \~ + \details \ru Конструктор по ребру. + \en Constructor by edge. \~ + \param[in] edge - \ru Ребро. + \en Edge. \~ + \param[in] nm - \ru Именователь с версией операции. + \en Names maker with operation version. \~ */ MbNormalsMinMaxAnglesParams( const MbCurveEdge & edge, const MbSNameMaker & nm ) : intCurve ( &edge.GetIntersectionCurve() ) + , sameSense1( true ) + , sameSense2( true ) + , dirMatch ( ts_neutral ) + , calcMode ( om_FuncDerCos2 ) + , snMaker ( nm ) + { + Init( edge ); + } + /** \brief \ru Конструктор по параметрам. + \en Constructor by parameters. \~ + \details \ru Конструктор по двум ребрам. + \en Constructor by two edges. \~ + \param[in] edge1 - \ru Ребро 1. + \en Edge 1. \~ + \param[in] edge2 - \ru Ребро 2. + \en Edge 2. \~ + \param[in] аccuracy - \ru Заявленная точность совпадения ребер. + \en Claimed edges matching accuracy. \~ + \param[in] nm - \ru Именователь с версией операции. + \en Names maker with operation version. \~ + */ + MbNormalsMinMaxAnglesParams( const MbCurveEdge & edge1, const MbFace & face1, + const MbCurveEdge & edge2, const MbFace & face2, + double accuracy, const MbSNameMaker & nm ) + : intCurve ( nullptr ) , sameSense1( true ) , sameSense2( true ) , dirMatch ( ts_neutral ) , calcMode ( om_FuncDerCos2 ) , snMaker ( nm ) { - const MbSurface & surface1 = intCurve->GetCurveOneSurface().GetSurface(); - const MbSurface & surface2 = intCurve->GetCurveTwoSurface().GetSurface(); - const MbFace * fp = edge.GetFacePlus(); - const MbFace * fm = edge.GetFaceMinus(); - - if ( fp != c3d_null && fm != c3d_null ) { - const MbSurface & sp = fp->GetSurface().GetSurface(); - const MbSurface & sm = fm->GetSurface().GetSurface(); - - if ( &sp == &surface1 && &sm == &surface2 ) { - sameSense1 = fp->IsSameSense(); - sameSense2 = fm->IsSameSense(); - dirMatch = ts_positive; - } - else if ( &sp == &surface2 && &sm == &surface1 ) { - sameSense1 = fm->IsSameSense(); - sameSense2 = fp->IsSameSense(); - dirMatch = ts_negative; - } - else { - intCurve = c3d_null; // parameter error - } - } - else if ( (fp != c3d_null) || (fm != c3d_null) ) { - const MbFace * f = (fp != c3d_null) ? fp : fm; - const MbSurface & s = f->GetSurface().GetSurface(); - - if ( &s == &surface1 && &s == &surface2 ) { - sameSense1 = f->IsSameSense(); - sameSense2 = sameSense1; - dirMatch = ts_positive; - } - else if ( &s == &surface1 ) { - const MbCurve & pCurve1 = intCurve->GetCurveOneCurve(); - intCurve = new MbSurfaceIntersectionCurve( surface1, pCurve1, surface1, pCurve1, cbt_Boundary, true, true ); - sameSense1 = f->IsSameSense(); - sameSense2 = sameSense1; - dirMatch = ts_positive; - } - else if ( &s == &surface2 ) { - const MbCurve & pCurve2 = intCurve->GetCurveOneCurve(); - intCurve = new MbSurfaceIntersectionCurve( surface2, pCurve2, surface2, pCurve2, cbt_Boundary, true, true ); - sameSense1 = f->IsSameSense(); - sameSense2 = sameSense1; - dirMatch = ts_negative; - } - else { - intCurve = c3d_null; // parameter error - } - } + Init( edge1, face1, edge2, face2, accuracy ); } public: /// \ru Есть ли кривая пересечения? \en Does an intersection curve exist? - bool IsCurve() const { return (intCurve != c3d_null); } + bool IsCurve() const { return (intCurve != nullptr); } /// \ru Получить кривую пересечения? \en Get intersection curve. c3d::ConstIntersectionCurveSPtr GetCurve() const { return intCurve; } /// \ru Признак совпадения нормали первой поверхности и грани. \en The flag of the coincidence of the normal of the first surface and the corresponding face . @@ -502,6 +482,14 @@ public: /// \ru Получить ссылку на именователь. \en Get names maker reference. const MbSNameMaker & GetNameMaker() const { return snMaker; } +private: + /// \ru Инциализация по ребру. \en Initialize by edge. + bool Init( const MbCurveEdge & ); + /// \ru Инциализация по двум ребрам. \en Initialize by edges pair. + bool Init( const MbCurveEdge & edge1, const MbFace & face1, + const MbCurveEdge & edge2, const MbFace & face2, + double edgesMatchingAccuracy ); + OBVIOUS_PRIVATE_COPY( MbNormalsMinMaxAnglesParams) }; @@ -524,12 +512,12 @@ public: double a; ///< \ru Угол между нормалями поверхностей в кривой пересечения. \en Angle between surfaces normals in the intersection curve. ThreeStates isMin; ///< \ru Локальный минимум, максимум или неопределенное состояние. \en Local minimum, maximum or undefined state. public: - Data() : t( UNDEFINED_DBL ), f( UNDEFINED_DBL ), a( UNDEFINED_DBL ), isMin( ts_neutral ) {} - Data( double f0 ) : t( UNDEFINED_DBL ), f( f0 ), a( UNDEFINED_DBL ), isMin( ts_neutral ) {} - Data( double t0, double f0 ) : t( t0 ), f( f0 ), a( UNDEFINED_DBL ), isMin( ts_neutral ) {} - Data( double t0, double f0, double a0 ) : t( t0 ), f( f0 ), a( a0 ), isMin( ts_neutral ) {} - Data( double t0, double f0, double a0, ThreeStates s ) : t( t0 ), f( f0 ), a( a0 ), isMin( s ) {} - Data( const Data & d ) : t( d.t ), f( d.f ), a( d.a ), isMin( d.isMin ) {} + Data() : t( UNDEFINED_DBL ), f( UNDEFINED_DBL ), a( UNDEFINED_DBL ), isMin( ts_neutral ) {} + Data( double f0 ) : t( UNDEFINED_DBL ), f( f0 ), a( UNDEFINED_DBL ), isMin( ts_neutral ) {} + Data( double t0, double f0 ) : t( t0 ), f( f0 ), a( UNDEFINED_DBL ), isMin( ts_neutral ) {} + Data( double t0, double f0, double a0 ) : t( t0 ), f( f0 ), a( a0 ), isMin( ts_neutral ) {} + Data( double t0, double f0, double a0, ThreeStates s ) : t( t0 ), f( f0 ), a( a0 ), isMin( s ) {} + Data( const Data & d ) : t( d.t ), f( d.f ), a( d.a ), isMin( d.isMin ) {} public: const Data & operator = ( const Data & d ) { t = d.t; f = d.f; a = d.a; isMin = d.isMin; return *this; } public: @@ -542,13 +530,16 @@ public: Data minParamValue; ///< \ru Глобальный минимальный угол. \en Global minimum angle. Data maxParamValue; ///< \ru Глобальный максимальный угол. \en Global maximum angle. MbResultType resType; ///< \ru Код результата операции. \en Operation result code. - public: /// \ru Конструктор. \en Constructor. MbNormalsMinMaxAnglesResults() : allParamValues(), minParamValues(), maxParamValues(), minParamValue( MB_MAXDOUBLE ), maxParamValue( -MB_MAXDOUBLE ) {} public: + /// \ru Определен ли глобальный минимум. \en Whether a global minimum value is defined. + bool IsDefinedMinValue() const; + /// \ru Определен ли глобальный максимум. \en Whether a global maximum value is defined. + bool IsDefinedMaxValue() const; /// \ru Очистка данных. \en Data cleaning. - void Clear() { allParamValues.clear(); minParamValues.clear(); maxParamValues.clear(); minParamValue.Reset(); maxParamValue.Reset(); } + void Clear() { allParamValues.clear(); minParamValues.clear(); maxParamValues.clear(); minParamValue.Reset(); maxParamValue.Reset(); } OBVIOUS_PRIVATE_COPY( MbNormalsMinMaxAnglesResults ) }; diff --git a/C3d/Include/action_b_shaper.h b/C3d/Include/action_b_shaper.h index 98bb480..02a1bf0 100644 --- a/C3d/Include/action_b_shaper.h +++ b/C3d/Include/action_b_shaper.h @@ -341,8 +341,8 @@ public: To fit surface use corresponding methods SegmentMesh or FitSurfaceToSegment. \n \~ \param[in] idxSegment - \ru Индекс сегмента полигональной сетки. \en Index of a mesh segment. \~ - \return \ru Возвращает указатель на поверхность для сегмента, если поверхность определена, иначе - c3d_null. - \en Returns pointer to segment surface if it exists, else - c3d_null. \~ + \return \ru Возвращает указатель на поверхность для сегмента, если поверхность определена, иначе - nullptr. + \en Returns pointer to segment surface if it exists, else - nullptr. \~ \ingroup Polygonal_Objects */ virtual const MbSurface * GetSegmentSurface( size_t idxSegment ) const = 0; diff --git a/C3d/Include/action_curve.h b/C3d/Include/action_curve.h index f40036b..c3b1dea 100644 --- a/C3d/Include/action_curve.h +++ b/C3d/Include/action_curve.h @@ -443,7 +443,7 @@ MATH_FUNC (MbCurve *) DuplicateCurve( const MbCurve & curve, VERSION version = M DEPRECATE_DECLARE MATH_FUNC (MbContour *) DuplicateContour( const MbContour & cntr, bool modifySegments, - MbSNameMaker * names = c3d_null ); + MbSNameMaker * names = nullptr ); //------------------------------------------------------------------------------ @@ -469,7 +469,7 @@ MATH_FUNC (MbContour *) DuplicateContour( const MbContour & cntr, MATH_FUNC (MbContour *) DuplicateContour( const MbContour & cntr, bool modifySegments, VERSION version, - MbSNameMaker * names = c3d_null ); + MbSNameMaker * names = nullptr ); //------------------------------------------------------------------------------ @@ -593,13 +593,15 @@ MATH_FUNC (bool) CurveTrim( MbCurve & curve, Если toEnd == false, то добавить в начало. \n \en Add a curve to a composite curve (a contour) 'contour'. \n If toEnd == true, the curve is to be added to the end. \n - If toEnd == true, the curve is to be added to the beginning. \n \~ + If toEnd == false, the curve is to be added to the beginning. \n \~ \param[in] curve - \ru Добавляемая кривая \en A curve to be added. \~ \param[in,out] contour - \ru Модифицируемый контур. \en A contour to be modified. \~ \param[in] toEnd - \ru Флаг места добавления кривой. \en The flag determines the place of the curve in the contour. \~ + \param[in] epsilon - \ru Близость точек стыка при добавлении кривой. + \en The Proximity of the junction points. \~ \return \ru Возвращает код результата операции. \en Returns operation result code. \~ \ingroup Curve_Modeling @@ -607,7 +609,25 @@ MATH_FUNC (bool) CurveTrim( MbCurve & curve, //--- MATH_FUNC (MbResultType) AddCurveToContour( MbCurve & curve, MbContour & contour, - bool toEnd ); + bool toEnd, + double epsilon = METRIC_REGION ); + + +//------------------------------------------------------------------------------ +/** \brief \ru Создать контур из кривых. + \en Create a contour by curves. \~ + \details \ru В контур будут добавлены кривые curves, возможно инвертирование направления некоторых кривых. Неиспользованные кривые будут удалены. \n + \en Curves will be added to the contour, it is possible to invert the direction of some curves. Unused curves will be deleted. \n + \param[in] curve - \ru Кривые для построения контура. + \en Curves of the contour. \~ + \param[in] accuracy - \ru Максимальное расстояние точек сегментов в стыке. + \en The maximum distance of segment points at the junction. \~ + \return \ru Возвращает контур или nullptr. + \en Returns contour or nullptr. \~ + \ingroup Curve_Modeling +*/ +//--- +MATH_FUNC (MbContour *) CreateContour( std::vector & curves, double accuracy ); //------------------------------------------------------------------------------ @@ -802,7 +822,7 @@ MATH_FUNC (bool) IsLikeStraightLine( const MbCurve & curve, double eps ); DEPRECATE_DECLARE MATH_FUNC( MbContour * ) DeleteDegenerateSegments( const MbContour & cntr, bool modifySegments, - MbSNameMaker * names = c3d_null ); + MbSNameMaker * names = nullptr ); //------------------------------------------------------------------------------ /** \brief \ru Удалить вырожденные сегменты из контура. @@ -825,7 +845,7 @@ MATH_FUNC( MbContour * ) DeleteDegenerateSegments( const MbContour & cntr, MATH_FUNC( MbContour * ) DeleteDegenerateSegments( const MbContour & cntr, bool modifySegments, VERSION verison, - MbSNameMaker * names = c3d_null ); + MbSNameMaker * names = nullptr ); //------------------------------------------------------------------------------ diff --git a/C3d/Include/action_curve3d.h b/C3d/Include/action_curve3d.h index 16a3124..91df54a 100644 --- a/C3d/Include/action_curve3d.h +++ b/C3d/Include/action_curve3d.h @@ -35,6 +35,8 @@ class MATH_CLASS MbWireFrame; class MATH_CLASS MbItem; class MATH_CLASS MbName; class MATH_CLASS MbSweptData; +class MATH_CLASS MbCurveExtensionParameters; +class MATH_CLASS MbSNameMaker; struct MATH_CLASS EvolutionValues; @@ -283,11 +285,11 @@ MATH_FUNC (MbResultType) SpiralCurve( const MbPlacement3D & place, \details \ru Создать спираль. \n Если spiralAxis == true, то lawCurve - определяет плоскую ось спирали. \n Если spiralAxis == false, то lawCurve - определяет закон изменения радиуса спирали. \n - Если lawCurve == c3d_null, то строится коническая спираль с углом конусности angle. \n + Если lawCurve == nullptr, то строится коническая спираль с углом конусности angle. \n \en Create a spiral. \n If 'spiralAxis' == true, 'lawCurve' determines the axis of a spiral. \n If spiralAxis == false, then 'lawCurve' - determines a radius law. \n - If lawCurve == c3d_null, a conical spiral is created with the specified taper angle. \n \~ + If lawCurve == nullptr, a conical spiral is created with the specified taper angle. \n \~ \param[in] point0 - \ru Начало локальной системы координат (ЛСК). \en The origin of local coordinate system (LCS). \~ \param[in] point1 - \ru Точка на оси Z ЛСК. @@ -644,7 +646,7 @@ MATH_FUNC (MbResultType) CreatePolyArcCurve3D( const MbCurve3D & curve, MATH_FUNC (bool) GetSpaceCurve( const MbItem & item, bool keepPlacement, SPtr & curve0, - std::vector< SPtr > * curves = c3d_null ); + std::vector< SPtr > * curves = nullptr ); //------------------------------------------------------------------------------- @@ -666,9 +668,9 @@ MATH_FUNC (bool) GetSpaceCurve( const MbItem & item, \param[in] deviationAngle - \ru Параметру точности. \en The parameter of accuracy. \~ \return \ru Возвращает указатель на построенную кривую с нулевум счетчиком ссылок \n - или c3d_null, если не удалось построить развертку для заданных параметров. + или nullptr, если не удалось построить развертку для заданных параметров. \en The pointer to the constructed curve with zero counter of references\n - return c3d_null, if unwrap curve can't be construvted for this parameters + return nullptr, if unwrap curve can't be construvted for this parameters \ingroup Curve3D_Modeling */ // --- @@ -1362,4 +1364,30 @@ MATH_FUNC ( MbCurve3D * ) SetProportionalParametrization( MbCurve3D * curve, double tMin, double tMax); +//------------------------------------------------------------------------------ + /** \brief \ru Продлить заданную кривую. + \en Extend the given curve. \~ + \details \ru Продлить заданную кривую в соответствии с заданными параметрами. \n + \en Extend the given curve according to the given parameters. \~ \n + \param[in] sourceCurve - \ru Исходная (удлиняемая) кривая. + \en Source (extended) curve. \~ + \param[in] parameters - \ru Параметры продления. + \en Parameters of extension. \~ + \param[in] snMaker - \ru Именователь построенного ребра. + \en An object defining the edges names. \~ + \param[out] resFrame - \ru Результирующая кривая внутри каркаса. + \en Result curve in the wire-frame. \~ + \return \ru Возвращает код результата операции. В случае успеха всегда вернется ненулевая кривая (возможно, она будет совпадать с исходной кривой). + \en Returns the code of the operation result. In case of success, the result curve cannot be nullptr (it will be possibly the same as the source one). + \ingroup Curve3D_Modeling + \warning \ru В разработке. + \en Under development. \~ + */ +// --- +MATH_FUNC( MbResultType ) ExtendCurve( const MbCurve3D & sourceCurve, + const MbCurveExtensionParameters & parameters, + const MbSNameMaker & snMaker, + MbWireFrame *& resFrame ); + + #endif // __ACTION_CURVE3D_H diff --git a/C3d/Include/action_mesh.h b/C3d/Include/action_mesh.h index 02abe64..d32fb59 100644 --- a/C3d/Include/action_mesh.h +++ b/C3d/Include/action_mesh.h @@ -61,8 +61,8 @@ MATH_FUNC (void) CalculatePolygon( const MbCurve & curve, локальной системы координат. \en Create a polygonal object for two-dimensional object in the XOY-plane of the local coordinate system. \~ - \param[in] obj - \ru Двумерный объект (если c3d_null, то объект не создаётся). - \en Two-dimensional object (if c3d_null, object isn't created). \~ + \param[in] obj - \ru Двумерный объект (если nullptr, то объект не создаётся). + \en Two-dimensional object (if nullptr, object isn't created). \~ \param[in] plane - \ru Локальная система координат. \en A local coordinate system. \~ \param[in] sag - \ru Максимальное отклонение полигонального объекта от оригинала по прогибу. @@ -417,10 +417,31 @@ MATH_FUNC( MbResultType ) MeshMeshIntersection( const MbMesh & mesh1, const MbMesh & mesh2, std::vector< SPtr > & polylines ); +//------------------------------------------------------------------------------ +/** \brief \ru Создать полигональный объект булевой операции. + \en Create a polygon object of Boolean operation. \~ + \details \ru Построить полигональный объект как результат булевой операции над полигональными объектами. + \en Create a polygon object as a result of Boolean operation on the given polygon objects. + \param[in] mesh1 - \ru Первый полигональный объект. + \en The first polygon object. \~ + \param[in] mesh1 - \ru Второй полигональный объект. + \en The second polygon object. \~ + \param[in] operation - \ru Тип булевой операции. + \en A Boolean operation type. \~ + \param[out] newMesh - \ru Построенный полигональный объект. + \en Constructed polygon object. \~ + \result \ru Возвращает код результата операции. + \en Returns the operation result code. \~ + \ingroup Model_Creators +*/ +// --- +MATH_FUNC( MbResultType ) CreateBoolean( const MbMesh & mesh1, const MbMesh & mesh2, + OperationType operation, + SPtr & newMesh ); //------------------------------------------------------------------------------ /** \brief \ru Построить триангуляцию по облаку точек на основе алгоритма поворотного шара. - \en Build a triangulation by point cloud with Ball Pivoting algorithm. \~ + \en Build a triangulation by point cloud with Ball Pivoting algorithm. \~ \param[in] collection - \ru Коллекция трехмерных элементов. \en Collection of 3d elements. \~ \param[in] radius - \ru Радиус поворотного шара, если radius==0 будет предпринята попытка его автоопределения. @@ -442,4 +463,19 @@ MATH_FUNC (MbResultType) CalculateBallPivotingGrid( const MbCollection & collect double angle, MbMesh *& result ); + +//------------------------------------------------------------------------------ +/** \brief \ru Исправить несовместную ориентацию полигонов сетки по отношению друг к другу. + \en Repair inconsistent orientation of mesh polygons with respect to each other. \~ + \param[out] result - \ru Полигональный объект. + \en The polygonal object. \~ + \return \ru Возвращает код результата операции. + \en Returns operation result code. \~ + \ingroup Polygonal_Objects + \warning \ru В разработке. + \en Under development. \~ +*/ +// --- +MATH_FUNC (MbResultType) RepairInconsistentMesh( MbMesh & mesh ); + #endif // __ACTION_MESH_H diff --git a/C3d/Include/action_phantom.h b/C3d/Include/action_phantom.h index 176d456..e81bb05 100644 --- a/C3d/Include/action_phantom.h +++ b/C3d/Include/action_phantom.h @@ -184,7 +184,7 @@ MATH_FUNC (MbResultType) OffsetPhantom( const MbSolid & solid, const SweptValues & params, const MbSNameMaker & operNames, MbFaceShell *& result, - size_t * hpShellFaceInd = c3d_null ); // \ru Номер грани в исходной оболочки для построения хот-точки); \en The face number in the initial shell for a hot-point creation); + size_t * hpShellFaceInd = nullptr ); // \ru Номер грани в исходной оболочки для построения хот-точки); \en The face number in the initial shell for a hot-point creation); //------------------------------------------------------------------------------ @@ -261,7 +261,7 @@ MATH_FUNC (MbResultType) SmoothPositionData( const MbSolid & sol const SmoothValues & params, RPArray & result, double edgeParam = 0.5, - const MbCurveEdge * dimensionEdge = c3d_null ); + const MbCurveEdge * dimensionEdge = nullptr ); //------------------------------------------------------------------------------ @@ -293,7 +293,7 @@ MATH_FUNC (MbResultType) SmoothPositionData( const MbSolid & sol const SmoothValues & params, RPArray & result, double edgeParam = 0.5, - const MbCurveEdge * dimensionEdge = c3d_null ); + const MbCurveEdge * dimensionEdge = nullptr ); //------------------------------------------------------------------------------ diff --git a/C3d/Include/action_point.h b/C3d/Include/action_point.h index 70ce11b..4dae8eb 100644 --- a/C3d/Include/action_point.h +++ b/C3d/Include/action_point.h @@ -39,8 +39,8 @@ class MATH_CLASS MbFaceShell; \en Number of elements in the array. \~ \param[out] res - \ru Результат операции. \en The operation result. \~ - \return \ru Возвращает массив элементов, если он создан, или c3d_null в противном случае. - \en Returns an array of elements if it has been created, otherwise returns c3d_null. \~ + \return \ru Возвращает массив элементов, если он создан, или nullptr в противном случае. + \en Returns an array of elements if it has been created, otherwise returns nullptr. \~ \ingroup Algorithms_3D */ // --- @@ -48,11 +48,11 @@ template inline SArray * CreateArray( size_t cnt, MbResultType & res ) { SArray * arr = new SArray ( cnt, 1 ); - if ( arr != c3d_null && arr->GetAddr() == c3d_null ) { + if ( arr != nullptr && arr->GetAddr() == nullptr ) { delete arr; - arr = c3d_null; + arr = nullptr; } - if ( arr == c3d_null ) + if ( arr == nullptr ) res = rt_TooManyPoints; return arr; @@ -79,7 +79,7 @@ template inline bool ReserveArray( SArray & arr, size_t n, MbResultType & res ) { arr.Reserve( n ); - if ( arr.GetAddr() == c3d_null ) { + if ( arr.GetAddr() == nullptr ) { res = rt_TooManyPoints; return false; } @@ -107,7 +107,7 @@ template inline bool AddItem( SArray & arr, const Type & item, MbResultType & res ) { arr.Add( item ); - if ( arr.GetAddr() == c3d_null ) { + if ( arr.GetAddr() == nullptr ) { res = rt_TooManyPoints; return false; } diff --git a/C3d/Include/action_sheet.h b/C3d/Include/action_sheet.h index c887d64..1f5b54f 100644 --- a/C3d/Include/action_sheet.h +++ b/C3d/Include/action_sheet.h @@ -640,7 +640,7 @@ MATH_FUNC (MbResultType) UnbendSheetSolid( MbSolid & sol const MbCartPoint & fixedPoint, const MbSNameMaker & nameMaker, MbSolid *& result, - RPArray * ribContours = c3d_null ); + RPArray * ribContours = nullptr ); //------------------------------------------------------------------------------ @@ -1033,6 +1033,30 @@ MATH_FUNC(MbResultType) CreateStampWithToolSolidParts( MbSolid & MbSolid * & partsToSubtract ); +//------------------------------------------------------------------------------ +/** \brief \ru Нормализовать кромки выреза листового тела. + \en Normalize cut sides of the sheet solid. \~ + \details \ru Нормализовать кромки выреза листового тела. \n + \en Normalize cut sides of the sheet solid. \n \~ + \param[in] solid - \ru Исходное тело. + \en The source solid. \~ + \param[in] sameShell - \ru Флаг удаления оболочки исходного тела. + \en Whether to delete the shell of the source solid. \~ + \param[in] nameMaker - \ru Именователь. + \en An object for naming the new objects. \~ + \param[out] result - \ru Результирующее тело. + \en The resultant solid. \~ + \result \ru - Код результата операции. + \en - The operation result code. \~ + \ingroup Sheet_Metal_Modeling +*/ +// --- +MATH_FUNC(MbResultType) NormalizeCutSides ( MbSolid & solid, + MbeCopyMode sameShell, + const MbSNameMaker & nameMaker, + MbSolid *& result ); + + //------------------------------------------------------------------------------ /** \brief \ru Штамповка. \en Stamping. \~ diff --git a/C3d/Include/action_solid.h b/C3d/Include/action_solid.h index efb10aa..604cbfd 100644 --- a/C3d/Include/action_solid.h +++ b/C3d/Include/action_solid.h @@ -180,7 +180,7 @@ MATH_FUNC (MbResultType) MeshSolid( const MbMesh & mesh, const GridsToShellValues & params, const MbSNameMaker & names, MbSolid *& result, - IProgressIndicator * prog = c3d_null ); + IProgressIndicator * prog = nullptr ); //------------------------------------------------------------------------------ @@ -202,7 +202,7 @@ MATH_FUNC (MbResultType) MeshSolid( const MbMesh & mesh, MATH_FUNC (MbResultType) GridSolid( const MbGrid & grid, const MbSNameMaker & names, MbSolid *& result, - IProgressIndicator * prog = c3d_null ); + IProgressIndicator * prog = nullptr ); //------------------------------------------------------------------------------ @@ -227,7 +227,7 @@ MATH_FUNC (MbResultType) GridSolid( const MbGrid & grid, const GridsToShellValues & params, const MbSNameMaker & names, MbSolid *& result, - IProgressIndicator * prog = c3d_null ); + IProgressIndicator * prog = nullptr ); //------------------------------------------------------------------------------ @@ -249,7 +249,7 @@ MATH_FUNC (MbResultType) GridSolid( const MbGrid & grid, MATH_FUNC (MbResultType) CollectionSolid( const MbCollection & grid, const MbSNameMaker & names, MbSolid *& result, - IProgressIndicator * progBar = c3d_null ); + IProgressIndicator * progBar = nullptr ); //------------------------------------------------------------------------------ @@ -636,8 +636,8 @@ MATH_FUNC (MbResultType) EvolutionSolid( const MbSweptData & sweptData \en An array of generating contours coordinate systems. \~ \param[in] c - \ru Множество образующих контуров. \en An array of generating contours. \~ - \param[in] spine - \ru Направляющая кривая (может быть c3d_null). - \en A guide curve (can be c3d_null). \~ + \param[in] spine - \ru Направляющая кривая (может быть nullptr). + \en A guide curve (can be nullptr). \~ \param[in] params - \ru Параметры операции. \en The operation parameters. \~ \param[in] ps - \ru Множество точек на образующих контурах, задающий их начальные точки. @@ -672,8 +672,8 @@ MATH_FUNC (MbResultType) LoftedSolid( SArray & pl, \en An array of generating contours coordinate systems. \~ \param[in] c - \ru Множество образующих контуров. \en An array of generating contours. \~ - \param[in] spine - \ru Осевая кривая (может быть c3d_null). - \en A guide curve (can be c3d_null). \~ + \param[in] spine - \ru Осевая кривая (может быть nullptr). + \en A guide curve (can be nullptr). \~ \param[in] params - \ru Параметры операции. \en The operation parameters. \~ \param[in] guideCurves - \ru Множество направляющих кривых, задающих траектории соответствующих точек контуров. @@ -693,7 +693,7 @@ MATH_FUNC (MbResultType) LoftedSolid( SArray & pl, // --- MATH_FUNC (MbResultType) LoftedSolid( SArray & pl, RPArray & c, - const MbCurve3D * spine, // осевая линия может быть c3d_null + const MbCurve3D * spine, // осевая линия может быть nullptr const LoftedValues & params, RPArray * guideCurves, SArray * ps, @@ -711,8 +711,8 @@ MATH_FUNC (MbResultType) LoftedSolid( SArray & pl, \en An array of surfaces of generating contours. \~ \param[in] c - \ru Множество образующих контуров. \en An array of generating contours. \~ - \param[in] spine - \ru Осевая кривая (может быть c3d_null). - \en A guide curve (can be c3d_null). \~ + \param[in] spine - \ru Осевая кривая (может быть nullptr). + \en A guide curve (can be nullptr). \~ \param[in] params - \ru Параметры операции. \en The operation parameters. \~ \param[in] guideCurves - \ru Множество направляющих кривых, задающих траектории соответствующих точек контуров. @@ -732,7 +732,7 @@ MATH_FUNC (MbResultType) LoftedSolid( SArray & pl, // --- MATH_FUNC (MbResultType) LoftedSolid( RPArray & surfs, RPArray & c, - const MbCurve3D * spine, // осевая линия может быть c3d_null + const MbCurve3D * spine, // осевая линия может быть nullptr const LoftedValues & params, RPArray * guideCurves, SArray * ps, @@ -967,8 +967,8 @@ MATH_FUNC(MbResultType) EvolutionResult( MbSolid & solid, \en An array of generating contours coordinate systems. \~ \param[in] c - \ru Множество образующих контуров. \en An array of generating contours. \~ - \param[in] spine - \ru Направляющая кривая (может быть c3d_null). - \en A guide curve (can be c3d_null). \~ + \param[in] spine - \ru Направляющая кривая (может быть nullptr). + \en A guide curve (can be nullptr). \~ \param[in] params - \ru Параметры операции. \en The operation parameters. \~ \param[in] oType - \ru Тип булевой операции. @@ -1020,8 +1020,8 @@ MATH_FUNC(MbResultType) LoftedResult( MbSolid & solid, \en An array of generating contours surfaces. \~ \param[in] c - \ru Множество образующих контуров. \en An array of generating contours. \~ - \param[in] spine - \ru Осевая кривая (может быть c3d_null). - \en A guide curve (can be c3d_null). \~ + \param[in] spine - \ru Осевая кривая (может быть nullptr). + \en A guide curve (can be nullptr). \~ \param[in] params - \ru Параметры операции. \en The operation parameters. \~ \param[in] oType - \ru Тип булевой операции. @@ -1989,7 +1989,7 @@ MATH_FUNC (MbResultType) UnionResult( MbSolid * solid, const MbSNameMaker & names, bool isArray, MbSolid *& result, - RPArray * notGluedSolids = c3d_null ); + RPArray * notGluedSolids = nullptr ); //------------------------------------------------------------------------------ @@ -2032,7 +2032,7 @@ MATH_FUNC (MbResultType) UnionSolid( RPArray & solids, const MbSNameMaker & names, bool isArray, MbSolid *& result, - RPArray * notGluedSolids = c3d_null ); + RPArray * notGluedSolids = nullptr ); //------------------------------------------------------------------------------ @@ -2392,8 +2392,8 @@ MATH_FUNC (MbResultType) ThinSolid( const MbSurface & surface, //------------------------------------------------------------------------------ /** \brief \ru Создать отверстие, карман, фигурный паз в теле. \en Create a hole, a pocket, a groove in the solid. \~ - \details \ru Cоздать отверстие, карман, фигурный паз в теле или создать cверло, бобышку, если solid==c3d_null. \n - \en Create a hole, a pocket, a groove in the solid or create a drill, a boss if 'solid' == c3d_null. \n \~ + \details \ru Cоздать отверстие, карман, фигурный паз в теле или создать cверло, бобышку, если solid==nullptr. \n + \en Create a hole, a pocket, a groove in the solid or create a drill, a boss if 'solid' == nullptr. \n \~ \param[in] solid - \ru Исходное тело. \en The source solid. \~ \param[in] sameShell - \ru Режим копирования тела. diff --git a/C3d/Include/action_surface.h b/C3d/Include/action_surface.h index e7b8249..ff5a701 100644 --- a/C3d/Include/action_surface.h +++ b/C3d/Include/action_surface.h @@ -694,28 +694,26 @@ MATH_FUNC (MbResultType) TriBezierSurface( ptrdiff_t k, \en Create a triangular B-spline surface. \~ \details \ru Создать треугольную В-сплайн поверхность по 3 точкам. \n \en Create a triangular B-spline surface from three points. \n \~ - \param[in] p0 - \ru Первая точка. - \en The first point. \~ - \param[in] p1 - \ru Вторая точка. - \en The second point. \~ - \param[in] p2 - \ru Третья точка. - \en The third point. \~ - \param[in] d - \ru Порядок поверхности. - \en The surface order. \~ - \param[out] resSurface - \ru Треугольная В-сплайн поверхность. - \en The triangular B-spline surface. \~ + \param[in] surface - \ru Исходная поверхность. + \en The initial surface. \~ + \param[in] degree - \ru Порядок поверхности. + \en The surface order. \~ + \param[in] uCount - \ru Число элементов вдоль первого направления. + \en The elements count along first direction. \~ + \param[in] vCount - \ru Число элементов вдоль второго направления. + \en The elements count along second direction. \~ + \param[out] result - \ru Симплексная поверхность. + \en The simplex surface. \~ \result \ru Возвращает код результата операции. \en Returns operation result code. \~ \ingroup Surface_Modeling */ // --- -MATH_FUNC (MbResultType) TriSplineSurface( const MbCartPoint3D & p0, - const MbCartPoint3D & p1, - const MbCartPoint3D & p2, - const MbCartPoint3D & p3, - ptrdiff_t d, - ptrdiff_t count, - MbSurface *& resSurface ); +MATH_FUNC (MbResultType) SimplexSurface( const MbSurface & surface, + size_t degree, + size_t uCount, + size_t vCount, + MbSurface *& result ); //------------------------------------------------------------------------------ @@ -723,10 +721,10 @@ MATH_FUNC (MbResultType) TriSplineSurface( const MbCartPoint3D & p0, \en Create a characteristic polyline of a spline surface. \~ \details \ru Построить характеристическую ломаную сплайновой поверхности. \n Функция работает с поверхностями типа st_SplineSurface, st_HermitSurface, - st_TriBezierSurface, st_TriSplineSurface. \n + st_TriBezierSurface, st_SimplexSurface. \n \en Create a characteristic polyline of a spline surface. \n The function accepts the surfaces of types st_SplineSurface, st_HermitSurface, - st_TriBezierSurface, st_TriSplineSurface. \n \~ + st_TriBezierSurface, st_SimplexSurface. \n \~ \param[in] surf - \ru Поверхность. \en The surface. \~ \param[out] segments - \ru Сегменты характеристической ломаной. @@ -798,8 +796,8 @@ MATH_FUNC (MbResultType) MiddlePlaces( const MbCurve3D & curve1 \en The first guide curve. \~ \param[in] g2 - \ru Вторая направляющая кривая (g1==g2 совпадает с первой при cs_Round). \en The second guide curve (g1==g2 the same first guide for st_Round). \~ - \param[in] c0 - \ru Дополнительная направляющая кривая (может быть c3d_null). - \en The additional guide curve (may be c3d_null). \~ + \param[in] c0 - \ru Дополнительная направляющая кривая (может быть nullptr). + \en The additional guide curve (may be nullptr). \~ \param[in] form - \ru Форма сечения поверхности (0, 1, 2, 3). \en The form of the surface section (0, 1, 2, 3). \~ \param[in] sense - \ru Направление нормали поверхности направляющей кривой (для guide1==guide2). diff --git a/C3d/Include/action_surface_curve.h b/C3d/Include/action_surface_curve.h index f982e6d..1c04aa8 100644 --- a/C3d/Include/action_surface_curve.h +++ b/C3d/Include/action_surface_curve.h @@ -224,8 +224,8 @@ MATH_FUNC (MbResultType) OffsetCurve( const MbCurve3D & curve, //------------------------------------------------------------------------------ /** \brief \ru Создать проекцию кривой на поверхность. \en Create a curve projection onto the surface. \~ - \details \ru Создать проекцию кривой curve на поверхность surface (направление проецирования direction может быть c3d_null). \n - \en Create the projection of a curve onto surface 'surface' (the projection direction 'direction' can be c3d_null). \n \~ + \details \ru Создать проекцию кривой curve на поверхность surface (направление проецирования direction может быть nullptr). \n + \en Create the projection of a curve onto surface 'surface' (the projection direction 'direction' can be nullptr). \n \~ \param[in] surface - \ru Поверхность для проецирования. \en The surface to project onto. \~ \param[in] curve - \ru Проецируемая кривая. @@ -257,8 +257,8 @@ MATH_FUNC (MbResultType) CurveProjection( const MbSurface & surface, //------------------------------------------------------------------------------ /** \brief \ru Создать проекцию кривой на поверхность. \en Create a curve projection onto the surface. \~ - \details \ru Создать проекцию кривой curve на поверхность surface (направление проецирования direction может быть c3d_null). \n - \en Create the projection of a curve onto surface 'surface' (the projection direction 'direction' can be c3d_null). \n \~ + \details \ru Создать проекцию кривой curve на поверхность surface (направление проецирования direction может быть nullptr). \n + \en Create the projection of a curve onto surface 'surface' (the projection direction 'direction' can be nullptr). \n \~ \param[in] surface - \ru Поверхность для проецирования. \en The surface to project onto. \~ \param[in] curve - \ru Проецируемая кривая. @@ -1159,7 +1159,7 @@ MATH_FUNC (MbResultType) ConnectingSpline( const MbCurve3D & curve1, double t1, что начало кривой сопряжения будет находится в точке с параметором t1, t1 и t2 - параметры кривых curve1 и curve2, в соответствующих точках которых начинается и заканчивается скругление. \n Параметр sense - прямое или обратное направление кривой скругления. \n - Кривая filletCurve - это кривая сопряжения, дуга (когда surface == c3d_null) или кривая на поверхности цилиндра surface. \n + Кривая filletCurve - это кривая сопряжения, дуга (когда surface == nullptr) или кривая на поверхности цилиндра surface. \n Поверхность surface - это цилиндрическая поверхность, на которой строится кривая сопряжения в общем случае. Для управления жизненным циклом поверхномти следует миспользовать методы ::AddRefItem(surface) и ::ReleaseItem(surface). \n \en Create a fillet curve for curves. \n @@ -1175,7 +1175,7 @@ MATH_FUNC (MbResultType) ConnectingSpline( const MbCurve3D & curve1, double t1, that the fillet curve start is at the point with parameter t1, t1 and t2 are parameters of curves 'curve1' and 'curve2' which correspond to the start point and the end point of the fillet. \n Parameter 'sense' determines forward or backward orientation of the fillet curve. \n - Curve filletCurve is a fillet curve, an arc (when 'surface' == c3d_null) or a curve on a cylindric surface 'surface'. \n + Curve filletCurve is a fillet curve, an arc (when 'surface' == nullptr) or a curve on a cylindric surface 'surface'. \n Surface 'surface' is a cylindric surface on which the fillet curve is constructed in general case. Use ::AddRefItem(surface) and ::ReleaseItem(surface) methods to manage the surface lifecycle. \n \~ \param[in] curve1 - \ru Соединяемая кривая 1. @@ -1200,8 +1200,8 @@ MATH_FUNC (MbResultType) ConnectingSpline( const MbCurve3D & curve1, double t1, \en The fillet type. \~ \param[in] names - \ru Именователь кривых каркаса. \en An object defining the frame curves names. \~ - \param[out] surface - \ru Поверхность, которая будет создана и на которой базируется соединительная кривая, (может быть возращён c3d_null). - \en A surface on which the fillet curve is based on, it will be created by the method (can be c3d_null). \~ + \param[out] surface - \ru Поверхность, которая будет создана и на которой базируется соединительная кривая, (может быть возращён nullptr). + \en A surface on which the fillet curve is based on, it will be created by the method (can be nullptr). \~ \param[out] result - \ru Каркас с построенными кривыми. \en The frame with the constructed curves. \~ \return \ru Возвращает код результата операции. @@ -1309,29 +1309,53 @@ MATH_FUNC (MbResultType) CreateContourFillets( const MbContour3D & contour, угол между координатными кривыми "X" на плоскости и "U" на поверхности был бы равен angle. \n \en Construction of curves that wrap the surface, so that the point xy of the plane would be coincides with the point uv of the surface and the angle between the coordinate curves "X" on the plane and "U" on the surface would be equal to angle. \n \~ - \param[in] curves - \ru Двумерные кривые на плоскости "XY" локальной системы коорданат. - \en Two-dimensional curves on the "XY" plane of the local coordinate system. \~ - \param[in] place - \ru Локальная система коорданат (ЛСК). - \en The local coordinate system (LCS). \~ - \param[in] xy - \ru Точка на плоскости "XY" локальной системы координат. - \en A point on the "XY" plane of the local coordinate system. \~ - \param[in] surface - \ru Поверхность. - \en The surface. \~ - \param[in] uv - \ru Точка на параметрической плоскости "UV" поверхности. - \en A point on the parametric plane " UV " of the surface. \~ - \param[in] angle - \ru Угол поворота плоскости "XY" ЛСК и параметрической плоскости "UV" поверхности. - \en The angle of rotation of the LSC "XY" plane and the parametric "UV" plane of the surface. \~ - \param[in] sense - \ru Совпадение направлений оси "X" ЛСК и оси "U" поверхности. - \en The coincidence of the directions of the "X" axis of the LSC and the "U" axis of the surface. \~ + \param[in] curves - \ru Двумерные кривые на плоскости "XY" локальной системы коорданат. + \en Two-dimensional curves on the "XY" plane of the local coordinate system. \~ + \param[in] place - \ru Локальная система коорданат (ЛСК). + \en The local coordinate system (LCS). \~ + \param[in] xy - \ru Точка на плоскости "XY" локальной системы координат. + \en A point on the "XY" plane of the local coordinate system. \~ + \param[in] surface - \ru Поверхность. + \en The surface. \~ + \param[in] uv - \ru Точка на параметрической плоскости "UV" поверхности. + \en A point on the parametric plane " UV " of the surface. \~ + \param[in] angle - \ru Угол поворота плоскости "XY" ЛСК и параметрической плоскости "UV" поверхности. + \en The angle of rotation of the LSC "XY" plane and the parametric "UV" plane of the surface. \~ + \param[in] sense - \ru Совпадение направлений оси "X" ЛСК и оси "U" поверхности. + \en The coincidence of the directions of the "X" axis of the LSC and the "U" axis of the surface. \~ + \param[in] keepLeng - \ru Соответствует ли длина кривых оригиналам на криволинейных поверхностях?. + \en Does the curves length correspond to the originals on curved surfaces? \~ \param[out] surfaceCurves - \ru Построенные кривые на поверхности. \en Constructed curves on the surface. \~ \return \ru true - если построение выполнено успешно, false - в противном случае. \n \en true - if the build is successful, false - otherwise. \n + \ingroup Curve3D_Modeling */ // --- MATH_FUNC (MbResultType) CurvesWrapping( const std::vector & curves, const MbPlacement3D & place, const MbCartPoint & xy, - const MbSurface & surface, const MbCartPoint & uv, double angle, bool sense, + const MbSurface & surface, const MbCartPoint & uv, double angle, bool sense, bool keepLength, std::vector & surfaceCurves ); +//------------------------------------------------------------------------------ +/** \brief \ru Создать кривую или контур на поверхности грани по заданным рёбрам. + \en Construct a curve or contour on the surface of a face along the specified edges. \~ + \details \ru Строится кривая или контур на поверхности грани по копиям соответствующих двумерных кривых, лежащих в кривых пересечения рёбер. \n + \en A curve or contour is constructed on the surface of a face based on copies of the corresponding two-dimensional curves lying in the intersection curves of edges. \n \~ + \param[in] face - \ru Общая для рёбер грань. + \en The face common to the edges. \~ + \param[in] edges - \ru Рёбра. + \en The edges. \~ + \param[in] accuracy - \ru Максимальное расстояние точек сегментов в стыке. + \en The maximum distance of segment points at the junction. \~ + \return \ru Возвращает кривую или контур на поверхности (nullptr - в случае неудачи). + \en Returns a curve or contour on a surface (nullptr - in case of failure). \~ + \ingroup Curve3D_Modeling +*/ +// --- +MATH_FUNC (MbCurve3D *) MakeCurveOnSurface( const MbFace & face, + const std::vector & edges, + double accuracy ); + + #endif // __ACTION_SURFACE_CURVE_H diff --git a/C3d/Include/alg_base.h b/C3d/Include/alg_base.h index 0a4b105..be44432 100644 --- a/C3d/Include/alg_base.h +++ b/C3d/Include/alg_base.h @@ -603,7 +603,7 @@ bool IsPlanar( const SpacePointsVector & pnts, MbPlacement3D * place, double mEp } } } - if ( isPlanar && place != c3d_null ) + if ( isPlanar && place != nullptr ) place->Init( wrkPlace ); } } @@ -759,6 +759,25 @@ template MATH_FUNC (void) SortArray( DoubleParamsVector & tt0, double eps, bool checkCoincidentParams ); +//------------------------------------------------------------------------------ +/** \brief \ru Перебросить параметр на период. + \en Re-roll the parameter for a period. \~ + \details \ru Перебросить параметр на период. Переброс происходит в сторону начального приближения. + \en Re-roll the parameter for a period. The transfer occurs towards the initial approximation. \~ + \param[in] period - \ru Период. + \en Period. \~ + \param[in] p0 - \ru Начальное приближение параметра. + \en Initial approximation of the parameter. \~ + \param[in,out] p - \ru Уточняемый параметр. + \en The parameter to refine. \~ + \return \ru Возвращает true, если переброс был выполнен, \n иначе - false. + \en True if a parameter was changed, \n otherwise - false. \~ + + \ingroup Base_Algorithms +*/ // --- +MATH_FUNC( bool ) CorrectCiclicParameter( double period, double p0, double & p ); + + //------------------------------------------------------------------------------ /** \brief \ru Уточнить параметр. \en Refine the parameter. \~ diff --git a/C3d/Include/alg_curve_delete_part.h b/C3d/Include/alg_curve_delete_part.h index 3e8d763..320f7ee 100644 --- a/C3d/Include/alg_curve_delete_part.h +++ b/C3d/Include/alg_curve_delete_part.h @@ -92,8 +92,8 @@ MATH_FUNC (MbeState) DeleteCurvePart( const MbCartPoint & p1, \en The point indicating the piece of a curve to be kept. \~ \param[in, out] curve - \ru Изменяемая кривая. \en The curve to be modified. \~ - \param[in, out] part2 - \ru Всегда c3d_null. - \en This value is always c3d_null. \~ + \param[in, out] part2 - \ru Всегда nullptr. + \en This value is always nullptr. \~ \return \ru Состояние кривой после ее модификации. \en The state of a curve after its modification. \~ \warning \ru Для внутреннего использования. @@ -124,8 +124,8 @@ MATH_FUNC (MbeState) TrimmCurvePart( List & curveList, \en The point indicating the piece of a closed curve to be kept \~ \param[in, out] curve - \ru Изменяемая кривая. \en The curve to be modified. \~ - \param[in, out] part2 - \ru Всегда c3d_null. - \en This value is always c3d_null. \~ + \param[in, out] part2 - \ru Всегда nullptr. + \en This value is always nullptr. \~ \return \ru Состояние кривой после ее модификации. \en The state of a curve after its modification. \~ \warning \ru Для внутреннего использования. @@ -155,8 +155,8 @@ MATH_FUNC (MbeState) TrimmCurvePart( const MbCartPoint & p1, \en Boundary curve for justification. \~ \param[in] pnt - \ru Точка для выбора нужной части кривой. \en The point for selecting the piece of a curve. \~ - \param[in, out] part2 - \ru Всегда c3d_null. - \en This value is always c3d_null. \~ + \param[in, out] part2 - \ru Всегда nullptr. + \en This value is always nullptr. \~ \return \ru Состояние кривой после ее модификации. \en The state of a curve after modification. \~ \warning \ru Для внутреннего использования. @@ -222,8 +222,8 @@ MATH_FUNC (MbeState) BreakByClosedCurves( MbCurve & curve, const RPArray & limits, bool inside, PArray & part2, - SArray * cross = c3d_null, - bool * isEqualCurve = c3d_null, + SArray * cross = nullptr, + bool * isEqualCurve = nullptr, bool cutOnCurve = false ); diff --git a/C3d/Include/alg_dimension.h b/C3d/Include/alg_dimension.h index 11ab760..86fcc0f 100644 --- a/C3d/Include/alg_dimension.h +++ b/C3d/Include/alg_dimension.h @@ -440,7 +440,7 @@ MATH_FUNC (MbeProcessState) MinMaxDistances( const MbSurface & surface1, MbMinMaxSurfDists & allResults, MbMinMaxSurfDists & minResults, MbMinMaxSurfDists & maxResults, - IProgressIndicator * indicator = c3d_null ); + IProgressIndicator * indicator = nullptr ); #endif // __ALG_DIMENSION_H diff --git a/C3d/Include/alg_draw.h b/C3d/Include/alg_draw.h index 538675f..2e0d2dd 100644 --- a/C3d/Include/alg_draw.h +++ b/C3d/Include/alg_draw.h @@ -1028,7 +1028,7 @@ void DrawVertexEdges( const Vertex * vertex, int vR, int vG, int vB, MbStepData stepData( ist_SpaceStep, Math::visualSag ); MbFormNote note(true, false); for ( size_t k = 0, cnt = edges.size(); k < cnt; ++k ) { - if ( edges[k] != c3d_null ) { + if ( edges[k] != nullptr ) { edges[k]->GetCurve().CalculateMesh( stepData, note, edgeMesh ); DrawGI::DrawMesh( &edgeMesh, TRGB_WHITE ); DrawGI::DrawMesh( &edgeMesh, eR, eG, eB ); diff --git a/C3d/Include/alg_indicator.h b/C3d/Include/alg_indicator.h index 658a593..dfda2a8 100644 --- a/C3d/Include/alg_indicator.h +++ b/C3d/Include/alg_indicator.h @@ -124,7 +124,7 @@ public: }; -#define EMPTY_STR StrData( c3d_null ) ///< \ru Создание пустой строки \en Creation of an empty string +#define EMPTY_STR StrData( nullptr ) ///< \ru Создание пустой строки \en Creation of an empty string //------------------------------------------------------------------------------ @@ -279,14 +279,14 @@ MATH_FUNC (ProgressBarWrapper *) CreateProgressBar( IProgressIndicator * progInd \en The wrapper of the execution progress indicator. \~ \param[in] msg - \ru Данные о строке. \en Data of a string \~ - \return \ru true, если progBar != c3d_null и удалось задать имя процесса. + \return \ru true, если progBar != nullptr и удалось задать имя процесса. \en true if 'progBar' is not null and the process name is successfully set. \~ \ingroup Base_Items */ // --- inline bool SetProgressBarName( ProgressBarWrapper * progBar, IStrData & msg ) { - if ( progBar != c3d_null ) + if ( progBar != nullptr ) return progBar->SetName( msg ); return false; } @@ -308,7 +308,7 @@ inline bool SetProgressBarName( ProgressBarWrapper * progBar, IStrData & msg ) // --- inline bool SetProgressBarValue( ProgressBarWrapper * progBar, size_t v ) { - if ( progBar != c3d_null && !progBar->IsCancel() ) + if ( progBar != nullptr && !progBar->IsCancel() ) return progBar->SetProgress( v ); return false; } @@ -328,7 +328,7 @@ inline bool SetProgressBarValue( ProgressBarWrapper * progBar, size_t v ) // --- inline void FinishProgressBar( ProgressBarWrapper * progBar ) { - if ( progBar != c3d_null ) { + if ( progBar != nullptr ) { if ( progBar->IsCancel() ) progBar->Stop(); else progBar->Success(); } @@ -347,7 +347,7 @@ inline void FinishProgressBar( ProgressBarWrapper * progBar ) // --- inline bool StopProgressBar( ProgressBarWrapper * progBar ) { - if ( progBar != c3d_null && progBar->IsCancel() ) { + if ( progBar != nullptr && progBar->IsCancel() ) { progBar->Stop(); return true; } @@ -362,14 +362,14 @@ inline bool StopProgressBar( ProgressBarWrapper * progBar ) \en The wrapper of the execution progress indicator. \~ \param[in] useParentName - \ru Флаг использования имени родителя. \en The flag of using the parent name. \~ - \return \ru true, если progBar != c3d_null. + \return \ru true, если progBar != nullptr. \en true if 'progBar' is not null. \~ \ingroup Base_Items */ // --- inline bool UseParentName( ProgressBarWrapper * progBar, bool useParentName ) { - if ( progBar != c3d_null ) { + if ( progBar != nullptr ) { progBar->UseParentName( useParentName ); return true; } @@ -389,7 +389,7 @@ inline bool UseParentName( ProgressBarWrapper * progBar, bool useParentName ) // --- inline bool IsParentNameUsed( const ProgressBarWrapper * progBar ) { - if ( progBar != c3d_null ) + if ( progBar != nullptr ) return progBar->IsParentNameUsed(); return false; diff --git a/C3d/Include/alg_mesh_to_brep.h b/C3d/Include/alg_mesh_to_brep.h index fec6646..08c8433 100644 --- a/C3d/Include/alg_mesh_to_brep.h +++ b/C3d/Include/alg_mesh_to_brep.h @@ -76,7 +76,7 @@ MbFaceShell * ConvertGridToShell( const MbGrid & grid, const GridsToShellValues & params, const MbSNameMaker & snMaker, MbResultType & res, - IProgressIndicator * progBar = c3d_null ); + IProgressIndicator * progBar = nullptr ); //------------------------------------------------------------------------------ @@ -86,7 +86,7 @@ MbFaceShell * ConvertMeshToShell( const MbMesh & mesh, const GridsToShellValues & params, const MbSNameMaker & snMaker, MbResultType & res, - IProgressIndicator * progBar = c3d_null ); + IProgressIndicator * progBar = nullptr ); //------------------------------------------------------------------------------ diff --git a/C3d/Include/alg_nurbs_conic.h b/C3d/Include/alg_nurbs_conic.h index d93d98f..4984f49 100644 --- a/C3d/Include/alg_nurbs_conic.h +++ b/C3d/Include/alg_nurbs_conic.h @@ -57,9 +57,9 @@ class MbVector3D; \en The discriminant is less than 1. Otherwise it will be set to 0.99999999 automatically. \~ \return \ru Указатель на построенную кривую \n - c3d_null, если не удалось построить конику для заданных параметров. + nullptr, если не удалось построить конику для заданных параметров. \en The pointer to the constructed curve \n - is c3d_null if a try to construct a conic for a given parameters has failed. \~ + is nullptr if a try to construct a conic for a given parameters has failed. \~ \ingroup Curve3D_Modeling */ // --- @@ -87,9 +87,9 @@ MATH_FUNC ( MbCurve3D * ) NurbsConic_1( const MbCartPoint3D & mbPoint0, const Mb \en The discriminant is less than 1. Otherwise it will be set to 0.99999999 automatically. \~ \return \ru Указатель на построенную кривую \n - c3d_null, если не удалось построить конику для заданных параметров. + nullptr, если не удалось построить конику для заданных параметров. \en The pointer to the constructed curve \n - is c3d_null if a try to construct a conic for a given parameters has failed. \~ + is nullptr if a try to construct a conic for a given parameters has failed. \~ \ingroup Curve_Modeling */ // --- @@ -113,9 +113,9 @@ MATH_FUNC ( MbCurve * ) NurbsConic_1( const MbCartPoint & mbPoint0, const MbCart \param[in] mbVertex - \ru Координаты вершины угла, в который надо вписать конику. \en Coordinates of the vertex of angle which should be inscribed into the conic. \~ \return \ru Указатель на построенную кривую \n - c3d_null, если не удалось постороить конику для заданных параметров. + nullptr, если не удалось постороить конику для заданных параметров. \en The pointer to the constructed curve \n - is c3d_null if a try to construct a conic for given parameters has failed. \~ + is nullptr if a try to construct a conic for given parameters has failed. \~ \ingroup Curve3D_Modeling */ // --- @@ -138,9 +138,9 @@ MATH_FUNC ( MbCurve3D * ) NurbsConic_2( std::vector & vmbConicPoi \param[in] mbVertex - \ru Координаты вершины угла, в который надо вписать конику. \en Coordinates of the vertex of angle which should be inscribed into the conic. \~ \return \ru Указатель на построенную кривую \n - c3d_null, если не удалось постороить конику для заданных параметров. + nullptr, если не удалось постороить конику для заданных параметров. \en The pointer to the constructed curve \n - is c3d_null if a try to construct a conic for given parameters has failed. \~ + is nullptr if a try to construct a conic for given parameters has failed. \~ \ingroup Curve_Modeling */ // --- @@ -165,9 +165,9 @@ MATH_FUNC ( MbCurve * ) NurbsConic_2( std::vector & vmbConicPoints, \param[in] mbTangent2 - \ru Наклон в конце кривой. \en Inclination at end of a curve. \~ \return \ru Указатель на построенную кривую \n - c3d_null, если не удалось постороить конику для заданных параметров. + nullptr, если не удалось постороить конику для заданных параметров. \en The pointer to the constructed curve \n - is c3d_null if a try to construct a conic for given parameters has failed. \~ + is nullptr if a try to construct a conic for given parameters has failed. \~ \ingroup Curve3D_Modeling */ // --- @@ -193,9 +193,9 @@ MATH_FUNC ( MbCurve3D * ) NurbsConic_3( const std::vector & vmbCo \param[in] mbTangent2 - \ru Наклон в конце кривой. \en Inclination at end of a curve. \~ \return \ru Указатель на построенную кривую \n - c3d_null, если не удалось постороить конику для заданных параметров. + nullptr, если не удалось постороить конику для заданных параметров. \en The pointer to the constructed curve \n - is c3d_null if a try to construct a conic for given parameters has failed. \~ + is nullptr if a try to construct a conic for given parameters has failed. \~ \ingroup Curve_Modeling */ // --- @@ -224,9 +224,9 @@ MATH_FUNC ( MbCurve * ) NurbsConic_3( const std::vector & vmbConicP \en The discriminant is less than 1. Otherwise it will be set to 0.99999999 automatically. \~ \return \ru Указатель на построенную кривую \n - c3d_null, если не удалось построить конику для заданных параметров. + nullptr, если не удалось построить конику для заданных параметров. \en The pointer to the constructed curve \n - is c3d_null if a try to construct a conic for given parameters has failed. \~ + is nullptr if a try to construct a conic for given parameters has failed. \~ \ingroup Curve3D_Modeling */ // --- @@ -256,9 +256,9 @@ MATH_FUNC ( MbCurve3D * ) NurbsConic_4( const MbCartPoint3D & mbPoint1, const Mb \en The discriminant is less than 1. Otherwise it will be set to 0.99999999 automatically. \~ \return \ru Указатель на построенную кривую \n - c3d_null, если не удалось построить конику для заданных параметров. + nullptr, если не удалось построить конику для заданных параметров. \en The pointer to the constructed curve \n - is c3d_null if a try to construct a conic for given parameters has failed. \~ + is nullptr if a try to construct a conic for given parameters has failed. \~ \ingroup Curve_Modeling */ // --- @@ -288,9 +288,9 @@ MATH_FUNC ( MbCurve * ) NurbsConic_4( const MbCartPoint & mbPoint1, const MbCart \param[in] tanPntNb - \ru Номер точке, в которой задан наклон. \en Point number at which the inclination is specified. \~ \return \ru Указатель на построенную кривую \n - c3d_null, если не удалось постороить конику для заданных параметров. + nullptr, если не удалось постороить конику для заданных параметров. \en The pointer to the constructed curve \n - is c3d_null if a try to construct a conic for given parameters has failed. \~ + is nullptr if a try to construct a conic for given parameters has failed. \~ \ingroup Curve3D_Modeling */ // --- @@ -319,9 +319,9 @@ MATH_FUNC ( MbCurve3D * ) NurbsConic_5( const std::vector & vmbCo \param[in] tanPntNb - \ru Номер точке, в которой задан наклон. \en Point number at which the inclination is specified. \~ \return \ru Указатель на построенную кривую \n - c3d_null, если не удалось постороить конику для заданных параметров. + nullptr, если не удалось постороить конику для заданных параметров. \en The pointer to the constructed curve \n - is c3d_null if a try to construct a conic for given parameters has failed. \~ + is nullptr if a try to construct a conic for given parameters has failed. \~ \ingroup Curve_Modeling */ // --- @@ -342,9 +342,9 @@ MATH_FUNC ( MbCurve * ) NurbsConic_5( const std::vector & vmbConicP \en The container for points of a conic: the first point is start point, the last point is end point. there should be exactly 5 points. \~ \return \ru Указатель на построенную кривую \n - c3d_null, если не удалось постороить конику для заданных параметров. + nullptr, если не удалось постороить конику для заданных параметров. \en The pointer to the constructed curve \n - is c3d_null if a try to construct a conic for given parameters has failed. \~ + is nullptr if a try to construct a conic for given parameters has failed. \~ \ingroup Curve3D_Modeling */ // --- @@ -365,9 +365,9 @@ MATH_FUNC ( MbCurve3D * ) NurbsConic_6( const std::vector & vmbCo \en The container for points of a conic: the first point is start point, the last point is end point. there should be exactly 5 points. \~ \return \ru Указатель на построенную кривую \n - c3d_null, если не удалось постороить конику для заданных параметров. + nullptr, если не удалось постороить конику для заданных параметров. \en The pointer to the constructed curve \n - is c3d_null if a try to construct a conic for given parameters has failed. \~ + is nullptr if a try to construct a conic for given parameters has failed. \~ \ingroup Curve_Modeling */ // --- diff --git a/C3d/Include/alg_polyline.h b/C3d/Include/alg_polyline.h index b6732f8..068d953 100644 --- a/C3d/Include/alg_polyline.h +++ b/C3d/Include/alg_polyline.h @@ -43,14 +43,14 @@ class MATH_CLASS MbCubicSpline3D; радиус скругления в этой точке. При создании заполняются поля m_lineSeg и m_arcSeg. m_lineSeg - это прямолинейный сегмент из этой точки в следующую. Для последней точки и замкнутой ломаной - из последней в первую. m_arcSeg - дуга скругления в данной точке. - Если какой-то сегмент был полностью удален или не создан, то его указатель должен быть c3d_null. + Если какой-то сегмент был полностью удален или не создан, то его указатель должен быть nullptr. Объектами m_lineSeg и m_arcSeg не владеет, поэтому и не удаляет их. Объекты из полилинии. \en Some points may be deleted while the construction, therefore the old index is entered, it is filled and used in a model. Parameters of a point are its coordinates and fillet radius in this point. In a time of creation the fields 'm_lineSeg' and 'm_lineSeg' are being filled. 'm_lineSeg' is the straight-line segment from this point to the next point. For the last point and a closed polyline - from the last point to the first point. 'm_arcSeg'is the arc of a fillet in the given point. - If a segment has been fully deleted or it was not created then the pointer should be c3d_null. + If a segment has been fully deleted or it was not created then the pointer should be nullptr. Object 'm_lineSeg' and 'm_arcSeg' are not owned, therefore they are not deleted. Objects from a polyline. \~ \ingroup Data_Structures */ @@ -69,8 +69,8 @@ public: : m_oldIndex( SYS_MAX_T ) , m_point () , m_radius ( 0.0 ) - , m_lineSeg ( c3d_null ) - , m_arcSeg ( c3d_null ) + , m_lineSeg ( nullptr ) + , m_arcSeg ( nullptr ) {} /// \ru Конструктор копирования. \en Copy constructor. Polyline3DPoint( const Polyline3DPoint & other ) @@ -250,9 +250,9 @@ MATH_FUNC (void) CreateSmoothFromBezier( const MbBezier & bez, RPArray /** \brief \ru Создать кривую заданного типа базе NURBS-кривой. \en Create a curve of a given type as NURBS-curve. \~ \details \ru Работает для двух типов: pt_LineSegment и pt_Arc. Если не удалось - аппроксимировать с заданной точностью функция вернет c3d_null. + аппроксимировать с заданной точностью функция вернет nullptr. \en It works for the two types: 'pt_LineSegment' and 'pt_Arc'. If approximation with the given tolerance has failed - then the function returns c3d_null. \~ + then the function returns nullptr. \~ \param[in] nurbs - \ru Исходная NURBS-кривая. \en The initial NURBS-curve. \~ \param[in] type - \ru Тип кривой, которую требуется создать. @@ -288,7 +288,7 @@ MATH_FUNC (MbCurve *) ConvertNurbsToCurveOfType( const MbNurbs & nurbs, MbePlane */ // --- MATH_FUNC (MbCurve *) GetFlatCurve( const MbCurve3D & curve3D, const MbMatrix3D & into, - MbRect1D * pRgn = c3d_null, VERSION version = Math::DefaultMathVersion() ); + MbRect1D * pRgn = nullptr, VERSION version = Math::DefaultMathVersion() ); //------------------------------------------------------------------------------ diff --git a/C3d/Include/assembly.h b/C3d/Include/assembly.h index 7f94882..211534b 100644 --- a/C3d/Include/assembly.h +++ b/C3d/Include/assembly.h @@ -95,10 +95,10 @@ public: // \ru Общие функции геометрического объекта \en Common functions of a geometric object virtual MbeSpaceType IsA() const; // \ru Тип объекта. \en An object type. - virtual MbSpaceItem & Duplicate( MbRegDuplicate * iReg = c3d_null ) const; // \ru Создать копию. \en Create a copy. - virtual void Transform( const MbMatrix3D &, MbRegTransform * iReg = c3d_null ); // \ru Преобразовать согласно матрице. \en Transform according to the matrix. - virtual void Move( const MbVector3D &, MbRegTransform * iReg = c3d_null ); // \ru Сдвинуть вдоль вектора. \en Move along a vector. - virtual void Rotate( const MbAxis3D &, double angle, MbRegTransform * iReg = c3d_null ); // \ru Повернуть вокруг оси. \en Rotate about an axis. + virtual MbSpaceItem & Duplicate( MbRegDuplicate * iReg = nullptr ) const; // \ru Создать копию. \en Create a copy. + virtual void Transform( const MbMatrix3D &, MbRegTransform * iReg = nullptr ); // \ru Преобразовать согласно матрице. \en Transform according to the matrix. + virtual void Move( const MbVector3D &, MbRegTransform * iReg = nullptr ); // \ru Сдвинуть вдоль вектора. \en Move along a vector. + virtual void Rotate( const MbAxis3D &, double angle, MbRegTransform * iReg = nullptr ); // \ru Повернуть вокруг оси. \en Rotate about an axis. virtual bool IsSame( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const; // \ru Являются ли объекты равными? \en Are the objects equal? virtual bool IsSimilar( const MbSpaceItem & ) const; // \ru Являются ли объекты подобными? \en Are the objects similar? virtual bool SetEqual ( const MbSpaceItem & ); // \ru Сделать объекты равным \en Make the objects equal @@ -152,11 +152,11 @@ public: virtual const MbItem * GetItemByName( SimpleName n, MbPath & path, MbMatrix3D & from ) const; // \ru Преобразовать согласно матрице c использованием регистратора селектированные содержимые объекты. \en Transform selected objects according to the matrix using the registrator. - virtual void TransformSelected( const MbMatrix3D & matr, MbRegTransform * iReg = c3d_null ); + virtual void TransformSelected( const MbMatrix3D & matr, MbRegTransform * iReg = nullptr ); // \ru Сдвинуть вдоль вектора с использованием регистратора селектированные содержимые объекты. \en Move selected objects along the vector using the registrator. - virtual void MoveSelected( const MbVector3D & to, MbRegTransform * iReg = c3d_null ); + virtual void MoveSelected( const MbVector3D & to, MbRegTransform * iReg = nullptr ); // \ru Повернуть вокруг оси на заданный угол с использованием регистратора селектированные содержимые объекты. \en Rotate selected objects about the axis by the given angle using the registrator. - virtual void RotateSelected( const MbAxis3D & axis, double angle, MbRegTransform * iReg = c3d_null ); + virtual void RotateSelected( const MbAxis3D & axis, double angle, MbRegTransform * iReg = nullptr ); /// \ru Отдать селектированные содержимые объекты. \en Get selected objects. bool DetachSelected( RPArray & items, SArray & matrs, bool selected = true ); /// \ru Отцепить все видимые или невидимые объекты. \en Detach all visible or invisible objects. \~ @@ -248,6 +248,11 @@ public: void SetReactor( ItAssemblyReactor * ) const; /// \ru Импортировать систему ограничений из приложения САПР. \ru Import the constraint system from CAD application. bool Import( ItAssemblyImportData & ); + /** + \brief \ru Включить журналирование и назначить файл для записи журнала вызовов C3D Solver. + \en Switch on the journaling and specify the file for recording a journal of C3D Solver calls. \~ + */ + bool SetJournal( const char * fName ); public: /** \} */ @@ -273,6 +278,8 @@ private: SimpleName _NewItemName() const; /// \ru Добавить в сборку объекты сборки без трансформации. \en Add assembly items to the assembly without transformation. bool _AddAssemblyItems( MbAssembly & ); + // Access to non-const reference of the constraint system. + MbConstraintSystem & _System(); OBVIOUS_PRIVATE_COPY( MbAssembly ); }; // MbAssembly @@ -313,8 +320,8 @@ template MbAssembly::MbAssembly( const ItemsVector & items ) : MbItem() , assemblyItems() - , constraintSystem( c3d_null ) - , m_reactor( c3d_null ) + , constraintSystem( nullptr ) + , m_reactor( nullptr ) { #ifdef C3D_DEBUG // Check a condition of the single owner. @@ -339,7 +346,7 @@ MbAssembly::MbAssembly( const ItemsVector & items ) template void MbAssembly::_Init( const ItemsVector & items ) { - C3D_ASSERT( assemblyItems.empty() && (constraintSystem == c3d_null) ); + C3D_ASSERT( assemblyItems.empty() && (constraintSystem == nullptr) ); SimpleName idCounter = 0; for ( size_t i = 0, iCount = items.size(); i < iCount; ++i ) @@ -386,7 +393,7 @@ void MbAssembly::GetFacesSet( FacesVector & faces ) const template void MbInstance::GetFacesSet( FacesVector & faces ) const { - if ( item != c3d_null ) { + if ( item != nullptr ) { if ( item->IsA() == st_Solid ) static_cast( *item ).GetFacesSet( faces ); else if ( item->IsA() == st_Assembly ) diff --git a/C3d/Include/assisting_item.h b/C3d/Include/assisting_item.h index 06a7861..ab9ba53 100644 --- a/C3d/Include/assisting_item.h +++ b/C3d/Include/assisting_item.h @@ -51,10 +51,10 @@ public : // \ru Общие функции геометрического объекта. \en Common functions of a geometric object. virtual MbeSpaceType IsA() const; // \ru Тип объекта. \en An object type. - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Создать копию. \en Create a copy. - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать согласно матрице. \en Transform according to the matrix. - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвинуть вдоль вектора. \en Move along a vector. - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси. \en Rotate about an axis. + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Создать копию. \en Create a copy. + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать согласно матрице. \en Transform according to the matrix. + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвинуть вдоль вектора. \en Move along a vector. + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси. \en Rotate about an axis. virtual bool IsSame ( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const; // \ru Являются ли объекты равными? \en Whether the objects are equal? virtual bool IsSimilar( const MbSpaceItem & init ) const; // \ru Являются ли объекты подобными? \en Whether the objects are similar? virtual bool SetEqual ( const MbSpaceItem & init ); // \ru Сделать объекты равным. \en Make the objects equal. diff --git a/C3d/Include/attr_color.h b/C3d/Include/attr_color.h index 6516b24..6f4e050 100644 --- a/C3d/Include/attr_color.h +++ b/C3d/Include/attr_color.h @@ -185,7 +185,7 @@ public : virtual MbeAttributeType AttributeType() const; // \ru Дать подтип атрибута. \en Get subtype of an attribute. - virtual MbAttribute & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента. \en Create a copy of the element. + virtual MbAttribute & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента. \en Create a copy of the element. virtual bool IsSame( const MbAttribute &, double accuracy ) const; // \ru Определить, являются ли объекты равными. \en Determine whether objects are equal. virtual bool Init( const MbAttribute & ); // \ru Инициализировать данные по присланным. \en Initialize data. @@ -234,7 +234,7 @@ public : // \ru Общие функции объекта \en Common functions of object. virtual MbeAttributeType AttributeType() const; // \ru Дать подтип атрибута. \en Get subtype of an attribute. - virtual MbAttribute & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента. \en Create a copy of the element. + virtual MbAttribute & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента. \en Create a copy of the element. virtual bool IsSame( const MbAttribute &, double accuracy ) const; // \ru Определить, являются ли объекты равными. \en Determine whether objects are equal. virtual bool Init( const MbAttribute & ); // \ru Инициализировать данные по присланным. \en Initialize data. @@ -280,7 +280,7 @@ public : // \ru Общие функции объекта \en Common functions of object. virtual MbeAttributeType AttributeType() const; // \ru Дать подтип атрибута. \en Get subtype of an attribute. - virtual MbAttribute & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента. \en Create a copy of the element. + virtual MbAttribute & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента. \en Create a copy of the element. virtual bool IsSame( const MbAttribute &, double accuracy ) const; // \ru Определить, являются ли объекты равными. \en Determine whether objects are equal. virtual bool Init( const MbAttribute & ); // \ru Инициализировать данные по присланным. \en Initialize data. @@ -333,7 +333,7 @@ public : // \ru Общие функции объекта \en Common functions of object. virtual MbeAttributeType AttributeType() const; // \ru Дать подтип атрибута. \en Get subtype of an attribute. - virtual MbAttribute & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента. \en Create a copy of the element. + virtual MbAttribute & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента. \en Create a copy of the element. virtual bool IsSame( const MbAttribute &, double accuracy ) const; // \ru Определить, являются ли объекты равными. \en Determine whether objects are equal. virtual bool Init( const MbAttribute & ); // \ru Инициализировать данные по присланным. \en Initialize data. @@ -414,7 +414,7 @@ public : // \ru Общие функции объекта \en Common functions of object. virtual MbeAttributeType AttributeType() const; // \ru Дать подтип атрибута. \en Get subtype of an attribute. - virtual MbAttribute & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента. \en Create a copy of the element. + virtual MbAttribute & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента. \en Create a copy of the element. virtual bool IsSame( const MbAttribute &, double accuracy ) const; // \ru Определить, являются ли объекты равными. \en Determine whether objects are equal. virtual bool Init( const MbAttribute & ); // \ru Инициализировать данные по присланным. \en Initialize data. diff --git a/C3d/Include/attr_common_attribute.h b/C3d/Include/attr_common_attribute.h index f8a479b..2559df1 100644 --- a/C3d/Include/attr_common_attribute.h +++ b/C3d/Include/attr_common_attribute.h @@ -37,7 +37,7 @@ protected : public : virtual MbeAttributeType AttributeFamily() const; // \ru Выдать тип атрибута. \en Get attribute type. virtual MbeAttributeType AttributeType() const = 0; // \ru Выдать подтип атрибута. \en Get subtype of an attribute. - virtual MbAttribute & Duplicate( MbRegDuplicate * = c3d_null ) const = 0; // \ru Сделать копию элемента. \en Create a copy of the element. + virtual MbAttribute & Duplicate( MbRegDuplicate * = nullptr ) const = 0; // \ru Сделать копию элемента. \en Create a copy of the element. virtual bool IsSame( const MbAttribute &, double accuracy ) const; // \ru Определить, являются ли объекты равными. \en Determine whether objects are equal. virtual bool Init( const MbAttribute & ) = 0; // \ru Инициализировать данные по присланным. \en Initialize data. @@ -46,13 +46,13 @@ public : // \ru Выполнить действия при конвертации владельца. \en Perform actions when converting the owner. virtual void OnConvertOwner( const MbAttributeContainer & owner, MbAttributeContainer & other ); // \ru Выполнить действия при трансформировании владельца. \en Perform actions when transforming the owner. - virtual void OnTransformOwner( const MbAttributeContainer & owner, const MbMatrix3D &, MbRegTransform * = c3d_null ); + virtual void OnTransformOwner( const MbAttributeContainer & owner, const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Выполнить действия при перемещении владельца. \en Perform actions when moving the owner. - virtual void OnMoveOwner( const MbAttributeContainer & owner, const MbVector3D &, MbRegTransform * = c3d_null ); + virtual void OnMoveOwner( const MbAttributeContainer & owner, const MbVector3D &, MbRegTransform * = nullptr ); // \ru Выполнить действия при вращении владельца. \en Perform actions when rotating the owner. - virtual void OnRotateOwner( const MbAttributeContainer & owner, const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); + virtual void OnRotateOwner( const MbAttributeContainer & owner, const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Выполнить действия при копировании владельца. \en Perform actions when copying the owner. - virtual void OnCopyOwner( const MbAttributeContainer & owner, MbAttributeContainer & other, MbRegDuplicate * = c3d_null ); + virtual void OnCopyOwner( const MbAttributeContainer & owner, MbAttributeContainer & other, MbRegDuplicate * = nullptr ); // \ru Выполнить действия при объединении владельца. \en Perform actions when merging he owner. virtual void OnMergeOwner( const MbAttributeContainer & owner, MbAttributeContainer & other ); // \ru Выполнить действия при замене владельца. \en Perform actions when replacing the owner. @@ -101,7 +101,7 @@ public: public: virtual MbeAttributeType AttributeType() const; // \ru Выдать подтип атрибута. \en Get subtype of an attribute. virtual void GetCharValue( TCHAR * v ) const; // \ru Выдать строковое значение свойства. \en Get a string value of the property. - virtual MbAttribute & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента. \en Create a copy of the element. + virtual MbAttribute & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента. \en Create a copy of the element. virtual bool IsSame( const MbAttribute &, double accuracy ) const; // \ru Определить, являются ли объекты равными. \en Determine whether objects are equal. virtual bool Init( const MbAttribute & ); // \ru Инициализировать данные по присланным. \en Initialize data. virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта. \en Get properties of the object. @@ -137,7 +137,7 @@ public: public: virtual MbeAttributeType AttributeType() const; // \ru Выдать подтип атрибута. \en Get subtype of an attribute. virtual void GetCharValue( TCHAR * v ) const; // \ru Выдать строковое значение свойства. \en Get a string value of the property. - virtual MbAttribute & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента. \en Create a copy of the element. + virtual MbAttribute & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента. \en Create a copy of the element. virtual bool IsSame( const MbAttribute &, double accuracy ) const; // \ru Определить, являются ли объекты равными. \en Determine whether objects are equal. virtual bool Init( const MbAttribute & ); // \ru Инициализировать данные по присланным. \en Initialize data. virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта. \en Get properties of the object. @@ -173,7 +173,7 @@ public: public: virtual MbeAttributeType AttributeType() const; // \ru Выдать подтип атрибута. \en Get subtype of an attribute. virtual void GetCharValue( TCHAR * v ) const; // \ru Выдать строковое значение свойства. \en Get a string value of the property. - virtual MbAttribute & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента. \en Create a copy of the element. + virtual MbAttribute & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента. \en Create a copy of the element. virtual bool IsSame( const MbAttribute &, double accuracy ) const; // \ru Определить, являются ли объекты равными. \en Determine whether objects are equal. virtual bool Init( const MbAttribute & ); // \ru Инициализировать данные по присланным. \en Initialize data. virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта. \en Get properties of the object. @@ -209,7 +209,7 @@ public: public: virtual MbeAttributeType AttributeType() const; // \ru Выдать подтип атрибута. \en Get subtype of an attribute. virtual void GetCharValue( TCHAR * v ) const; // \ru Выдать строковое значение свойства. \en Get a string value of the property. - virtual MbAttribute & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента. \en Create a copy of the element. + virtual MbAttribute & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента. \en Create a copy of the element. virtual bool IsSame( const MbAttribute &, double accuracy ) const; // \ru Определить, являются ли объекты равными. \en Determine whether objects are equal. virtual bool Init( const MbAttribute & ); // \ru Инициализировать данные по присланным. \en Initialize data. virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта. \en Get properties of the object. @@ -243,7 +243,7 @@ public: public: virtual MbeAttributeType AttributeType() const; // \ru Выдать подтип атрибута. \en Get subtype of an attribute. virtual void GetCharValue( TCHAR * v ) const; // \ru Выдать строковое значение свойства. \en Get a string value of the property. - virtual MbAttribute & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента. \en Create a copy of the element. + virtual MbAttribute & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента. \en Create a copy of the element. virtual bool IsSame( const MbAttribute &, double accuracy ) const; // \ru Определить, являются ли объекты равными. \en Determine whether objects are equal. virtual bool Init( const MbAttribute & ); // \ru Инициализировать данные по присланным. \en Initialize data. virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта. \en Get properties of the object. @@ -280,7 +280,7 @@ public: public: virtual MbeAttributeType AttributeType() const; // \ru Выдать подтип атрибута. \en Get subtype of an attribute. virtual void GetCharValue( TCHAR * v ) const; // \ru Выдать строковое значение свойства. \en Get a string value of the property. - virtual MbAttribute & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента. \en Create a copy of the element. + virtual MbAttribute & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента. \en Create a copy of the element. virtual bool IsSame( const MbAttribute &, double accuracy ) const; // \ru Определить, являются ли объекты равными. \en Determine whether objects are equal. virtual bool Init( const MbAttribute & ); // \ru Инициализировать данные по присланным. \en Initialize data. virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта. \en Get properties of the object. diff --git a/C3d/Include/attr_dencity.h b/C3d/Include/attr_dencity.h index 4a6599a..af3b489 100644 --- a/C3d/Include/attr_dencity.h +++ b/C3d/Include/attr_dencity.h @@ -38,7 +38,7 @@ public : // \ru Общие функции объекта \en Common functions of object. virtual MbeAttributeType AttributeType() const; // \ru Дать подтип атрибута. \en Get subtype of an attribute. - virtual MbAttribute & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента. \en Create a copy of the element. + virtual MbAttribute & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента. \en Create a copy of the element. virtual bool IsSame( const MbAttribute &, double accuracy ) const; // \ru Определить, являются ли объекты равными. \en Determine whether objects are equal. virtual bool Init( const MbAttribute & ); // \ru Инициализировать данные по присланным. \en Initialize data. @@ -86,7 +86,7 @@ public : // \ru Общие функции объекта \en Common functions of object. virtual MbeAttributeType AttributeType() const; // \ru Дать подтип атрибута. \en Get subtype of an attribute. - virtual MbAttribute & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента. \en Create a copy of the element. + virtual MbAttribute & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента. \en Create a copy of the element. virtual bool IsSame( const MbAttribute &, double accuracy ) const; // \ru Определить, являются ли объекты равными. \en Determine whether objects are equal. virtual bool Init( const MbAttribute & ); // \ru Инициализировать данные по присланным. \en Initialize data. @@ -137,7 +137,7 @@ public : // \ru Общие функции объекта \en Common functions of object. virtual MbeAttributeType AttributeType() const; // \ru Дать подтип атрибута. \en Get subtype of an attribute. - virtual MbAttribute & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента. \en Create a copy of the element. + virtual MbAttribute & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента. \en Create a copy of the element. virtual bool IsSame( const MbAttribute &, double accuracy ) const; // \ru Определить, являются ли объекты равными. \en Determine whether objects are equal. virtual bool Init( const MbAttribute & ); // \ru Инициализировать данные по присланным. \en Initialize data. @@ -184,7 +184,7 @@ public : // \ru Общие функции объекта \en Common functions of object. virtual MbeAttributeType AttributeType() const; // \ru Дать подтип атрибута. \en Get subtype of an attribute. - virtual MbAttribute & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента. \en Create a copy of the element. + virtual MbAttribute & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента. \en Create a copy of the element. virtual bool IsSame( const MbAttribute &, double accuracy ) const; // \ru Определить, являются ли объекты равными. \en Determine whether objects are equal. virtual bool Init( const MbAttribute & ); // \ru Инициализировать данные по присланным. \en Initialize data. diff --git a/C3d/Include/attr_elementary_attribute.h b/C3d/Include/attr_elementary_attribute.h index a9acab6..fbde862 100644 --- a/C3d/Include/attr_elementary_attribute.h +++ b/C3d/Include/attr_elementary_attribute.h @@ -30,7 +30,7 @@ public: public : virtual MbeAttributeType AttributeFamily() const; // \ru Тип атрибута \en Type of an attribute virtual MbeAttributeType AttributeType() const = 0; // \ru Выдать подтип атрибута \en Get subtype of an attribute. - virtual MbAttribute & Duplicate( MbRegDuplicate * = c3d_null ) const = 0; // \ru Сделать копию элемента \en Create a copy of the element. + virtual MbAttribute & Duplicate( MbRegDuplicate * = nullptr ) const = 0; // \ru Сделать копию элемента \en Create a copy of the element. virtual bool IsSame( const MbAttribute &, double accuracy ) const = 0; // \ru Определить, являются ли объекты равными. \en Determine whether objects are equal. virtual bool Init( const MbAttribute & ) = 0; // \ru Инициализировать данные по присланным \en Initialize data. @@ -39,13 +39,13 @@ public : // \ru Действия при конвертации владельца. \en Actions when converting the owner. virtual void OnConvertOwner( const MbAttributeContainer & owner, MbAttributeContainer & other ); /// \ru Действия при трансформировании владельца. \en Actions when transforming the owner. - virtual void OnTransformOwner( const MbAttributeContainer & owner, const MbMatrix3D &, MbRegTransform * = c3d_null ); + virtual void OnTransformOwner( const MbAttributeContainer & owner, const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Действия при перемещении владельца. \en Actions when moving the owner. - virtual void OnMoveOwner( const MbAttributeContainer & owner, const MbVector3D &, MbRegTransform * = c3d_null ); + virtual void OnMoveOwner( const MbAttributeContainer & owner, const MbVector3D &, MbRegTransform * = nullptr ); // \ru Действия при вращении владельца. \en Actions when rotating the owner. - virtual void OnRotateOwner( const MbAttributeContainer & owner, const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); + virtual void OnRotateOwner( const MbAttributeContainer & owner, const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Действия при копировании владельца. \en Actions when copying the owner. - virtual void OnCopyOwner( const MbAttributeContainer & owner, MbAttributeContainer & other, MbRegDuplicate * = c3d_null ); + virtual void OnCopyOwner( const MbAttributeContainer & owner, MbAttributeContainer & other, MbRegDuplicate * = nullptr ); // \ru Действия при объединении владельца. \en Actions when merging the owner. virtual void OnMergeOwner( const MbAttributeContainer & owner, MbAttributeContainer & other ); // \ru Действия при замене владельца. \en Actions when replacing the owner. diff --git a/C3d/Include/attr_flange_attribute.h b/C3d/Include/attr_flange_attribute.h index a7b62bc..b04c1db 100644 --- a/C3d/Include/attr_flange_attribute.h +++ b/C3d/Include/attr_flange_attribute.h @@ -43,20 +43,20 @@ public: // \ru Выдать подтип атрибута. \en Get subtype of an attribute. virtual MbeAttributeType AttributeType() const; // \ru Сделать копию элемента. \en Create a copy of the element. - virtual MbAttribute & Duplicate( MbRegDuplicate * = c3d_null ) const; + virtual MbAttribute & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Определить, являются ли объекты равными. \en Determine whether objects are equal. virtual bool IsSame( const MbAttribute &, double accuracy ) const; // \ru Инициализировать данные по присланным. \en Initialize data. virtual bool Init( const MbAttribute & ); // \ru Выполнить действия при трансформировании владельца. \en Perform actions when transforming the owner. - virtual void OnTransformOwner( const MbAttributeContainer & owner, const MbMatrix3D &, MbRegTransform * = c3d_null ); + virtual void OnTransformOwner( const MbAttributeContainer & owner, const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Выполнить действия при перемещении владельца. \en Perform actions when moving the owner. - virtual void OnMoveOwner( const MbAttributeContainer & owner, const MbVector3D &, MbRegTransform * = c3d_null ); + virtual void OnMoveOwner( const MbAttributeContainer & owner, const MbVector3D &, MbRegTransform * = nullptr ); // \ru Выполнить действия при вращении владельца. \en Perform actions when rotating the owner. - virtual void OnRotateOwner( const MbAttributeContainer & owner, const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); + virtual void OnRotateOwner( const MbAttributeContainer & owner, const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Выполнить действия при копировании владельца. \en Perform actions when copying the owner. - virtual void OnCopyOwner( const MbAttributeContainer & owner, MbAttributeContainer & other, MbRegDuplicate * = c3d_null ); + virtual void OnCopyOwner( const MbAttributeContainer & owner, MbAttributeContainer & other, MbRegDuplicate * = nullptr ); // \ru Выполнить действия при объединении владельца. \en Perform actions when merging the owner. virtual void OnMergeOwner( const MbAttributeContainer & owner, MbAttributeContainer & other ); diff --git a/C3d/Include/attr_geometric_attribute.h b/C3d/Include/attr_geometric_attribute.h index e229a30..a223b3c 100644 --- a/C3d/Include/attr_geometric_attribute.h +++ b/C3d/Include/attr_geometric_attribute.h @@ -52,19 +52,19 @@ public: // \ru Выдать подтип атрибута. \en Get subtype of an attribute. virtual MbeAttributeType AttributeType() const; // \ru Сделать копию элемента. \en Create a copy of the element. - virtual MbAttribute & Duplicate( MbRegDuplicate * = c3d_null ) const; + virtual MbAttribute & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Определить, являются ли объекты равными. \en Determine whether objects are equal. virtual bool IsSame( const MbAttribute &, double accuracy ) const; // \ru Инициализировать данные по присланным. \en Initialize data. virtual bool Init( const MbAttribute & ); // \ru Выполнить действия при трансформировании владельца. \en Perform actions when transforming the owner. - virtual void OnTransformOwner( const MbAttributeContainer & owner, const MbMatrix3D &, MbRegTransform * = c3d_null ); + virtual void OnTransformOwner( const MbAttributeContainer & owner, const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Выполнить действия при перемещении владельца. \en Perform actions when moving the owner. - virtual void OnMoveOwner( const MbAttributeContainer & owner, const MbVector3D &, MbRegTransform * = c3d_null ); + virtual void OnMoveOwner( const MbAttributeContainer & owner, const MbVector3D &, MbRegTransform * = nullptr ); // \ru Выполнить действия при вращении владельца. \en Perform actions when rotating the owner. - virtual void OnRotateOwner( const MbAttributeContainer & owner, const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); + virtual void OnRotateOwner( const MbAttributeContainer & owner, const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Выполнить действия при копировании владельца. \en Perform actions when copying the owner. - virtual void OnCopyOwner( const MbAttributeContainer & owner, MbAttributeContainer & other, MbRegDuplicate * = c3d_null ); + virtual void OnCopyOwner( const MbAttributeContainer & owner, MbAttributeContainer & other, MbRegDuplicate * = nullptr ); // \ru Выполнить действия при объединении владельца. \en Perform actions when merging the owner. virtual void OnMergeOwner( const MbAttributeContainer & owner, MbAttributeContainer & other ); diff --git a/C3d/Include/attr_identifier.h b/C3d/Include/attr_identifier.h index 637b918..9fcd806 100644 --- a/C3d/Include/attr_identifier.h +++ b/C3d/Include/attr_identifier.h @@ -39,7 +39,7 @@ public : // \ru Общие функции объекта. \en Common functions of object. virtual MbeAttributeType AttributeType() const; // \ru Дать подтип атрибута. \en Get subtype of an attribute. - virtual MbAttribute & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента. \en Create a copy of the element. + virtual MbAttribute & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента. \en Create a copy of the element. virtual bool IsSame( const MbAttribute &, double accuracy ) const; // \ru Определить, являются ли объекты равными. \en Determine whether objects are equal. virtual bool Init( const MbAttribute & ); // \ru Инициализировать данные по присланным. \en Initialize data. virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта. \en Get properties of the object. @@ -92,7 +92,7 @@ public : // \ru Общие функции объекта \en Common functions of object. virtual MbeAttributeType AttributeType() const; // \ru Дать подтип атрибута. \en Get subtype of an attribute. - virtual MbAttribute & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента. \en Create a copy of the element. + virtual MbAttribute & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента. \en Create a copy of the element. virtual bool IsSame( const MbAttribute &, double accuracy ) const; // \ru Определить, являются ли объекты равными. \en Determine whether objects are equal. virtual bool Init( const MbAttribute & ); // \ru Инициализировать данные по присланным. \en Initialize data. @@ -159,7 +159,7 @@ public : // \ru Общие функции объекта \en Common functions of object virtual MbeAttributeType AttributeType() const; // \ru Дать подтип атрибута. \en Get subtype of an attribute. - virtual MbAttribute & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента. \en Create a copy of the element. + virtual MbAttribute & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента. \en Create a copy of the element. virtual bool IsSame( const MbAttribute &, double accuracy ) const; // \ru Определить, являются ли объекты равными. \en Determine whether objects are equal. virtual bool Init( const MbAttribute & ); // \ru Инициализировать данные по присланным. \en Initialize data. @@ -221,7 +221,7 @@ public : virtual MbeAttributeType AttributeFamily() const; // \ru Дать тип атрибута. \en Get type of an attribute. virtual MbeAttributeType AttributeType() const; // \ru Дать подтип атрибута. \en Get subtype of an attribute. - virtual MbAttribute & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента. \en Create a copy of the element. + virtual MbAttribute & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента. \en Create a copy of the element. virtual bool IsSame( const MbAttribute &, double accuracy ) const; // \ru Определить, являются ли объекты равными. \en Determine whether objects are equal. virtual bool Init( const MbAttribute & ); // \ru Инициализировать данные по присланным. \en Initialize data. @@ -233,13 +233,13 @@ public : // \ru Выполнить действия при конвертации владельца \en Perform actions when converting the owner. virtual void OnConvertOwner( const MbAttributeContainer & owner, MbAttributeContainer & other ); // \ru Выполнить действия при трансформировании владельца. \en Perform actions when transforming the owner. - virtual void OnTransformOwner( const MbAttributeContainer & owner, const MbMatrix3D &, MbRegTransform * = c3d_null ); + virtual void OnTransformOwner( const MbAttributeContainer & owner, const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Выполнить действия при перемещении владельца. \en Perform actions when moving the owner. - virtual void OnMoveOwner( const MbAttributeContainer & owner, const MbVector3D &, MbRegTransform * = c3d_null ); + virtual void OnMoveOwner( const MbAttributeContainer & owner, const MbVector3D &, MbRegTransform * = nullptr ); // \ru Выполнить действия при вращении владельца. \en Perform actions when rotating the owner. - virtual void OnRotateOwner( const MbAttributeContainer & owner, const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); + virtual void OnRotateOwner( const MbAttributeContainer & owner, const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Выполнить действия при копировании владельца. \en Perform actions when copying the owner. - virtual void OnCopyOwner( const MbAttributeContainer & owner, MbAttributeContainer & other, MbRegDuplicate * = c3d_null ); + virtual void OnCopyOwner( const MbAttributeContainer & owner, MbAttributeContainer & other, MbRegDuplicate * = nullptr ); // \ru Выполнить действия при объединении владельца. \en Perform actions when merging the owner. virtual void OnMergeOwner( const MbAttributeContainer & owner, MbAttributeContainer & other ); // \ru Выполнить действия при замене владельца. \en Perform actions when replacing the owner. @@ -289,7 +289,7 @@ public: // \ru Общие функции объекта. \en Common functions of object. virtual MbeAttributeType AttributeType() const; // \ru Дать подтип атрибута. \en Get subtype of an attribute. - virtual MbAttribute & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента. \en Create a copy of the element. + virtual MbAttribute & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента. \en Create a copy of the element. virtual bool IsSame( const MbAttribute &, double ) const; // \ru Определить, являются ли объекты равными. \en Determine whether objects are equal. virtual bool Init( const MbAttribute & ); // \ru Инициализировать данные по атрибуту. \en Initialize by attribute. virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта. \en Get properties of the object. diff --git a/C3d/Include/attr_product.h b/C3d/Include/attr_product.h index e6e9432..65e9192 100644 --- a/C3d/Include/attr_product.h +++ b/C3d/Include/attr_product.h @@ -37,7 +37,7 @@ public : // Выдать подтип атрибута (временно). virtual MbeAttributeType AttributeType() const = 0; // Сделать копию элемента. - virtual MbAttribute & Duplicate( MbRegDuplicate * = c3d_null ) const = 0; + virtual MbAttribute & Duplicate( MbRegDuplicate * = nullptr ) const = 0; virtual bool IsSame( const MbAttribute &, double accuracy ) const = 0; // \ru Определить, являются ли объекты равными. \en Determine whether objects are equal. // Инициализировать данные по присланным. virtual bool Init( const MbAttribute & ) = 0; @@ -49,13 +49,13 @@ public : // Действия при конвертации владельца. virtual void OnConvertOwner( const MbAttributeContainer & owner, MbAttributeContainer & other ); // Действия при трансформировании владельца. - virtual void OnTransformOwner( const MbAttributeContainer & owner, const MbMatrix3D &, MbRegTransform * = c3d_null ); + virtual void OnTransformOwner( const MbAttributeContainer & owner, const MbMatrix3D &, MbRegTransform * = nullptr ); // Действия при перемещении владельца. - virtual void OnMoveOwner( const MbAttributeContainer & owner, const MbVector3D &, MbRegTransform * = c3d_null ); + virtual void OnMoveOwner( const MbAttributeContainer & owner, const MbVector3D &, MbRegTransform * = nullptr ); // Действия при вращении владельца. - virtual void OnRotateOwner( const MbAttributeContainer & owner, const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); + virtual void OnRotateOwner( const MbAttributeContainer & owner, const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // Действия при копировании владельца. - virtual void OnCopyOwner( const MbAttributeContainer & owner, MbAttributeContainer & other, MbRegDuplicate * = c3d_null ); + virtual void OnCopyOwner( const MbAttributeContainer & owner, MbAttributeContainer & other, MbRegDuplicate * = nullptr ); // Действия при объединении владельца. virtual void OnMergeOwner( const MbAttributeContainer & owner, MbAttributeContainer & other ); // Действия при замене владельца. @@ -100,7 +100,7 @@ public : // Выдать подтип атрибута (временно). virtual MbeAttributeType AttributeType() const; // Сделать копию элемента. - virtual MbAttribute & Duplicate( MbRegDuplicate * = c3d_null ) const; + virtual MbAttribute & Duplicate( MbRegDuplicate * = nullptr ) const; virtual bool IsSame( const MbAttribute &, double accuracy ) const; // Определить, являются ли объекты равными. // Инициализировать данные по присланным. virtual bool Init( const MbAttribute & ) ; @@ -326,7 +326,7 @@ public : // Выдать подтип атрибута (временно). virtual MbeAttributeType AttributeType() const; // Сделать копию элемента. - virtual MbAttribute & Duplicate( MbRegDuplicate * = c3d_null ) const ; + virtual MbAttribute & Duplicate( MbRegDuplicate * = nullptr ) const ; virtual bool IsSame( const MbAttribute &, double accuracy ) const; // Определить, являются ли объекты равными. // Инициализировать данные по присланным. virtual bool Init( const MbAttribute & ) ; diff --git a/C3d/Include/attr_selected.h b/C3d/Include/attr_selected.h index f808f21..7a5025b 100644 --- a/C3d/Include/attr_selected.h +++ b/C3d/Include/attr_selected.h @@ -37,7 +37,7 @@ public : // \ru Общие функции объекта. \en Common functions of object. virtual MbeAttributeType AttributeType() const; // \ru Дать подтип атрибута. \en Get subtype of an attribute. - virtual MbAttribute & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента. \en Create a copy of the element. + virtual MbAttribute & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента. \en Create a copy of the element. virtual bool IsSame( const MbAttribute &, double accuracy ) const; // \ru Определить, являются ли объекты равными. \en Determine whether objects are equal. virtual bool Init( const MbAttribute & ); // \ru Инициализировать данные по присланным. \en Initialize data by given attribute. @@ -83,7 +83,7 @@ public : // \ru Общие функции объекта. \en Common functions of object. virtual MbeAttributeType AttributeType() const; // \ru Дать подтип атрибута. \en Get subtype of an attribute. - virtual MbAttribute & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента. \en Create a copy of the element. + virtual MbAttribute & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента. \en Create a copy of the element. virtual bool IsSame( const MbAttribute &, double accuracy ) const; // \ru Определить, являются ли объекты равными. \en Determine whether objects are equal. virtual bool Init( const MbAttribute & ); // \ru Инициализировать данные по присланным. \en Initialize data by given attribute. @@ -129,7 +129,7 @@ public : // \ru Общие функции объекта. \en Common functions of object. virtual MbeAttributeType AttributeType() const; // \ru Дать подтип атрибута. \en Get subtype of an attribute. - virtual MbAttribute & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента. \en Create a copy of the element. + virtual MbAttribute & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента. \en Create a copy of the element. virtual bool IsSame( const MbAttribute &, double accuracy ) const; // \ru Определить, являются ли объекты равными. \en Determine whether objects are equal. virtual bool Init( const MbAttribute & ); // \ru Инициализировать данные по присланным. \en Initialize data by given attribute. diff --git a/C3d/Include/attr_stamprib_attribute.h b/C3d/Include/attr_stamprib_attribute.h index 1833d3e..86e53f9 100644 --- a/C3d/Include/attr_stamprib_attribute.h +++ b/C3d/Include/attr_stamprib_attribute.h @@ -49,20 +49,20 @@ public: // \ru Выдать подтип атрибута. \en Get subtype of an attribute. virtual MbeAttributeType AttributeType() const; // \ru Сделать копию элемента. \en Create a copy of the element. - virtual MbAttribute & Duplicate( MbRegDuplicate * = c3d_null ) const; + virtual MbAttribute & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Определить, являются ли объекты равными. \en Determine whether objects are equal. virtual bool IsSame( const MbAttribute &, double accuracy ) const; // \ru Инициализировать данные по присланным. \en Initialize data. virtual bool Init( const MbAttribute & ); // \ru Выполнить действия при трансформировании владельца. \en Perform actions when transforming the owner. - virtual void OnTransformOwner( const MbAttributeContainer & owner, const MbMatrix3D &, MbRegTransform * = c3d_null ); + virtual void OnTransformOwner( const MbAttributeContainer & owner, const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Выполнить действия при перемещении владельца. \en Perform actions when moving the owner. - virtual void OnMoveOwner( const MbAttributeContainer & owner, const MbVector3D &, MbRegTransform * = c3d_null ); + virtual void OnMoveOwner( const MbAttributeContainer & owner, const MbVector3D &, MbRegTransform * = nullptr ); // \ru Выполнить действия при вращении владельца. \en Perform actions when rotating the owner. - virtual void OnRotateOwner( const MbAttributeContainer & owner, const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); + virtual void OnRotateOwner( const MbAttributeContainer & owner, const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Выполнить действия при копировании владельца. \en Perform actions when copying the owner. - virtual void OnCopyOwner( const MbAttributeContainer & owner, MbAttributeContainer & other, MbRegDuplicate * = c3d_null ); + virtual void OnCopyOwner( const MbAttributeContainer & owner, MbAttributeContainer & other, MbRegDuplicate * = nullptr ); // \ru Выполнить действия при объединении владельца. \en Perform actions when merging the owner. virtual void OnMergeOwner( const MbAttributeContainer & owner, MbAttributeContainer & other ); diff --git a/C3d/Include/attr_user_attribute.h b/C3d/Include/attr_user_attribute.h index ecb3a9d..423a87a 100644 --- a/C3d/Include/attr_user_attribute.h +++ b/C3d/Include/attr_user_attribute.h @@ -89,7 +89,7 @@ public: \ingroup Model_Attributes */ class MATH_CLASS MbUserAttribute : public MbAttribute, public MbSyncItem { - typedef std_unique_ptr UniqueMembufPtr; + typedef std::unique_ptr UniqueMembufPtr; protected : MbUserAttribType userType_; ///< \ru Тип пользовательского атрибута. \en Type of user attribute. c3d::string_t prompt_; ///< \ru Строка описания. \en String of description. @@ -108,7 +108,7 @@ public: /// \ru Выдать подтип пользовательского атрибута по пользовательскому типу. \en Get subtype of an user attribute by user-defined type. static MbeAttributeType AttributeType( const MbUserAttribType & userType ); - virtual MbAttribute & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента. \en Create a copy of the element. + virtual MbAttribute & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента. \en Create a copy of the element. virtual bool IsSame( const MbAttribute &, double accuracy ) const; // \ru Определить, являются ли объекты равными. \en Determine whether objects are equal. virtual bool Init( const MbAttribute & ); // \ru Инициализировать данные по присланным. \en Initialize data by given attribute. @@ -117,13 +117,13 @@ public: // \ru Выполнить действия при конвертации владельца \en Perform actions when converting the owner virtual void OnConvertOwner( const MbAttributeContainer & owner, MbAttributeContainer & other ); // \ru Выполнить действия при трансформировании владельца \en Perform actions when transforming the owner - virtual void OnTransformOwner( const MbAttributeContainer & owner, const MbMatrix3D &, MbRegTransform * = c3d_null ); + virtual void OnTransformOwner( const MbAttributeContainer & owner, const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Выполнить действия при перемещении владельца. \en Perform actions when moving the owner. - virtual void OnMoveOwner( const MbAttributeContainer & owner, const MbVector3D &, MbRegTransform * = c3d_null ); + virtual void OnMoveOwner( const MbAttributeContainer & owner, const MbVector3D &, MbRegTransform * = nullptr ); // \ru Выполнить действия при вращении владельца. \en Perform actions when rotating the owner. - virtual void OnRotateOwner( const MbAttributeContainer & owner, const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); + virtual void OnRotateOwner( const MbAttributeContainer & owner, const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Выполнить действия при копировании владельца \en Perform actions when copying the owner. - virtual void OnCopyOwner( const MbAttributeContainer & owner, MbAttributeContainer & other, MbRegDuplicate * = c3d_null ); + virtual void OnCopyOwner( const MbAttributeContainer & owner, MbAttributeContainer & other, MbRegDuplicate * = nullptr ); // \ru Выполнить действия при объединении владельца \en Perform actions when merging the owner. virtual void OnMergeOwner( const MbAttributeContainer & owner, MbAttributeContainer & other ); // \ru Выполнить действия при замене владельца. \en Perform actions when replacing the owner. @@ -197,7 +197,7 @@ public : /// \ru Выдать подтип атрибута. \en Get subtype of an attribute. virtual MbUserAttribType AttrTypeEx() const = 0; - virtual MbAttribute & Duplicate( MbRegDuplicate * = c3d_null ) const = 0; // \ru Сделать копию элемента. \en Create a copy of the element. + virtual MbAttribute & Duplicate( MbRegDuplicate * = nullptr ) const = 0; // \ru Сделать копию элемента. \en Create a copy of the element. virtual bool IsSame( const MbAttribute &, double accuracy ) const = 0; // \ru Определить, являются ли объекты равными. \en Determine whether objects are equal. virtual bool Init( const MbAttribute & ) = 0; // \ru Инициализировать данные по присланным. \en Initialize data. @@ -206,13 +206,13 @@ public : // \ru Выполнить действия при конвертации владельца. \en Perform actions when converting the owner. virtual void OnConvertOwner( const MbAttributeContainer & owner, MbAttributeContainer & other ); // \ru Выполнить действия при трансформировании владельца. \en Perform actions when transforming the owner. - virtual void OnTransformOwner( const MbAttributeContainer & owner, const MbMatrix3D &, MbRegTransform * = c3d_null ); + virtual void OnTransformOwner( const MbAttributeContainer & owner, const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Выполнить действия при перемещении владельца. \en Perform actions when moving the owner. - virtual void OnMoveOwner( const MbAttributeContainer & owner, const MbVector3D &, MbRegTransform * = c3d_null ); + virtual void OnMoveOwner( const MbAttributeContainer & owner, const MbVector3D &, MbRegTransform * = nullptr ); // \ru Выполнить действия при вращении владельца. \en Perform actions when rotating the owner. - virtual void OnRotateOwner( const MbAttributeContainer & owner, const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); + virtual void OnRotateOwner( const MbAttributeContainer & owner, const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Выполнить действия при копировании владельца. \en Perform actions when copying the owner. - virtual void OnCopyOwner( const MbAttributeContainer & owner, MbAttributeContainer & other, MbRegDuplicate * = c3d_null ); + virtual void OnCopyOwner( const MbAttributeContainer & owner, MbAttributeContainer & other, MbRegDuplicate * = nullptr ); // \ru Выполнить действия при объединении владельца. \en Perform actions when merging the owner. virtual void OnMergeOwner( const MbAttributeContainer & owner, MbAttributeContainer & other ); // \ru Выполнить действия при замене владельца. \en Perform actions when replacing the owner. @@ -256,7 +256,7 @@ public: /// \ru Выдать идентификатор атрибута. \en Get attribute identifier. const MbUserAttribType & GetUserAttrId() const { return userAttrId; } /// \ru Выдать атрибуты. \en Get attributes. - const MbAttribute * GetAttribute( size_t k ) const { return ((k < attributes.size()) ? attributes[k] : c3d_null); } + const MbAttribute * GetAttribute( size_t k ) const { return ((k < attributes.size()) ? attributes[k] : nullptr); } // \ru Выдать количество атрибутов. \en Get the number of attributes. size_t AttributesCount() const { return attributes.size(); } @@ -300,7 +300,7 @@ MbUserAttribute * UserAttrDefinition::ReduceUserAttrib( const MbExter MbUserAttribute * resAttr = new MbUserAttribute( _T("AttrClass"), attrId ); resAttr->InitActions( source ); { - const char * charBuf = c3d_null; + const char * charBuf = nullptr; size_t memLen = 0; { membuf memBuf; @@ -330,7 +330,7 @@ MbUserAttribute * UserAttrDefinition::ReduceUserAttrib( const MbExter template MbExternalAttribute * UserAttrDefinition::AdvanceUserAttrib( const MbUserAttribute & source ) { - AttrClass * resAttr = c3d_null; + AttrClass * resAttr = nullptr; MbUserAttribType attrId; source.GetUserAttribId( attrId ); { @@ -360,7 +360,7 @@ MbExternalAttribute * UserAttrDefinition::AdvanceUserAttrib( const Mb // --- template MbFixAttrSet * UserAttrDefinition::DisassembleUserAttrib( const MbExternalAttribute & /*source*/ ) { - return c3d_null; + return nullptr; } @@ -379,7 +379,7 @@ bool UserAttrDefinition::ReassembleUserAttrib( const MbFixAttrSet & / template UserAttrDefinitionInstance::UserAttrDefinitionInstance( const MbUserAttribType & type ) : AttrDefInstance( type ) - , attrDef( c3d_null ) + , attrDef( nullptr ) { } @@ -390,7 +390,7 @@ UserAttrDefinitionInstance::UserAttrDefinitionInstance( const MbUs template UserAttrDefinitionInstance::~UserAttrDefinitionInstance() { - if ( attrDef != c3d_null ) + if ( attrDef != nullptr ) delete attrDef; } @@ -401,7 +401,7 @@ UserAttrDefinitionInstance::~UserAttrDefinitionInstance() template IAttrDefinition * UserAttrDefinitionInstance::GetAttrDefinition() { - if ( attrDef == c3d_null ) { + if ( attrDef == nullptr ) { ScopedLock ll( GetLock() ); attrDef = new AttrDefClass(); } diff --git a/C3d/Include/attribute.h b/C3d/Include/attribute.h index 4ba8ee3..2dc2b61 100644 --- a/C3d/Include/attribute.h +++ b/C3d/Include/attribute.h @@ -291,7 +291,7 @@ public : /// \ru Выдать подтип атрибута. \en Get subtype of an attribute. virtual MbeAttributeType AttributeType() const = 0; /// \ru Сделать копию элемента. \en Create a copy of the element. - virtual MbAttribute & Duplicate( MbRegDuplicate * = c3d_null ) const = 0; + virtual MbAttribute & Duplicate( MbRegDuplicate * = nullptr ) const = 0; /** \brief \ru Определить, являются ли объекты равными. \en Determine whether objects are equal. \~ \details \ru Равными считаются однотипные объекты, все данные которых одинаковы (равны). @@ -336,7 +336,7 @@ public : \en Perform actions when transforming the owner, \n This function is called after transforming the owning object in a case when GetActionForTransform() == trn_Self. The registrator of transformed objects may be passed as input parameter. \~ */ - virtual void OnTransformOwner( const MbAttributeContainer & owner, const MbMatrix3D &, MbRegTransform * = c3d_null ) = 0; + virtual void OnTransformOwner( const MbAttributeContainer & owner, const MbMatrix3D &, MbRegTransform * = nullptr ) = 0; /**\ru Выполнить действия при перемещении владельца. \n Вызывается после перемещения владеющего объекта при условии GetActionForTransform() == trn_Self. @@ -344,7 +344,7 @@ public : \en Perform actions when moving the owner. \n This function is called after moving the owning object in a case when GetActionForTransform() == trn_Self. The registrator of transformed objects may be passed as input parameter. \~ */ - virtual void OnMoveOwner( const MbAttributeContainer & owner, const MbVector3D &, MbRegTransform * = c3d_null ) = 0; + virtual void OnMoveOwner( const MbAttributeContainer & owner, const MbVector3D &, MbRegTransform * = nullptr ) = 0; /**\ru Выполнить действия при вращении владельца. \n Вызывается после вращения владеющего объекта при условии GetActionForTransform() == trn_Self. @@ -352,7 +352,7 @@ public : \en Perform actions when rotating the owner. \n This function is called after rotating the owning object in a case when GetActionForTransform() == trn_Self. The registrator of transformed objects may be passed as input parameter. \~ */ - virtual void OnRotateOwner( const MbAttributeContainer & owner, const MbAxis3D &, double angle, MbRegTransform * = c3d_null ) = 0; + virtual void OnRotateOwner( const MbAttributeContainer & owner, const MbAxis3D &, double angle, MbRegTransform * = nullptr ) = 0; /**\ru Выполнить действия при копировании владельца. \n Вызывается после копирования владеющего объекта при условии GetActionForCopy() == cpy_Self. \n @@ -360,7 +360,7 @@ public : \en Perform actions when copying the owner. \n This function is called after copying the owning object in a case when GetActionForCopy() == cpy_Self. \n The following objects are passed as input parameters: the owning object copy and registrator of copied objects. \~ */ - virtual void OnCopyOwner( const MbAttributeContainer & owner, MbAttributeContainer & other, MbRegDuplicate * = c3d_null ) = 0; + virtual void OnCopyOwner( const MbAttributeContainer & owner, MbAttributeContainer & other, MbRegDuplicate * = nullptr ) = 0; /**\ru Выполнить действия при объединении владельца. \n Вызывается перед слиянием владельца при условии GetActionForMerge() == mrg_Self. \n diff --git a/C3d/Include/attribute_container.h b/C3d/Include/attribute_container.h index c451f1a..fbdb8dc 100644 --- a/C3d/Include/attribute_container.h +++ b/C3d/Include/attribute_container.h @@ -169,13 +169,13 @@ public: /// \ru Выполнить действия при конвертации атрибутов. \en Perform actions when converting the attributes. void AttributesConvert( MbAttributeContainer & other ) const; /// \ru Выполнить действия при трансформировании атрибутов. \en Perform actions when transforming the attributes. - void AttributesTransform( const MbMatrix3D &, MbRegTransform * = c3d_null ); + void AttributesTransform( const MbMatrix3D &, MbRegTransform * = nullptr ); /// \ru Выполнить действия при перемещении атрибутов. \en Perform actions when moving the attributes. - void AttributesMove ( const MbVector3D &, MbRegTransform * = c3d_null ); + void AttributesMove ( const MbVector3D &, MbRegTransform * = nullptr ); /// \ru Выполнить действия при вращении атрибутов. \en Perform actions when rotating the attributes. - void AttributesRotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); + void AttributesRotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); /// \ru Выполнить действия при копировании атрибутов. \en Perform actions when copying the attributes. - void AttributesCopy ( MbAttributeContainer & other, MbRegDuplicate * = c3d_null ) const; + void AttributesCopy ( MbAttributeContainer & other, MbRegDuplicate * = nullptr ) const; /// \ru Выполнить действия при объединении атрибутов. \en Perform actions when merging the attributes. void AttributesMerge ( MbAttributeContainer & other ); /// \ru Выполнить действия при замене атрибутов. \en Perform actions when replacing the attributes. @@ -195,7 +195,7 @@ public: double GetDensity() const; /// \ru Установить визуальные свойства объекта. \en Set visual properties of the object. - void SetVisual( float a, float d, float sp, float sh, float t, float e ); + void SetVisual( float a, float d, float sp, float sh, float t, float e, uint rgb = 0 ); /** \brief \ru Выдать визуальные свойства объекта. \en Get visual properties of the object. \~ \details \ru Выдать визуальные свойства объекта. @@ -215,7 +215,7 @@ public: \return \ru true если есть такой атрибут \n false в противном случае \en True if there is the attribute MbVisual \n otherwise false. \~ */ - bool GetVisual( float & a, float & d, float & sp, float & sh, float & t, float & e ) const; + bool GetVisual( float & a, float & d, float & sp, float & sh, float & t, float & e, uint rgb = 0 ) const; /// \ru Есть ли у объекта свой цвет. \en . @@ -226,7 +226,7 @@ public: \return \ru true если есть такой атрибут \n false в противном случае \en True if there is the attribute MbColor \n otherwise false. \~ */ - bool IsColored() const { return (GetSimpleAttribute( at_Color ) != c3d_null); } + bool IsColored() const { return (GetSimpleAttribute( at_Color ) != nullptr); } /// \ru Изменить цвет объекта. \en Change color of the object. void SetColor( uint32 ); /// \ru Изменить цвет объекта (0-255). \en Change color of the object (0-255). @@ -322,7 +322,7 @@ MATH_FUNC (bool) AddCommonAttributes( const MbAttributeContainer & srcItem, MbeAttributeType attrType, const c3d::string_t & attrPrompt, MbAttributeContainer & dstItem, - c3d::AttrVector * bufAttrs = c3d_null ); + c3d::AttrVector * bufAttrs = nullptr ); //------------------------------------------------------------------------------ /** \brief \ru Удалить обобщенные атрибуты. diff --git a/C3d/Include/cdet_data.h b/C3d/Include/cdet_data.h index c992aaa..32dc506 100644 --- a/C3d/Include/cdet_data.h +++ b/C3d/Include/cdet_data.h @@ -45,8 +45,8 @@ typedef const void * cdet_app_item; //---------------------------------------------------------------------------------------- // Constants //--- -const cdet_item CDET_NULL = c3d_null; ///< \ru Пустой объект набора для контроля столкновений. \en Empty object of the collision query set. -const cdet_app_item CDET_APP_NULL = c3d_null; ///< \ru "Нулевой" объект модели приложения. \en "Null object" of the client app. +const cdet_item CDET_NULL = nullptr; ///< \ru Пустой объект набора для контроля столкновений. \en Empty object of the collision query set. +const cdet_app_item CDET_APP_NULL = nullptr; ///< \ru "Нулевой" объект модели приложения. \en "Null object" of the client app. //---------------------------------------------------------------------------------------- /** \brief \ru Структура данных и обратных вызовов для запроса на поиск соударений. @@ -87,8 +87,8 @@ struct cdet_query const MbRefItem * refItem; const MbMatrix3D * wMatrix; geom_element() - : appItem( c3d_null ) - , refItem( c3d_null ) + : appItem( nullptr ) + , refItem( nullptr ) , wMatrix( &MbMatrix3D::identity ) {} }; @@ -127,7 +127,7 @@ struct cdet_query_result: public cdet_query private: static cback_res QueryFunc( cdet_query * query, message code, cback_data & ) { - C3D_ASSERT( c3d_null != query ); + C3D_ASSERT( nullptr != query ); cdet_query_result * q = static_cast( query ); switch( code ) { @@ -172,7 +172,7 @@ private: { case CDET_QUERY_STARTED: // The collision query is started for all solids of the set { - q->first = q->second = c3d_null; + q->first = q->second = nullptr; return CBACK_VOID; } case CDET_FINISHED: // A pair of solids is finished. @@ -368,7 +368,7 @@ public: MbCollisionFace( const MbFace & f ) : item( CDET_NULL ) , mathFace( &f ) - , partFace( c3d_null ) + , partFace( nullptr ) {} const MbFace & Face() const { return *mathFace; } diff --git a/C3d/Include/cdet_utility.h b/C3d/Include/cdet_utility.h index 776503e..1b4ab13 100644 --- a/C3d/Include/cdet_utility.h +++ b/C3d/Include/cdet_utility.h @@ -119,7 +119,7 @@ public: public: // the functions below can be deprecated in future version. - /** + /* \brief \ru Добавить модель тела, как набор граней и решеток. \en Add a solid data as a set of faces and the grids. \~ \return \ru Внутренняя структура данных представляющая добавленную модель. \en Internal data structure representing added solid data. \~ @@ -162,7 +162,7 @@ public: /* // Use AppItem() insead this cdet_app_item Component( size_t solIdx ) const; // The func is deprecated. Instead, use CheckCollisions - cdet_result InterferenceDetect( void * formalPar = c3d_null ) const; + cdet_result InterferenceDetect( void * formalPar = nullptr ) const; // The func is deprecated. Use SetDistanceTracking instead. void SetDistanceComputationObjects( const MbLumpAndFaces &, const MbLumpAndFaces & ); // The func is deprecated. Use AddSolid/AddItem instead. @@ -197,7 +197,7 @@ inline cdet_result MbCollisionDetectionUtility::CheckCollisions() /// \ru Узел дерева объемов. \en A node of the bounding volume tree. typedef const MtRefItem * cdet_bvt_node; /// \ru Пустое дерево объемов. \en An empty bounding volume tree. -const cdet_bvt_node CDET_BVT_NULL = c3d_null; +const cdet_bvt_node CDET_BVT_NULL = nullptr; /// \ru Пара ветвей поддерева объемов. \en A pair of branches of the bounding volume subtree. typedef std::pair cdet_bvt_pair; diff --git a/C3d/Include/check_geometry.h b/C3d/Include/check_geometry.h index de1557d..8a0d26a 100644 --- a/C3d/Include/check_geometry.h +++ b/C3d/Include/check_geometry.h @@ -70,13 +70,13 @@ public: public: /// \ru Пересечение - есть тело. \en Intersection is a solid. - bool IsSolid() const { return ((solid != c3d_null) || (isSolid && !edges.empty())); } + bool IsSolid() const { return ((solid != nullptr) || (isSolid && !edges.empty())); } /// \ru Пересечение касательной областью поверхности. \en Intersection by a tangent region of a surface. bool IsSurface() const { return !isTangentCurve && !edges.empty(); } /// \ru Пересечение вдоль касательной линии. \en Intersection along a tangent line. bool IsCurve() const { return isTangentCurve && !edges.empty(); } /// \ru Пересечение точкой (еще не реализовано). \en Intersection is a point (not implemented yet). - bool IsPoint() const { return ((pointFrame != c3d_null) && (pointFrame->GetVerticesCount() > 0)); } + bool IsPoint() const { return ((pointFrame != nullptr) && (pointFrame->GetVerticesCount() > 0)); } /// \ru Установить флаг пересечения вдоль касательной линии. \en Set the flag of intersection along a tangent line. //void SetTangent( bool b ) { isTangentCurve = b; } @@ -92,7 +92,7 @@ public: template void GetCurves( EdgesVector & curves ) const; /// \ru Получить указатель на кривую пересечения по индексу. \en Get a pointer to an intersection curve by the index. - const MbCurveEdge * GetCurve( size_t k ) const { return ((k < edges.size()) ? edges[k].get() : c3d_null); } + const MbCurveEdge * GetCurve( size_t k ) const { return ((k < edges.size()) ? edges[k].get() : nullptr); } /// \ru Получить номера касающихся граней первого/второго тела. \en Get numbers concerning faces of the first/second solid. template void GetFaceNumbers( bool first, OutputIndicesVector & ) const; @@ -101,7 +101,7 @@ public: void GetFaceNumbersPairs( OutputIndicesPairsVector & ) const; /// \ru Количество точек касания. \en The number of touch points. - size_t GetPointsCount() const { return ((pointFrame != c3d_null) ? pointFrame->GetVerticesCount() : 0); } + size_t GetPointsCount() const { return ((pointFrame != nullptr) ? pointFrame->GetVerticesCount() : 0); } /// \ru Получить набор точек касания. \en Get a set of touch points. const MbPointFrame * GetPointFrame() const { return pointFrame; } @@ -117,8 +117,8 @@ MbShellsIntersectionData::MbShellsIntersectionData( const EdgesVector & initEdge : edges ( ) , faceIndices1 ( ) , faceIndices2 ( ) - , solid ( c3d_null ) - , pointFrame ( c3d_null ) + , solid ( nullptr ) + , pointFrame ( nullptr ) , isTangentCurve( false ) , isSolid ( isSolidEgdes ) { @@ -127,7 +127,7 @@ MbShellsIntersectionData::MbShellsIntersectionData( const EdgesVector & initEdge c3d::EdgeSPtr edge; edges.reserve( addCnt ); for ( size_t k = 0; k < addCnt; ++k ) { - if ( initEdges[k] != c3d_null ) { + if ( initEdges[k] != nullptr ) { edge = const_cast( &(*initEdges[k]) ); edges.push_back( edge ); } @@ -146,8 +146,8 @@ MbShellsIntersectionData::MbShellsIntersectionData( const EdgesVector & in : edges ( ) , faceIndices1 ( ) , faceIndices2 ( ) - , solid ( c3d_null ) - , pointFrame ( c3d_null ) + , solid ( nullptr ) + , pointFrame ( nullptr ) , isTangentCurve( false ) , isSolid ( false ) { @@ -157,7 +157,7 @@ MbShellsIntersectionData::MbShellsIntersectionData( const EdgesVector & in c3d::EdgeSPtr edge; edges.reserve( edgesCnt ); for ( size_t k = 0; k < edgesCnt; ++k ) { - if ( initEdges[k] != c3d_null ) { + if ( initEdges[k] != nullptr ) { edge = const_cast(&(*initEdges[k])); edges.push_back( edge ); } @@ -177,8 +177,8 @@ MbShellsIntersectionData::MbShellsIntersectionData( const EdgesVector & : edges ( ) , faceIndices1 ( ) , faceIndices2 ( ) - , solid ( c3d_null ) - , pointFrame ( c3d_null ) + , solid ( nullptr ) + , pointFrame ( nullptr ) , isTangentCurve( false ) , isSolid ( false ) { @@ -189,7 +189,7 @@ MbShellsIntersectionData::MbShellsIntersectionData( const EdgesVector & edges.reserve( edgesCnt ); size_t k; for ( k = 0; k < edgesCnt; ++k ) { - if ( initEdges[k] != c3d_null ) { + if ( initEdges[k] != nullptr ) { edge = const_cast(&(*initEdges[k])); edges.push_back( edge ); } @@ -340,9 +340,9 @@ bool CheckBoundaryEdges( const Edges & allEdges, Edges * boundaryEdges ) if ( boundaryEdges != &allEdges ) { for ( size_t i = 0, cnt = allEdges.size(); i < cnt; ++i ) { - if ( allEdges[i] != c3d_null && allEdges[i]->IsBoundaryFace( METRIC_PRECISION ) ) { + if ( allEdges[i] != nullptr && allEdges[i]->IsBoundaryFace( METRIC_PRECISION ) ) { isBoundary = true; - if ( boundaryEdges != c3d_null ) + if ( boundaryEdges != nullptr ) boundaryEdges->push_back( allEdges[i] ); else break; @@ -415,9 +415,9 @@ bool CheckInexactVertices( const Vertices & vertArr, double mAcc, Vertices * ine if ( inexactVerts != &vertArr ) { for ( size_t i = 0, icnt = vertArr.size(); i < icnt; ++i ) { MbVertex * v = vertArr[i]; - if ( v != c3d_null && v->GetTolerance() > mAcc ) { + if ( v != nullptr && v->GetTolerance() > mAcc ) { isInexactVertex = true; - if ( inexactVerts != c3d_null ) + if ( inexactVerts != nullptr ) inexactVerts->push_back( v ); else break; @@ -480,12 +480,12 @@ bool CheckInexactEdges( const Edges & allEdges, double mAcc, Edges * inexactEdge bool isInexactEdge = false; for ( size_t i = 0, icnt = allEdges.size(); i < icnt; ++i ) { - if ( allEdges[i] != c3d_null) { + if ( allEdges[i] != nullptr) { bool isSpaceNear = !::IsInexactEdge( *allEdges[i], mAcc ); if ( !isSpaceNear ) { isInexactEdge = true; - if ( inexactEdges != c3d_null ) + if ( inexactEdges != nullptr ) inexactEdges->push_back( allEdges[i] ); else break; @@ -498,7 +498,7 @@ bool CheckInexactEdges( const Edges & allEdges, double mAcc, Edges * inexactEdge double mLen = allEdges[i]->GetLengthEvaluation(); if ( mLen > METRIC_PRECISION && mLen > mTol + METRIC_PRECISION ) { isInexactEdge = true; - if ( inexactEdges != c3d_null ) + if ( inexactEdges != nullptr ) inexactEdges->push_back( allEdges[i] ); else break; @@ -707,6 +707,36 @@ MATH_FUNC (bool) FindLoopsSelfIntersections( const MbFace & face, const MbSNameM MATH_FUNC (bool) CheckFacesConnection( const RPArray & faces ); +//------------------------------------------------------------------------------ +/** \brief \ru Проверка связности граней faces. + \en Check for connectivity of faces 'faces'. \~ + \details \ru Проверка топологической связности граней faces. \n + \en Check for topological connectivity of faces 'faces'. \n \~ + \param[in] faces - \ru Проверяемый набор граней. + \en Set of faces under check. \~ + \return \ru Возвращает true, все грани топологически связаны. + \en Returns true if all the faces are topologically connected. \~ + \ingroup Algorithms_3D +*/ +//--- +MATH_FUNC (bool) CheckFacesConnection( const c3d::FacesVector & faces ); + + +//------------------------------------------------------------------------------ +/** \brief \ru Проверка связности граней faces. + \en Check for connectivity of faces 'faces'. \~ + \details \ru Проверка топологической связности граней faces. \n + \en Check for topological connectivity of faces 'faces'. \n \~ + \param[in] faces - \ru Проверяемый набор граней. + \en Set of faces under check. \~ + \return \ru Возвращает true, все грани топологически связаны. + \en Returns true if all the faces are topologically connected. \~ + \ingroup Algorithms_3D +*/ +//--- +MATH_FUNC (bool) CheckFacesConnection( const c3d::ConstFacesVector & faces ); + + //------------------------------------------------------------------------------ /** \brief \ru Найти в исходной оболочке "родительские" грани производной оболочки. \en Find "parent" faces of a derived shell in the initial shell. \~ diff --git a/C3d/Include/collection.h b/C3d/Include/collection.h index 36f6f05..7b99087 100644 --- a/C3d/Include/collection.h +++ b/C3d/Include/collection.h @@ -15,11 +15,13 @@ #include #include #include +#include #include class MATH_CLASS MbMesh; class MATH_CLASS MbGrid; +class MbGridTopology; //------------------------------------------------------------------------------ @@ -62,7 +64,8 @@ private: \details \ru Габаритный куб объекта рассчитывается только при запросе габарита объекта. Габаритный куб в конструкторе объекта и после модификации объекта принимает неопределенное значение. \en Bounding box of object is calculated only at the request. Bounding box of object is undefined after object constructor and after object modifications \n \~ */ - mutable MbCube cube; + mutable MbCube cube; + mutable DPtr topo; ///< \ru Дополнительная информация о топологии коллекции. \en Additional information about a topology of the collection. private: // \ru Объявление конструктора копирования без реализации, чтобы не было копирования по умолчанию. \en The copy constructor without implementation prevents from copying by default. MbCollection( const MbCollection & init ); @@ -84,10 +87,10 @@ public: // \ru Общие функции геометрического объекта \en Common functions of a geometric object virtual MbeSpaceType IsA() const; // \ru Тип объекта. \en A type of an object. virtual MbeSpaceType Type() const; // \ru Групповой тип объекта. \en Group type of object. - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Создать копию. \en Create a copy. - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать согласно матрице. \en Transform according to the matrix. - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвинуть вдоль вектора. \en Translate along a vector. - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси. \en Rotate about an axis. + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Создать копию. \en Create a copy. + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать согласно матрице. \en Transform according to the matrix. + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвинуть вдоль вектора. \en Translate along a vector. + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси. \en Rotate about an axis. virtual bool IsSame ( const MbSpaceItem & init, double accuracy = LENGTH_EPSILON ) const; // \ru Являются ли объекты равными? \en Are the objects equal? virtual bool SetEqual ( const MbSpaceItem & init ); // \ru Сделать объекты равным. \en Make the objects equal. virtual double DistanceToPoint ( const MbCartPoint3D & ) const; // \ru Вычислить расстояние до точки. \en Calculate the distance to a point. @@ -184,9 +187,7 @@ public: /// \ru Удалить точки. \en Delete points. void PointsRemove() { points.clear(); - #ifdef C3D_STANDARD_CXX_11_PARTIAL - points.shrink_to_fit(); - #endif + points.shrink_to_fit(); cube.SetEmpty(); } /// \ru Удалить точку с заданным номером. \en Delete point by the given index. void PointRemove ( size_t i ) { if ( i < points.size() ) points.erase( points.begin() + i ); cube.SetEmpty(); } @@ -282,17 +283,13 @@ public: /// \ru Удалить всю триангуляцию и освободить память. \en Delete all triangulation and free the memory. void HardFlush() { points.clear(); normals.clear(); escorts.clear(); triangles.clear(); quadrangles.clear(); elements.clear(); segments.clear(); //grids.clear(); - #ifdef C3D_STANDARD_CXX_11_PARTIAL points.shrink_to_fit(); normals.shrink_to_fit(); escorts.shrink_to_fit(); triangles.shrink_to_fit(); quadrangles.shrink_to_fit(); elements.shrink_to_fit(); segments.shrink_to_fit(); //grids.shrink_to_fit(); - #endif cube.SetEmpty(); } /// \ru Освободить лишнюю память. \en Free the unnecessary memory. void Adjust() { - #ifdef C3D_STANDARD_CXX_11_PARTIAL points.shrink_to_fit(); normals.shrink_to_fit(); escorts.shrink_to_fit(); triangles.shrink_to_fit(); quadrangles.shrink_to_fit(); elements.shrink_to_fit(); segments.shrink_to_fit(); //grids.shrink_to_fit(); - #endif } /// \ru Инициализировать объект. \en Initialize object. @@ -323,7 +320,12 @@ public: void ConvertAllToTriangles(); /// \ru Удалить дублирующие с заданной точностью друг друга точки. \en Remove redundant points with a given tolerance (duplicates). bool RemoveRedundantPoints( bool deleteNormals, double epsilon = LENGTH_EPSILON ); - + /// \ru Готова ли топология коллекции. \en Whether information about collection topology is ready. + bool IsGridTopologyReady() const { return topo != nullptr; } + /// \ru Создать новый временный объект информации о топологии. \en Create new temporary maintenance object information about collection topology. + const MbGridTopology * CreateGridTopology( bool keepExisting ) const; + /// \ru Удалить информацию о топологии. \en Delete a information about collection topology. + void ResetGridTopology() const; /** \} */ private: /// \ru Объявление оператора присваивания без реализации, чтобы не было присваивания по умолчанию. \en The declaration of the assignment operator without implementation to prevent an assignment by default. diff --git a/C3d/Include/constraint.h b/C3d/Include/constraint.h index 9f98aec..2813827 100644 --- a/C3d/Include/constraint.h +++ b/C3d/Include/constraint.h @@ -56,8 +56,8 @@ public: public: MtGeomArgument( const MbRefItem * p, const MbItem * h ); MtGeomArgument( const MtGeomArgument & ); - MtGeomArgument() : propItem( c3d_null ), propName( c3d::UNDEFINED_SNAME ) - , hash( c3d::UNDEFINED_SNAME ), item( c3d_null ), root( c3d_null ) {} + MtGeomArgument() : propItem( nullptr ), propName( c3d::UNDEFINED_SNAME ) + , hash( c3d::UNDEFINED_SNAME ), item( nullptr ), root( nullptr ) {} public: /** \brief \ru Получить непосредственный объект сборки, содержащий ссылочный объект. @@ -120,7 +120,7 @@ public: public: /// \ru Возвращает true, если ограничение не действительно. \en Return true if the constraint is invalid. - bool IsNull() const { return m_cItem == c3d_null; } + bool IsNull() const { return m_cItem == nullptr; } /// \ru Тип сопряжения (геометрического ограничения). \en Type of geometric constraint. MtMateType ConstraintType() const; /// \ru Текущее значение размера. \en Current value of the dimension. @@ -193,7 +193,7 @@ public: virtual void EvaluationFailed( const MbAssembly * ) const {} /// \ru Геометрический решатель нашел новую позицию под-объекта сборки. \en The geometric solver found a new position of a constrained sub-object belonging the assembly. virtual void PositionChanged( const MbAssembly *, const MbItem * /*subItem*/ ) const {} - + protected: ~ItAssemblyReactor() {} }; // ItAssemblyReactor diff --git a/C3d/Include/contour_graph.h b/C3d/Include/contour_graph.h index 9b6fe93..f87e085 100644 --- a/C3d/Include/contour_graph.h +++ b/C3d/Include/contour_graph.h @@ -13,6 +13,7 @@ #include #include +#include // for PlaneCurveSPtr class MATH_CLASS MpEdge; @@ -38,8 +39,8 @@ public: /// \ru Конструктор по точке. \en Constructor by point. MpVertex( const MbCartPoint & initP ) : point( initP ) - , begEdge( c3d_null ) - , endEdge( c3d_null ) + , begEdge( nullptr ) + , endEdge( nullptr ) {} /// \ru Деструктор. \en Destructor. @@ -513,8 +514,9 @@ public: \param[out] usedCurves - \ru Результат - использованные кривые. \en The result are the used curves. \~ */ - void GetUsedCurves( const RPArray & curveList, RPArray & usedCurves ); - + template + void GetUsedCurves( const CurvesArray & curveList, CurvesArray2 & usedCurves ); + /** \brief \ru Ориентация цикла по индексу. \en The orientation of a loop by its index. \~ \details \ru Ориентация цикла по индексу без проверки индекса.\n @@ -557,7 +559,8 @@ public: \param[in] curvesNames - \ru Имена кривых. \en Curves names. \n \~ */ - void SetAllName( const RPArray & curveList, MpGraph * g, std::map & curvesNames ); + template + void SetAllName( const CurvesArray & curveList, MpGraph * g, std::map & curvesNames ); /** \brief \ru Дать имена ребрам. \en Give names to edges. \~ @@ -568,8 +571,9 @@ public: \param[in] curvesNames - \ru Имена кривых. \en Curves names. \n \~ */ - void SetEdgeName( const RPArray & curveList, std::map & curvesNames ); - + template + void SetEdgeName( const CurvesArray & curveList, std::map & curvesNames ); + /** \brief \ru Определить ориентацию контуров. \en Determine the contours' orientation. \~ \details \ru Определить ориентацию контуров по их вложенности.\n @@ -577,8 +581,9 @@ public: \param[in] contourArray - \ru Список контуров, по которым строился граф. \en List of contours the graph is built for. \~ */ - void SetLoopsOrientation( const RPArray & contourArray ); - + template + void SetLoopsOrientation( const ContourArray & contourArray ); + /** \brief \ru Перевести параметры ребер в параметры кривых. \en Convert edges' parameters to curves' parameters. \~ \details \ru Перевести параметры ребер в параметры кривых, @@ -727,6 +732,254 @@ private: IMPL_PERSISTENT_OPS( MpGraph ) +//------------------------------------------------------------------------------ +/** \brief \ru Запомнить неиспользованные ребра. + \en Store unused edges. \~ + \details \ru Запомнить неиспользованные ребра, установив им имена.\n + \en Store unused edges giving names for them.\n \~ + \param[in] curveList - \ru Список неиспользованных кривых для установки имен. + \en The list of unused curves for setting the names. \~ + \param[in] g - \ru Граф для поиска неиспользованных ребер.\n + Если в нем или в его массиве неиспользованных ребер + нашлось ребро с именем неиспользованной кривой, + то оно запоминается в массиве неиспользованных ребер unusedEdges.\n + \en Graph for searching unused edges.\n + If there is an edge by the names of an unused curve + in the graph or its array of unused edges, + then it is stored in the array of unused edges unusedEdges.\n \~ + \param[in] curvesNames - \ru Имена кривых. + \en Curves names. \n \~ +*/ +// --- +template +void MpGraph::SetAllName( const CurvesArray & curveList, MpGraph * g, std::map & curvesNames ) +{ + ptrdiff_t i, j, j0, k; + MpLoop * loop = nullptr; + MpEdge * edge = nullptr; + bool s; + + unusedEdges.Flush(); + nameCount = curveList.size(); + + // Сначала именуются ребра. + for ( i = 0; i < (ptrdiff_t)loops.Count(); i++ ) { + loop = GetLoop( i ); + for ( k = 0; k < (ptrdiff_t)loop->GetEdgesCount(); k++ ) { + edge = loop->GetEdge( k ); + ptrdiff_t curveName = curvesNames[edge->GetCurve()]; // Это имя может быть у исходной кривой и у измененной в обработке наложений. + if ( curveName >= 0 && curveName <= nameCount ) { + edge->SetName( curveName ); + edge->SetCurve( nullptr ); + } + } + } + + // Теперь ищутся неиспользованные ребра. + for ( j = 0; j < nameCount; j++ ) { + j0 = -1; + + for ( i = 0; i < (ptrdiff_t)loops.Count(); i++ ) { + loop = GetLoop( i ); + for ( k = 0; k < (ptrdiff_t)loop->GetEdgesCount(); k++ ) { + edge = loop->GetEdge( k ); + if ( edge->GetName() == j ) + j0 = 1; // Нашли кривую в новом графе. + // if ( curve0==edge->GetCurve() ) { + // edge->SetName( j ); + // edge->SetCurve( nullptr ); + // j0 = 1; + // } + } + } + + if ( j0 < 0 && g != nullptr ) { // Этой кривой нет в новом графе this. Ищем ее в старом графе g. + for ( i = 0; i < (ptrdiff_t)g->loops.Count(); i++ ) { + loop = g->GetLoop( i ); + + for ( k = 0; k < (ptrdiff_t)loop->GetEdgesCount(); k++ ) { + edge = loop->GetEdge( k ); + + if ( j == edge->GetName() ) { // Это ребро построено на кривой curveList[j]. + s = edge->GetSense(); + if ( loop->GetMode() < 0 ) + s = !s; + + unusedEdges.Add( new MpEdge( edge->GetTBeg(), edge->GetTEnd(), s, j, edge->GetType() ) ); + j0 = 1; + i = g->loops.Count(); + break; + } + } + } + } + + if ( j0 < 0 && g != nullptr ) { // Если не нашли, ищем в неиспользованных ребрах. + for ( k = 0; k < (ptrdiff_t)g->unusedEdges.Count(); k++ ) { + edge = g->unusedEdges[k]; + if ( j == edge->GetName() ) { + s = edge->GetSense(); + unusedEdges.Add( new MpEdge( edge->GetTBeg(), edge->GetTEnd(), s, j, edge->GetType() ) ); + break; + } + } + } + } +} + + +//------------------------------------------------------------------------------ + /** \brief \ru Дать имена ребрам. + \en Give names to edges. \~ + \details \ru Дать имена ребрам по списку кривых.\n + \en Give names to edges by the list of curves.\n \~ + \param[in] curveList - \ru Список кривых для именования. + \en The list of curves for naming. \~ + \param[in] curvesNames - \ru Имена кривых. + \en Curves names. \n \~ + */ + // --- +template +void MpGraph::SetEdgeName( const CurvesArray & curveList, std::map & curvesNames ) +{ + // Именование ребер номерами кривых. + nameCount = curveList.size(); + + // for ( ptrdiff_t j = 0; j < nameCount; j++ ) { + // MbCurve *curve0 = curveList[j]; + // + // for ( ptrdiff_t i = 0; i < (ptrdiff_t)loops.Count(); i++ ) { + // MpLoop *loop = GetLoop( i ); + // + // for( ptrdiff_t k = 0; k < (ptrdiff_t)loop->edgeList.Count(); k++ ) { + // MpEdge *edge = loop->edgeList[k]; + // + // if ( curve0==edge->GetCurve() ) { + // edge->SetName( j ); + // edge->baseCurve = nullptr; + // } + // } + // } + // } + + for ( ptrdiff_t i = 0; i < (ptrdiff_t)loops.Count(); i++ ) { + MpLoop * loop = GetLoop( i ); + + for ( ptrdiff_t k = 0; k < (ptrdiff_t)loop->GetEdgesCount(); k++ ) { + MpEdge * edge = loop->GetEdge( k ); + + ptrdiff_t curveName = curvesNames[edge->GetCurve()]; + + if ( curveName >= 0 && curveName <= nameCount ) { + edge->SetName( curveName ); + edge->SetCurve( nullptr ); + } + } + } +} + +//------------------------------------------------------------------------------ + /** \brief \ru Выдать использованные кривые. + \en Get used curves. \~ + \details \ru Выдать использованные кривые и переименовать в соответствии с последними.\n + \en Get used curves and rename in compliance with the last ones.\n \~ + \param[in] curveList - \ru Набор кривых. + \en Set of curves. \~ + \param[out] usedCurves - \ru Результат - использованные кривые. + \en The result are the used curves. \~ + */ +// --- +template +void MpGraph::GetUsedCurves( const CurvesArray & curveList, CurvesArray2 & usedCurves ) +{ + SArray curveName( 0, 1 ); + GetEdgeName( curveName ); + + usedCurves.reserve( curveName.Count() ); + for ( ptrdiff_t j = 0; j < (ptrdiff_t)curveName.Count(); j++ ) { + ptrdiff_t n = curveName[j]; + if ( n < 0 || n >( ptrdiff_t )curveList.size() - 1 ) + continue; + usedCurves.push_back( curveList[n] ); + + for ( ptrdiff_t i = 0; i < (ptrdiff_t)loops.Count(); i++ ) { + MpLoop * loop = GetLoop( i ); + + for ( ptrdiff_t k = 0; k < (ptrdiff_t)loop->GetEdgesCount(); k++ ) + if ( loop->GetEdge( k )->GetName() == n ) + loop->GetEdge( k )->SetName( j ); + } + } + + nameCount = curveName.Count(); +} + +//------------------------------------------------------------------------------ + /** \brief \ru Определить ориентацию контуров. + \en Determine the contours' orientation. \~ + \details \ru Определить ориентацию контуров по их вложенности.\n + \en Determine the contours' orientation by its inclusion.\n \~ + \param[in] contourArray - \ru Список контуров, по которым строился граф. + \en List of contours the graph is built for. \~ + */ + // --- +template +void MpGraph::SetLoopsOrientation( const ContourArray & contourArray ) +{ + ptrdiff_t count = loops.Count(); + ptrdiff_t cnt = contourArray.size(); + + cnt -= count; + if ( cnt < 0 || count == 0 ) + return; + + double t; + MbContour * contour = nullptr; + MbContour * contour0 = nullptr; + MbCartPoint p, p1; + ptrdiff_t i, j; + MbeLocation loc, loc1; + const double kk = M_E / 8; + + SArray numb( count, 2 ); + for ( i = 0; i < count; i++ ) { + numb.Add( 0 ); + contour = contourArray[cnt + i]; + double tmin = contour->GetTMin(); + double tmax = contour->GetTMax(); + double dt = kk * ( tmax - tmin ); + + // Лучше брать иррациональный параметр BUG_24550 // t = contour->GetTMin(); + t = tmin + dt; + contour->PointOn( t, p ); + // Лучше брать иррациональный параметр BUG_24550 // t = (t+contour->GetTMax())*0.5; + t = tmax - dt; + contour->PointOn( t, p1 ); + + for ( j = 0; j < count; j++ ) { + if ( i == j ) + continue; + contour0 = contourArray[cnt + j]; + loc = contour0->PointLocation( p ); + if ( loc == loc_Inside ) + numb[i] = numb[i] + 1; + else { + if ( loc == loc_OnCurve ) { + loc1 = contour0->PointLocation( p1 ); + if ( loc1 == loc_Inside ) + numb[i] = numb[i] + 1; + else if ( loc1 == loc_OnCurve && i < j ) + numb[i] = numb[i] + 1; + } + } + } + } + + for ( i = 0; i < count; i++ ) + loops[i]->SetOrientation( numb[i] % 2 == 0 ); + +} + //------------------------------------------------------------------------------ /** \brief \ru Удалить вершину. \en Delete a vertex. \~ @@ -737,7 +990,7 @@ IMPL_PERSISTENT_OPS( MpGraph ) */ // --- inline void DeleteVertex( MpVertex *& vertex ) { delete vertex; - vertex = c3d_null; + vertex = nullptr; } @@ -751,7 +1004,7 @@ inline void DeleteVertex( MpVertex *& vertex ) { */ // --- inline void DeleteEdge( MpEdge *& edge ) { delete edge; - edge = c3d_null; + edge = nullptr; } @@ -765,7 +1018,7 @@ inline void DeleteEdge( MpEdge *& edge ) { */ // --- inline void DeleteLoop( MpLoop *& loop ) { delete loop; - loop = c3d_null; + loop = nullptr; } @@ -779,7 +1032,7 @@ inline void DeleteLoop( MpLoop *& loop ) { */ // --- inline void DeleteGraph( MpGraph *& graph ) { delete graph; - graph = c3d_null; + graph = nullptr; } @@ -848,7 +1101,50 @@ MATH_FUNC (MpGraph *) EncloseContoursBuilder( const RPArray & curveLi double accuracy, bool strict, VERSION version, - IProgressIndicator * progInd = c3d_null ); + IProgressIndicator * progInd = nullptr ); + +//------------------------------------------------------------------------------ +/** \brief \ru Построить контуры вокруг заданной точки. + \en Create contours around the given point. \~ + \details \ru Построить контуры вокруг заданной точки. + Строится один внешний и несколько внутренних контуров с одним уровнем вложенности. + На вход не должны приходить составные кривые (контуры и ломаные). + \en Create contours around the given point. + One outer and several inner loops are constructed with single nesting level. + Do not send composite curves (contours and polygons). Lay them on the components. \~ + \param[in] curveList - \ru Список кривых для построения. + \en List of curves for construction. \~ + \param[in] p - \ru Точка, вокруг которой строятся контуры. + \en A point the contours are constructed around. \~ + \param[out] usedCurves - \ru Использованные кривые. + \en Used curves. \~ + \param[out] contourArray - \ru Результат построения - набор контуров. + \en The result of construction is a set of contours. \~ + \param[in] accuracy - \ru Погрешность определения пересечения и близости кривых. + \en The accuracy of determining the intersection of curves and proximity. \~ + \param[in] strict - \ru Если false, сборка производится с загрубленной точностью. + \en If false, the construction is performed roughly. \~ + \param[in] version - \ru Версия построения. Последняя версия Math::DefaultMathVersion(). + \en The version of construction. The last version Math::DefaultMathVersion(). \~ + \param[in] progInd - \ru Индикатора прогресса выполнения. + \en Execution progress indicator. \~ + \return \ru Граф построения контуров. + \en Contours construction graph. \~ + \warning \ru При использовании функций EncloseContoursBuilder, OuterContoursBuilder, ContoursReconstructor + состояние флага strict и версия version должно использоваться одно в одном процессе обработки. + \en While using functions EncloseContoursBuilder, OuterContoursBuilder, ContoursReconstructor, + a single state of 'strict' flag and version must be used in one treatment process. \~ + \ingroup Algorithms_2D +*/ +// --- +MATH_FUNC (MpGraph *) EncloseContoursBuilder( const c3d::PlaneCurvesSPtrVector & curveList, + const MbCartPoint & p, + c3d::PlaneCurvesSPtrVector & usedCurves, + c3d::PlaneContoursSPtrVector & contourArray, + double accuracy, + bool strict, + VERSION version, + IProgressIndicator * progInd = nullptr ); //------------------------------------------------------------------------------ @@ -886,7 +1182,44 @@ MATH_FUNC (MpGraph *) OuterContoursBuilder( const RPArray & curveList, double accuracy, bool strict, VERSION version, - IProgressIndicator * progInd = c3d_null ); + IProgressIndicator * progInd = nullptr ); + +//------------------------------------------------------------------------------ +/** \brief \ru Построить объемлющие контуры на основе заданных кривых. + \en Construct enclosing contours on the basis of the given curves. \~ + \details \ru Построить объемлющие контуры на основе заданных кривых. + Строятся внешние и внутренние контуры с произвольным уровнем вложенности. + На вход не должны приходить составные кривые (контуры и ломаные). + \en Construct enclosing contours on the basis of the given curves. + Outer and inner loops are constructed with an arbitrary level of inclusion. + Do not send composite curves (contours and polygons). Lay them on the components. \~ + \param[in] curveList - \ru Список кривых для построения. + \en List of curves for construction. \~ + \param[out] contourArray - \ru Результат построения - набор контуров. + \en The result of construction is a set of contours. \~ + \param[in] accuracy - \ru Погрешность определения пересечения и близости кривых. + \en The accuracy of determining the intersection of curves and proximity. \~ + \param[in] strict - \ru Если false, сборка производится с загрубленной точностью. + \en If false, the construction is performed roughly. \~ + \param[in] version - \ru Версия построения. Последняя версия Math::DefaultMathVersion(). + \en The version of construction. The last version Math::DefaultMathVersion(). \~ + \param[in] progInd - \ru Индикатора прогресса выполнения. + \en Execution progress indicator. \~ + \return \ru Граф построения контуров. + \en Contours construction graph. \~ + \warning \ru При использовании функций EncloseContoursBuilder, OuterContoursBuilder, ContoursReconstructor + состояние флага strict и версия version должно использоваться одно в одном процессе обработки. + \en While using functions EncloseContoursBuilder, OuterContoursBuilder, ContoursReconstructor, + a single state of 'strict' flag and version must be used in one treatment process. \~ + \ingroup Algorithms_2D +*/ +// --- +MATH_FUNC( MpGraph * ) OuterContoursBuilder( const c3d::PlaneCurvesSPtrVector & curveList, + c3d::PlaneContoursSPtrVector & contourArray, + double accuracy, + bool strict, + VERSION version, + IProgressIndicator * progInd = nullptr ); //------------------------------------------------------------------------------ /** \brief \ru Перестроить контуры, построенные ранее вокруг точки. @@ -924,7 +1257,45 @@ MATH_FUNC (MpGraph *) ContoursReconstructor( const RPArray & curveLis double accuracy, bool strict, VERSION version, - IProgressIndicator * progInd = c3d_null ); + IProgressIndicator * progInd = nullptr ); + +//------------------------------------------------------------------------------ +/** \brief \ru Перестроить контуры, построенные ранее вокруг точки. + \en Reconstruct contours constructed around the point before. \~ + \details \ru Перестроить контуры, построенные ранее вокруг точки. + Функция перестраивает граф, построенный функцией EncloseContoursBuilder. + \en Reconstruct contours constructed around the point before. + The function reconstructs the graph constructed by EncloseContoursBuilder function. \~ + \param[in] curveList - \ru Список кривых для построения. + \en List of curves for construction. \~ + \param[in] graph - \ru Граф для перестроения. + \en A graph to reconstruct. \~ + \param[out] contourArray - \ru Результат построения - набор контуров. + \en The result of construction is a set of contours. \~ + \param[in] accuracy - \ru Погрешность определения пересечения и близости кривых. + \en The accuracy of determining the intersection of curves and proximity. \~ + \param[in] strict - \ru Если false, сборка производится с загрубленной точностью. + \en If false, the construction is performed roughly. \~ + \param[in] version - \ru Версия построения. Последняя версия Math::DefaultMathVersion(). + \en The version of construction. The last version Math::DefaultMathVersion(). \~ + \param[in] progInd - \ru Индикатора прогресса выполнения. + \en Execution progress indicator. \~ + \return \ru Граф построения контуров. + \en Contours construction graph. \~ + \warning \ru При использовании функций EncloseContoursBuilder, OuterContoursBuilder, ContoursReconstructor + состояние флага strict и версия version должно использоваться одно в одном процессе обработки. + \en While using functions EncloseContoursBuilder, OuterContoursBuilder, ContoursReconstructor, + a single state of 'strict' flag and version must be used in one treatment process. \~ + \ingroup Algorithms_2D +*/ +// --- +MATH_FUNC( MpGraph * ) ContoursReconstructor( const c3d::PlaneCurvesSPtrVector & curveList, + MpGraph * graph, + c3d::PlaneContoursSPtrVector contourArray, + double accuracy, + bool strict, + VERSION version, + IProgressIndicator * progInd = nullptr ); #endif // __CONTOUR_GRAPH_H diff --git a/C3d/Include/conv_annotation_item.h b/C3d/Include/conv_annotation_item.h index 81df333..ff5d107 100644 --- a/C3d/Include/conv_annotation_item.h +++ b/C3d/Include/conv_annotation_item.h @@ -573,7 +573,7 @@ public: /// \ru Задать диапазон. \en Set range. void SetRange( double vPlus, double vMinus ); /// \ru Получить номинал. \en Get value. - bool GetValue( double& v ); + bool GetValue( double& v ) const; /// \ru Получить границы диапазона и значение, если они заданы. \en Get bounds of range and a value if they are specified. bool GetRange( double& v, double& vPlus, double& vMinus ) const; /// \ru Получить границы диапазона, если они заданы. \en Get bounds of the range if they are specified. diff --git a/C3d/Include/conv_exchange_settings.h b/C3d/Include/conv_exchange_settings.h index 03be42e..361f01d 100644 --- a/C3d/Include/conv_exchange_settings.h +++ b/C3d/Include/conv_exchange_settings.h @@ -36,6 +36,25 @@ class MbProductInfo; #define LENGTH_UNIT_INCH 25.4 +//------------------------------------------------------------------------------ +/** \brief \ru Константы единиц массы. +\en Mass units constants.\~ +\ingroup Data_Interface +*/ +// --- +/// \ru Граммы. \en Grams. +#define MASS_UNIT_GM 1.0 +/// \ru Килограммы. \en Kilograms. +#define MASS_UNIT_KG 1000.0 +/// \ru Миллиграммы. \en Milligrams. +#define MASS_UNIT_MG 0.001 +/// \ru Микрограммы. \en Micrograms. +#define MASS_UNIT_MKG 1e-6 +/// \ru Унции. \en Ounces. +#define MASS_UNIT_OU 28.35 +/// \ru Фунты. \en Pounds. +#define MASS_UNIT_PN 453.59 + #define EXPORT_DEFAULT -1 ///< \ru По умолчанию для заданного формата. \en Default for specified format. #define EXPORT_STEP_203 203 ///< \ru STEP прикладной протокол 203 ( Проектирование с управляемой конфигурацией ). \en STEP applied protocol STEP 203 (Configuration controlled design). @@ -245,8 +264,9 @@ enum eMsgDetail { emd_ErrorStringEncoding, ///< \ru Ошибка кодировки строки. \en String encoding error. - emd_WarningCurveParametrizationCorrected ///< \ru Исправлена параметризация кривой. \en Curve parameterization was corrected. + emd_WarningCurveParametrizationCorrected, ///< \ru Исправлена параметризация кривой. \en Curve parameterization was corrected. + emd_ErrorJTDuplicatedTriangles ///< \ru Сетка содержит дублирующиеся треугольники и не может быть записана. \en Mesh contains duplicate triangles and cannot be written. }; @@ -275,11 +295,15 @@ struct C3DConverterDebugSettings { */ bool saveModelTwin; + /// \ru Включить вывод статистики импортируемых объектов. \en Enable logging the statistic of imported objects. + bool cerrOutImportStatistic; + /// \ru Конструктор. \en Conctuctor. C3DConverterDebugSettings() - : enableCERRout(false) - , cerrOutUserTreeTraverse(false) - , cerrOutIntermediateTreeTraverse(false) + : enableCERRout( false ) + , cerrOutUserTreeTraverse( false ) + , cerrOutIntermediateTreeTraverse( false ) + , cerrOutImportStatistic( false ) , saveModelTwin( false ) { } }; @@ -454,7 +478,7 @@ public: virtual bool AttatchIdAttributes() const { return true; } /// \ru Получить пользовательский преобразователь строк. \en Get user string transformer. - virtual SPtr GetUserCharEncodingTransformer() const { return SPtr(c3d_null); } + virtual SPtr GetUserCharEncodingTransformer() const { return SPtr(nullptr); } }; // IConvertorProperty3D diff --git a/C3d/Include/conv_model_document.h b/C3d/Include/conv_model_document.h index e15d93e..40f40a3 100644 --- a/C3d/Include/conv_model_document.h +++ b/C3d/Include/conv_model_document.h @@ -65,7 +65,7 @@ public: /** \brief \ru Прообраз новой интерфейсной функции - получить наполнение. \en Prototype of a new interface function - get the filling. \~ */ - virtual MbItem * GetContent() /*{ return c3d_null; }*/ = 0; + virtual MbItem * GetContent() /*{ return nullptr; }*/ = 0; /** \brief \ru Создать документ с новой сборкой при импорте. \en Create a document with a new assembly while importing. \~ @@ -75,8 +75,8 @@ public: \en Assembly name. \~ \param[in] solids - \ru Тела, добавляемые в сборку. \en Solids to add into the assembly. \~ - \return \ru Экземпляр сборки, если операция прошла успешно, c3d_null в противном случае. - \en Instance of an assembly if the operation succeeded, c3d_null - otherwise. \~ + \return \ru Экземпляр сборки, если операция прошла успешно, nullptr в противном случае. + \en Instance of an assembly if the operation succeeded, nullptr - otherwise. \~ */ virtual ModelAssemblyPtr CreateAssembly( const c3d::ItemsSPtrVector & componentItems, const c3d::string_t& fileName ) = 0; @@ -89,8 +89,8 @@ public: \en Solids to add into a part. \~ \param[in] fileName - \ru Имя детали. \en A part name. \~ - \return \ru Экземпляр детали, если операция прошла успешно, c3d_null в противном случае. - \en Instance of the part if the operation succeeded, c3d_null - otherwise. \~ + \return \ru Экземпляр детали, если операция прошла успешно, nullptr в противном случае. + \en Instance of the part if the operation succeeded, nullptr - otherwise. \~ */ virtual ModelPartPtr CreatePart( const c3d::ItemsSPtrVector & componentItems, const c3d::string_t& fileName ) = 0; @@ -98,8 +98,8 @@ public: \en Get an assembly for export. \~ \details \ru Увеличить счётчик ссылок результирующей сборки на 1. \en Increase the reference counter of the resultant assembly by 1. \~ - \return \ru Экземпляр сборки, если операция прошла успешно, c3d_null в противном случае. - \en Instance of an assembly if the operation succeeded, c3d_null - otherwise. \~ + \return \ru Экземпляр сборки, если операция прошла успешно, nullptr в противном случае. + \en Instance of an assembly if the operation succeeded, nullptr - otherwise. \~ */ virtual ModelAssemblyPtr GetInstanceAssembly( ) = 0; @@ -108,8 +108,8 @@ public: \en Get the detail for export. \~ \details \ru Увеличить счётчик ссылок результирующей детали на 1. \en Increase the reference counter of the resultant part by 1. \~ - \return \ru Экземпляр детали, если операция прошла успешно, c3d_null в противном случае. - \en Instance of the part if the operation succeeded, c3d_null - otherwise. \~ + \return \ru Экземпляр детали, если операция прошла успешно, nullptr в противном случае. + \en Instance of the part if the operation succeeded, nullptr - otherwise. \~ */ virtual ModelPartPtr GetInstancePart( ) = 0; @@ -157,6 +157,9 @@ public: }; +class MaAtributePostRemover; + + //------------------------------------------------------------------------------ /** \brief \ru Формирователь геометрического представления PMI. \en Generator of PMI's geometry shape. \~ @@ -168,11 +171,14 @@ public: // --- class CONV_CLASS C3DPmiToItem : public MbRefItem { SPtr symToItem; + MaAtributePostRemover* tempAttributeManager; public: C3DPmiToItem( SPtr = SPtr() ); virtual SPtr operator() ( const MaAnnotationItem* ) const; virtual SPtr operator() ( const MbItem* ) const; + + void AddPartItem( const MbItem& ); // Добавить элемент для установления связи PMI и элемента модели virtual ~C3DPmiToItem(); }; @@ -341,8 +347,8 @@ public: \en LCS of the assembly in the parent's model. \~ \param[in] fileName - \ru Имя сборки. \en Assembly name. \~ - \return \ru Экземпляр сборки, если операция прошла успешно, c3d_null в противном случае. - \en Instance of an assembly if the operation succeeded, c3d_null - otherwise. \~ + \return \ru Экземпляр сборки, если операция прошла успешно, nullptr в противном случае. + \en Instance of an assembly if the operation succeeded, nullptr - otherwise. \~ */ virtual ModelAssemblyPtr CreateAssembly( const MbPlacement3D &place, const c3d::ItemsSPtrVector & componentItems, const c3d::string_t& fileName ) = 0; @@ -356,23 +362,23 @@ public: \en Solids included in the part. \~ \param[in] fileName - \ru Название детали. \en Solid's name. \~ - \return \ru Экземпляр детали, если операция прошла успешно, c3d_null в противном случае. - \en Instance of the part if the operation succeeded, c3d_null - otherwise. \~ + \return \ru Экземпляр детали, если операция прошла успешно, nullptr в противном случае. + \en Instance of the part if the operation succeeded, nullptr - otherwise. \~ */ virtual ModelPartPtr CreatePart( const MbPlacement3D &place, const c3d::ItemsSPtrVector & componentItems, const c3d::string_t& fileName ) = 0; /** \brief \ru Получить сборку для экспорта. \en Get an assembly for export. \~ - \return \ru Экземпляр сборки, если операция прошла успешно, c3d_null в противном случае. - \en Instance of an assembly if the operation succeeded, c3d_null - otherwise. \~ + \return \ru Экземпляр сборки, если операция прошла успешно, nullptr в противном случае. + \en Instance of an assembly if the operation succeeded, nullptr - otherwise. \~ */ virtual ModelAssemblyPtr GetInstanceAssembly( ) = 0; /** \brief \ru Получить деталь для экспорта. \en Get the detail for export. \~ - \return \ru Экземпляр детали, если операция прошла успешно, c3d_null в противном случае. - \en Instance of the part if the operation succeeded, c3d_null - otherwise. \~ + \return \ru Экземпляр детали, если операция прошла успешно, nullptr в противном случае. + \en Instance of the part if the operation succeeded, nullptr - otherwise. \~ */ virtual ModelPartPtr GetInstancePart( ) = 0; @@ -445,15 +451,15 @@ public: \en Get an empty interface of the insertion for creation of subassembly or a part while importing. \~ \details \ru Увеличить счётчик ссылок на 1. \en Increase the reference counter by 1. \~ - \return \ru Интерфейс вставки, если операция прошла успешно или c3d_null в противном случае. - \en Interface of the instance if the operation succeeded and c3d_null otherwise. \~ + \return \ru Интерфейс вставки, если операция прошла успешно или nullptr в противном случае. + \en Interface of the instance if the operation succeeded and nullptr otherwise. \~ */ virtual ModelInstancePtr PrepareInstance() = 0; /** \brief \ru Получить интерфейс следующей вставки для создания подсборки или детали при экспорте. \en Get the interface of the next insertion for creation of a subassembly or a part while exporting. \~ - \return \ru Интерфейс вставки, если операция прошла успешно или c3d_null в противном случае. - \en Interface of the insertion if the operation succeeded and c3d_null otherwise. \~ + \return \ru Интерфейс вставки, если операция прошла успешно или nullptr в противном случае. + \en Interface of the insertion if the operation succeeded and nullptr otherwise. \~ */ virtual ModelInstancePtr NextInstance( bool includeInvisible ) = 0; @@ -524,15 +530,15 @@ public: \en Get an empty interface of the insertion for creation of subassembly or a part while importing. \~ \details \ru Увеличить счётчик ссылок на 1. \en Increase the reference counter by 1. \~ - \return \ru Интерфейс вставки, если операция прошла успешно или c3d_null в противном случае. - \en Interface of the instance if the operation succeeded and c3d_null otherwise. \~ + \return \ru Интерфейс вставки, если операция прошла успешно или nullptr в противном случае. + \en Interface of the instance if the operation succeeded and nullptr otherwise. \~ */ virtual ModelInstancePtr PrepareInstance() = 0; /** \brief \ru Получить интерфейс следующей вставки для создания подсборки или детали при экспорте. \en Get the interface of the next insertion for creation of a subassembly or a part while exporting. \~ - \return \ru Интерфейс вставки, если операция прошла успешно или c3d_null в противном случае. - \en Interface of the insertion if the operation succeeded and c3d_null otherwise. \~ + \return \ru Интерфейс вставки, если операция прошла успешно или nullptr в противном случае. + \en Interface of the insertion if the operation succeeded and nullptr otherwise. \~ */ virtual ModelInstancePtr NextInstance( bool includeInvisible ) = 0; diff --git a/C3d/Include/conv_model_exchange.h b/C3d/Include/conv_model_exchange.h index 11f2f13..fc13125 100644 --- a/C3d/Include/conv_model_exchange.h +++ b/C3d/Include/conv_model_exchange.h @@ -26,6 +26,7 @@ class IScaleRequestor; class ItModelDocument; class IConvertorProperty3D; class IConfigurationSelector; +class IAttributeNamesCollector; /** \addtogroup Exchange_Interface @@ -102,8 +103,8 @@ namespace c3d { */ CONV_FUNC( MbeConvResType ) ImportFromFile( MbModel& model, const path_string& fileName, - IConvertorProperty3D* prop = c3d_null, - IProgressIndicator* indicator = c3d_null ); + IConvertorProperty3D* prop = nullptr, + IProgressIndicator* indicator = nullptr ); /** \brief \ru Прочитать файл обменного формата в элемент. @@ -126,8 +127,8 @@ namespace c3d { */ CONV_FUNC( MbeConvResType ) ImportFromFile( c3d::ItemSPtr& item, const path_string& filePath, - IConvertorProperty3D* prop = c3d_null, - IProgressIndicator* indicator = c3d_null ); + IConvertorProperty3D* prop = nullptr, + IProgressIndicator* indicator = nullptr ); /** \brief \ru Прочитать файл обменного формата в модель. \en Read a file of an exchange format into model. \~ @@ -149,8 +150,8 @@ namespace c3d { */ CONV_FUNC( MbeConvResType ) ImportFromFile( ItModelDocument& mDoc, const path_string& filePath, - IConvertorProperty3D* prop = c3d_null, - IProgressIndicator* indicator = c3d_null ); + IConvertorProperty3D* prop = nullptr, + IProgressIndicator* indicator = nullptr ); /** \brief \ru Записать модель в файл обменного формата. \en Write the model into an exchange format file. \~ @@ -172,8 +173,8 @@ namespace c3d { */ CONV_FUNC( MbeConvResType ) ExportIntoFile( MbModel& model, const path_string& filePath, - IConvertorProperty3D* prop = c3d_null, - IProgressIndicator* indicator = c3d_null ); + IConvertorProperty3D* prop = nullptr, + IProgressIndicator* indicator = nullptr ); /** \brief \ru Записать модель в файл обменного формата. \en Write the model into an exchange format file. \~ @@ -195,8 +196,8 @@ namespace c3d { */ CONV_FUNC( MbeConvResType ) ExportIntoFile( MbItem& item, const path_string& filePath, - IConvertorProperty3D* prop = c3d_null, - IProgressIndicator* indicator = c3d_null ); + IConvertorProperty3D* prop = nullptr, + IProgressIndicator* indicator = nullptr ); /** \brief \ru Записать модельный документ в файл обменного формата. \en Write the model into an exchange format file. \~ @@ -218,8 +219,8 @@ namespace c3d { */ CONV_FUNC( MbeConvResType ) ExportIntoFile( ItModelDocument& mDoc, const path_string& filePath, - IConvertorProperty3D* prop = c3d_null, - IProgressIndicator* indicator = c3d_null ); + IConvertorProperty3D* prop = nullptr, + IProgressIndicator* indicator = nullptr ); /** \brief \ru Импортировать данные из буфера в модель. @@ -241,8 +242,8 @@ namespace c3d { CONV_FUNC( MbeConvResType ) ImportFromBuffer( MbModel& model, const C3DExchangeBuffer& buffer, MbeModelExchangeFormat modelFormat, - IConvertorProperty3D* prop = c3d_null, - IProgressIndicator* indicator = c3d_null ); + IConvertorProperty3D* prop = nullptr, + IProgressIndicator* indicator = nullptr ); /** \brief \ru Импортировать данные из буфера в модель. @@ -264,8 +265,8 @@ namespace c3d { CONV_FUNC( MbeConvResType ) ImportFromBuffer( c3d::ItemSPtr& item, const C3DExchangeBuffer& buffer, MbeModelExchangeFormat modelFormat, - IConvertorProperty3D* prop = c3d_null, - IProgressIndicator* indicator = c3d_null ); + IConvertorProperty3D* prop = nullptr, + IProgressIndicator* indicator = nullptr ); /** \brief \ru Экспортировать модель в буфер. @@ -287,8 +288,8 @@ namespace c3d { CONV_FUNC( MbeConvResType ) ExportIntoBuffer( MbModel& model, MbeModelExchangeFormat modelFormat, C3DExchangeBuffer& buffer, - IConvertorProperty3D* prop = c3d_null, - IProgressIndicator* indicator = c3d_null ); + IConvertorProperty3D* prop = nullptr, + IProgressIndicator* indicator = nullptr ); /** \brief \ru Экспортировать модель в буфер. @@ -310,8 +311,8 @@ namespace c3d { CONV_FUNC( MbeConvResType ) ExportIntoBuffer( MbItem& item, MbeModelExchangeFormat modelFormat, C3DExchangeBuffer& buffer, - IConvertorProperty3D* prop = c3d_null, - IProgressIndicator* indicator = c3d_null ); + IConvertorProperty3D* prop = nullptr, + IProgressIndicator* indicator = nullptr ); /** \brief \ru Экспортировать модельный документ в буфер. \en Export model document into buffer. \~ @@ -332,8 +333,8 @@ namespace c3d { CONV_FUNC( MbeConvResType ) ExportIntoBuffer( ItModelDocument& item, MbeModelExchangeFormat modelFormat, C3DExchangeBuffer& buffer, - IConvertorProperty3D* prop = c3d_null, - IProgressIndicator* indicator = c3d_null ); + IConvertorProperty3D* prop = nullptr, + IProgressIndicator* indicator = nullptr ); //------------------------------------------------------------------------------ /** \brief \ru Буфер для обмена. @@ -349,7 +350,7 @@ namespace c3d { // \ru Конструктор. \en Constructor. C3DExchangeBuffer() - : data( c3d_null ) + : data( nullptr ) , count( 0 ) { } @@ -416,10 +417,10 @@ public: \en Implementation of converter's properties interface. \~ \param[in] idoc - \ru Реализация интерфейса документа. \en Implementation of document interface. \~ - \param[in] stream - \ru Поток, из которого производится чтение (может быть c3d_null). - \en Stream from which reading is performed (can be c3d_null). \~ - \param[in] indicator - \ru Индикатор хода процесса (может быть c3d_null). - \en The process progress indicator (can be c3d_null). \~ + \param[in] stream - \ru Поток, из которого производится чтение (может быть nullptr). + \en Stream from which reading is performed (can be nullptr). \~ + \param[in] indicator - \ru Индикатор хода процесса (может быть nullptr). + \en The process progress indicator (can be nullptr). \~ \param[in] qeuryStitch - \ru Диалог запроса на сшивку поверхностей. \en Dialog of request for stitching the surfaces. \~ \return \ru Код завершения операции. @@ -440,10 +441,10 @@ public: \en Implementation of converter's properties interface. \~ \param[in] idoc - \ru Реализация интерфейса документа. \en Implementation of document interface. \~ - \param[in] stream - \ru Поток, в который производится запись (может быть c3d_null). - \en Stream in which the record is performed (can be c3d_null). \~ - \param[in] indicator - \ru Индикатор хода процесса (может быть c3d_null). - \en The process progress indicator (can be c3d_null). \~ + \param[in] stream - \ru Поток, в который производится запись (может быть nullptr). + \en Stream in which the record is performed (can be nullptr). \~ + \param[in] indicator - \ru Индикатор хода процесса (может быть nullptr). + \en The process progress indicator (can be nullptr). \~ \return \ru Код завершения операции. \en Code of the operation termination. \~ \ingroup ACIS_Exchange @@ -800,6 +801,30 @@ public: */ virtual MbeConvResType ImportForeign( const c3d::path_string& path, ItModelDocument& idoc, IConvertorProperty3D* prop = 0, IProgressIndicator* indicator = 0 ) = 0; + /** \brief \ru Импортировать предварительные данные модели: список атрибутов и конфигураций. + \en Import preliminary model data: list of attributes and configurations . \~ + \param[in] prop - \ru Реализация интерфейса свойств конвертера. + \en Implementation of converter's properties interface. \~ + \param[in] indicator - \ru Индикатор хода процесса. + \return \ru Код завершения операции. + \en Code of the operation termination. \~ + \ingroup Data_Exchange + */ + virtual MbeConvResType PreliminaryImport( IConvertorProperty3D& prop, IProgressIndicator* indicator = 0) = 0; + + + /** \brief \ru Задать параметры для сохранения данных на этапе предварительного импорта. + \en Set parameters to save datа at the stage of preliminary import. \~ + \param[in] attrCollector - \ru Реализация интерфейса для сохранения имен атрибутов модели. + \en Implementation of the interface for collecting model attribute names. . \~ + \param[in] configSelector - \ru Реализация интерфейса выбора конфигурации файла. + \en Implementation of the file configuration selection interface . \~ + \note \ru ЭКСПЕРИМЕНТАЛЬНАЯ. + \en EXPEREIMENTAL \~. + \ingroup Data_Exchange + */ + virtual void SetPreliminaryCallbacks( IAttributeNamesCollector* attrCollector, IConfigurationSelector* configSelector) = 0; + }; // IConvertor3D @@ -845,8 +870,8 @@ CONV_FUNC( MbeConvResType ) SATRead( IConvertorProperty3D& prop, ItModelDocument \en Implementation of converter's properties interface. \~ \param[in] idoc - \ru Реализация интерфейса документа. \en Implementation of document interface. \~ -\param[in] indicator - \ru Индикатор хода процесса (может быть c3d_null). - \en The process progress indicator (can be c3d_null). \~ +\param[in] indicator - \ru Индикатор хода процесса (может быть nullptr). + \en The process progress indicator (can be nullptr). \~ \return \ru Код завершения операции. \en Code of the operation termination. \~ \ingroup ACIS_Exchange @@ -1144,7 +1169,7 @@ namespace c3d { const char* data, size_t length, MbeModelExchangeFormat modelFormat, - IConvertorProperty3D* prop = c3d_null, IProgressIndicator* indicator = c3d_null ); + IConvertorProperty3D* prop = nullptr, IProgressIndicator* indicator = nullptr ); /** \brief \ru Экспортировать модель в буфер. \en Export model into buffer. \~ @@ -1195,7 +1220,7 @@ namespace c3d { DEPRECATE_DECLARE CONV_FUNC( MbeConvResType ) ExportIntoBuffer( MbItem& item, MbeModelExchangeFormat modelFormat, char*& data, size_t& length, - IConvertorProperty3D* prop = c3d_null, IProgressIndicator* indicator = c3d_null ); + IConvertorProperty3D* prop = nullptr, IProgressIndicator* indicator = nullptr ); } diff --git a/C3d/Include/conv_plugin_import.h b/C3d/Include/conv_plugin_import.h deleted file mode 100644 index 50bfa66..0000000 --- a/C3d/Include/conv_plugin_import.h +++ /dev/null @@ -1,872 +0,0 @@ -//////////////////////////////////////////////////////////////////////////////// -/** -\file -\brief \ru API для передачи моделей, прочитанных сторонним модулем. -\en API for models read by 3d party component.\~ -\details \ru Определен интерфейс, который должен реализовать модуль и структуры -для передачи информации о модели, топологии, геометрии. -\en Declared API the module has to implement and structures for structure, -topology and geomentry transmission.\~ -*/ -//////////////////////////////////////////////////////////////////////////////// - -#ifndef __CONV_PUGIN_IMPORT_H -#define __CONV_PUGIN_IMPORT_H - -#include - -//////////////////////////////////////////////////////////////////////////////// -// -// Dynamic-link library API -// -//////////////////////////////////////////////////////////////////////////////// - - -//------------------------------------------------------------------------------ -/** \brief \ru Путь, по которому расположен интегратор для интеграционного пакета - со сторонним модулем. - \en Path where integration kit for external module is located.\~ - - \details \ru Путь должен содержать завершающий. - \en Path where integration kit for external module is located.\~ - -\ingroup Data_Interface -*/ -// --- -#ifdef _UNICODE -#define C3D_PATH_TO_PLUGIN L"C3D_PATH_TO_PLUGIN" -#else -#define C3D_PATH_TO_PLUGIN "C3D_PATH_TO_PLUGIN" -#endif - - -//------------------------------------------------------------------------------ -/** \brief \ru Актуальная версия API плагина. - \en Current API version of the plugin.\~ -\ingroup Data_Interface -*/ -// --- -#define CURRENT_API_VERSION_MAJOR "2" - - -//------------------------------------------------------------------------------ -/** \brief \ru Имена функций инициализации и завершения работы плагина. - \en Initialize and release functions of plugin.\~ -\ingroup Data_Interface -*/ -// --- -#define C3D_PLUGIN_INIT_SOURCE InitSource -#define C3D_PLUGIN_C_SET_PLUGIN_OPTION CSetPluginOption -#define C3D_PLUGIN_W_SET_PLUGIN_OPTION WSetPluginOption -#define C3D_PLUGIN_W_SET_MODEL_CONFIGURATION_SELECT WSetModelConfigurationSelect -#define C3D_PLUGIN_RELEASE_SOURCE ReleaseSource -#define C3D_PLUGIN_MAJOR_API_VERSION MajorAPIVersion - -//------------------------------------------------------------------------------ -/** \brief \ru Имена функций инициализации и завершения работы плагина. - \en Initialize and release functions of plugin.\~ -\ingroup Data_Interface -*/ -// --- -#define C3D_PLUGIN_INIT_SOURCE_NAME "InitSource" -#define C3D_PLUGIN_C_SET_PLUGIN_OPTION_NAME "CSetPluginOption" -#define C3D_PLUGIN_W_SET_PLUGIN_OPTION_NAME "WSetPluginOption" -#define C3D_PLUGIN_W_SET_MODEL_CONFIGURATION_SELECT_NAME "WSetModelConfigurationSelect" -#define C3D_PLUGIN_RELEASE_SOURCE_NAME "ReleaseSource" -#define C3D_PLUGIN_MAJOR_API_VERSION_NAME "MajorAPIVersion" - -struct ObModelSource; -struct IWSelectConfigurationCallback; - -//------------------------------------------------------------------------------ -/** \brief \ru Объявление функций инициализации и завершения работы плагина. - \en Declare initialize and release functions of plugin.\~ -\ingroup Data_Interface -*/ -// --- -#ifdef WIN32 -#define C3D_PLUGIN_INIT_EXPORT_DECLARE extern "C" __declspec( dllexport ) ObModelSource* _cdecl C3D_PLUGIN_INIT_SOURCE ( const char*, const char* ); -#define C3D_PLUGIN_C_SET_PLUGIN_OPTION_DECLARE extern "C" __declspec( dllexport ) void _cdecl C3D_PLUGIN_C_SET_PLUGIN_OPTION ( const char*, const char* ); -#define C3D_PLUGIN_W_SET_PLUGIN_OPTION_DECLARE extern "C" __declspec( dllexport ) void _cdecl C3D_PLUGIN_W_SET_PLUGIN_OPTION ( const wchar_t*, const wchar_t* ); -#define C3D_PLUGIN_W_SET_MODEL_CONFIGURATION_SELECT_DECLARE extern "C" __declspec( dllexport ) void _cdecl C3D_PLUGIN_W_SET_MODEL_CONFIGURATION_SELECT ( IWSelectConfigurationCallback* ); -#define C3D_PLUGIN_RELEASE_EXPORT_DECLARE extern "C" __declspec( dllexport ) void _cdecl C3D_PLUGIN_RELEASE_SOURCE ( ObModelSource* ); -#define C3D_PLUGIN_MAJOR_API_VERSION_DECLARE extern "C" __declspec( dllexport ) const char* _cdecl C3D_PLUGIN_MAJOR_API_VERSION (); -#else -#define C3D_PLUGIN_INIT_EXPORT_DECLARE ObModelSource* C3D_PLUGIN_INIT_SOURCE ( const char*, const char* ); -#define C3D_PLUGIN_C_SET_PLUGIN_OPTION_DECLARE void C3D_PLUGIN_C_SET_PLUGIN_OPTION ( const char*, const char* ); -#define C3D_PLUGIN_W_SET_PLUGIN_OPTION_DECLARE void C3D_PLUGIN_W_SET_PLUGIN_OPTION ( const wchar_t*, const wchar_t* ); -#define C3D_PLUGIN_W_SET_MODEL_CONFIGURATION_SELECT_DECLARE void C3D_PLUGIN_W_SET_MODEL_CONFIGURATION_SELECT ( IWSelectConfigurationCallback* ); -#define C3D_PLUGIN_RELEASE_EXPORT_DECLARE void C3D_PLUGIN_RELEASE_SOURCE ( ObModelSource* ); -#define C3D_PLUGIN_MAJOR_API_VERSION_DECLARE const char* C3D_PLUGIN_MAJOR_API_VERSION (); -#endif // WIN32 - - -//------------------------------------------------------------------------------ -/** \brief \ru Объявление типа функций инициализации и завершения работы плагина. - \en Declare types of initialize and release functions of plugin.\~ -\ingroup Data_Interface -*/ -// --- -#ifdef WIN32 -typedef ObModelSource* ( _cdecl* C3D_PLUGIN_INIT_SOURCE_CALL ) ( const char*, const char* ); -typedef void ( _cdecl* C3D_PLUGIN_C_SET_OPTION_CALL ) ( const char*, const char* ); -typedef void ( _cdecl* C3D_PLUGIN_W_SET_OPTION_CALL ) ( const wchar_t*, const wchar_t* ); -typedef void ( _cdecl* C3D_PLUGIN_W_SET_MODEL_CONFIGURATION_SELECT_CALL ) ( IWSelectConfigurationCallback* ); -typedef void ( _cdecl* C3D_PLUGIN_RELEASE_SOURCE_CALL )( ObModelSource* ); -typedef const char* ( _cdecl* C3D_PLUGIN_MAJOR_API_VERSION_CALL ) ( ); -#else -typedef ObModelSource* ( * C3D_PLUGIN_INIT_SOURCE_CALL ) ( const char*, const char* ); -typedef void ( * C3D_PLUGIN_C_SET_OPTION_CALL ) ( const char*, const char* ); -typedef void ( * C3D_PLUGIN_W_SET_OPTION_CALL ) ( const wchar_t*, const wchar_t* ); -typedef void ( * C3D_PLUGIN_W_SET_MODEL_CONFIGURATION_SELECT_CALL ) ( IWSelectConfigurationCallback* ); -typedef void ( * C3D_PLUGIN_RELEASE_SOURCE_CALL ) ( ObModelSource* ); -typedef const char* ( * C3D_PLUGIN_MAJOR_API_VERSION_CALL ) ( ); -#endif // WIN32 - - -//////////////////////////////////////////////////////////////////////////////// -// -// Plugin types -// -//////////////////////////////////////////////////////////////////////////////// - - -//------------------------------------------------------------------------------ -/** \brief \ru Объявление булевых значений. -\en Declare boolean values.\~ -\ingroup Data_Interface -*/ -// --- -#define C3D_PLUGIN_BOOL int -#define C3D_PLUGIN_TRUE 1 -#define C3D_PLUGIN_FALSE 0 - -#define C3D_SYMBOL_COMPOSITE_TEXT 3 -#define C3D_SYMBOL_TEXT_LINE 2 -#define C3D_SYMBOL_PRREDEFINED 1 - -#define C3D_SYMBOL_ARC_LENGTH "C3D_SYMBOL_ARC_LENGTH" -#define C3D_SYMBOL_CONICAL_TAPER "C3D_SYMBOL_CONICAL_TAPER" -#define C3D_SYMBOL_COUNTERBORE "C3D_SYMBOL_COUNTERBORE" -#define C3D_SYMBOL_COUNTERSINK "C3D_SYMBOL_COUNTERSINK" -#define C3D_SYMBOL_DEPTH "C3D_SYMBOL_DEPTH" -#define C3D_SYMBOL_DIAMETER "C3D_SYMBOL_DIAMETER" -#define C3D_SYMBOL_PLUS_MINUS "C3D_SYMBOL_PLUS_MINUS" -#define C3D_SYMBOL_SLOPE "C3D_SYMBOL_SLOPE" -#define C3D_SYMBOL_SPHERICAL_DIAMETER "C3D_SYMBOL_SPHERICAL_DIAMETER" -#define C3D_SYMBOL_SPHERICAL_RADIUS "C3D_SYMBOL_SPHERICAL_RADIUS" -#define C3D_SYMBOL_SQUARE "C3D_SYMBOL_SQUARE" -#define C3D_SYMBOL_ANGULARITY "C3D_SYMBOL_ANGULARITY" -#define C3D_SYMBOL_CIRCULAR_RUNOUT "C3D_SYMBOL_CIRCULAR_RUNOUT" -#define C3D_SYMBOL_CIRCULARITY "C3D_SYMBOL_CIRCULARITY" -#define C3D_SYMBOL_CONCENTRICITY "C3D_SYMBOL_CONCENTRICITY" -#define C3D_SYMBOL_CYLINDRICITY "C3D_SYMBOL_CYLINDRICITY" -#define C3D_SYMBOL_FLATNESS "C3D_SYMBOL_FLATNESS" -#define C3D_SYMBOL_PARALLELISM "C3D_SYMBOL_PARALLELISM" -#define C3D_SYMBOL_PERPENDICULARITY "C3D_SYMBOL_PERPENDICULARITY" -#define C3D_SYMBOL_POSITION "C3D_SYMBOL_POSITION" -#define C3D_SYMBOL_LINE_PROFILE "C3D_SYMBOL_LINE_PROFILE" -#define C3D_SYMBOL_SURFACE_PROFILE "C3D_SYMBOL_SURFACE_PROFILE" -#define C3D_SYMBOL_STRAIGHTNESS "C3D_SYMBOL_STRAIGHTNESS" -#define C3D_SYMBOL_SYMMETRY "C3D_SYMBOL_SYMMETRY" -#define C3D_SYMBOL_TOTAL_RUNOUT "C3D_SYMBOL_TOTAL_RUNOUT" - - -#define C3D_CALLOUT_GENERAL 0 -#define C3D_CALLOUT_DIMENSION 1 -#define C3D_CALLOUT_PROJECTION 2 - - -#define C3D_TERMINATOR_EMPTY 0 -#define C3D_TERMINATOR_BLANKED_ARROW 1 -#define C3D_TERMINATOR_BLANKED_BOX 2 -#define C3D_TERMINATOR_BLANKED_DOT 3 -#define C3D_TERMINATOR_DIMENSION_ORIGIN 4 -#define C3D_TERMINATOR_FILLED_ARROW 5 -#define C3D_TERMINATOR_FILLED_BOX 6 -#define C3D_TERMINATOR_FILLED_DOT 7 -#define C3D_TERMINATOR_INTEGRAL_SYMBOL 8 -#define C3D_TERMINATOR_OPEN_ARROW 9 -#define C3D_TERMINATOR_SLASH 10 -#define C3D_TERMINATOR_UNFILLED_ARROW 11 - - -#define C3D_DIMENSION_GENERAL 0 -#define C3D_DIMENSION_LINEAR 1 -#define C3D_DIMENSION_ANGULAR 2 - - - -//////////////////////////////////////////////////////////////////////////////// -// -// Curves -// -//////////////////////////////////////////////////////////////////////////////// - - -//------------------------------------------------------------------------------ -/** \brief \ru Примитив трехмерного пространства (точка либо вектор). - \en Spatial primitive (point or vector).\~ -\ingroup Data_Interface -*/ -// --- -struct ObPrimitive3D { - double x, y, z; - - ObPrimitive3D() - : x( 0.0 ), y( 0.0 ), z( 0.0 ) - {} -}; - - -//------------------------------------------------------------------------------ -// Инициализировать примитив -// --- -inline void SetObPrimitiveZero( ObPrimitive3D& ob ) { - ob.x = ob.y = ob.z = 0.0; -} - - -//------------------------------------------------------------------------------ -// Инициализировать примитив -// --- -inline bool IsObPrimitiveZero( const ObPrimitive3D& ob ) { - return (ob.x == 0.0) && (ob.y == 0.0) && (ob.z == 0.0); -} - - -//------------------------------------------------------------------------------ -/** \brief \ru Локальная система координат в трехмерном пространстве. - \en Spatial placement.\~ -\ingroup Data_Interface -*/ -// --- -struct ObLocation3D { - ObPrimitive3D origin, axisX, axisY, axisZ; - - ObLocation3D() - : origin(), axisX(), axisY(), axisZ() - {} -}; - - -//------------------------------------------------------------------------------ -/** \brief \ru Одномерный диапазон. - \en One dimensional range.\~ -\ingroup Data_Interface -*/ -// --- -struct ObRange1D { - double start, end; - - ObRange1D() - : start( 0.0 ), end( 0.0 ) - {} -}; - - -//------------------------------------------------------------------------------ -/** \brief \ru Трехмерный отрезок. - \en Spatial line segment.\~ -\ingroup Data_Interface -*/ -// --- -struct ObSegment3D { - static const int CurveType = 1; - ObRange1D domain; - ObPrimitive3D start, end; - - ObSegment3D() - : domain(), start(), end() - {} -}; - - -//------------------------------------------------------------------------------ -/** \brief \ru Трехмерная полилиния. - \en Spatial polyline.\~ -\ingroup Data_Interface -*/ -// --- -struct ObPolyline3D { - static const int CurveType = 2; - int pointsArrayId; - - ObPolyline3D() - : pointsArrayId( 0 ) - {} -}; - - -//------------------------------------------------------------------------------ -/** \brief \ru Трехмерная дуга. - \en Spatial arc.\~ -\ingroup Data_Interface -*/ -// --- -struct ObArc3D { - static const int CurveType = 3; - ObLocation3D location; - double majorAxis, minorAxis; - ObRange1D domain; - - ObArc3D() - : location(), majorAxis( 0.0 ), minorAxis( 0.0 ), domain() - {} -}; - - -//------------------------------------------------------------------------------ -/** \brief \ru Трехмерная парабола. - \en Spatial parabola.\~ -\ingroup Data_Interface -*/ -// --- -struct ObParabola3D { - static const int CurveType = 4; - ObLocation3D location; - double focalLength; - ObRange1D domain; - - ObParabola3D() - : location(), focalLength( 0.0 ), domain() - {} -}; - - -//------------------------------------------------------------------------------ -/** \brief \ru Трехмерная дуга. - \en Spatial arc.\~ -\ingroup Data_Interface -*/ -// --- -struct ObHyperbola3D { - static const int CurveType = 5; - ObLocation3D location; - double majorSemiAxis, minorSemiAxis; - ObRange1D domain; - - ObHyperbola3D() - : location(), majorSemiAxis( 0.0 ), minorSemiAxis( 0.0 ), domain() - {} -}; - - -//------------------------------------------------------------------------------ -/** \brief \ru Трехмерный сплайн. - \en Spatial spline.\~ -\ingroup Data_Interface -*/ -// --- -struct ObSplineCurve3D { - static const int CurveType = 6; - int knotsId, vertcisId; - int degree; - int closed; - - ObSplineCurve3D() - : knotsId( 0 ), vertcisId( 0 ), degree( 0 ), closed( 0 ) - {} -}; - - -//------------------------------------------------------------------------------ -/** \brief \ru Трехмерный NURBS. - \en Spatial NURBS.\~ -\ingroup Data_Interface -*/ -// --- -struct ObNURBSCurve3D { - static const int CurveType = 7; - int knotsId, vertcisId, weightsId; - int degree; - C3D_PLUGIN_BOOL closed; - ObRange1D domain; - - ObNURBSCurve3D() - : knotsId( 0 ), vertcisId( 0 ), weightsId( 0 ), degree( 0 ), closed( 0 ), domain() - {} -}; - - -//------------------------------------------------------------------------------ -/** \brief \ru Трехмерная составная кривая. - \en Spatial composite curve.\~ -\ingroup Data_Interface -*/ -// --- -struct ObCompositeCurve3D { - static const int CurveType = 8; - int segmentsArrIndicis; - - ObCompositeCurve3D() - : segmentsArrIndicis( 0 ) - {} -}; - - -//////////////////////////////////////////////////////////////////////////////// -// -// Surfaces -// -//////////////////////////////////////////////////////////////////////////////// - - -//------------------------------------------------------------------------------ -/** \brief \ru Плоскость. - \en Plane.\~ -\ingroup Data_Interface -*/ -// --- -struct ObPlane { - static const int SurfaceType = 1; - ObLocation3D location; - ObRange1D uDomain, vDomain; - - ObPlane() - : location(), uDomain(), vDomain() - {} -}; - - -//------------------------------------------------------------------------------ -/** \brief \ru Цилиндрическая поверхность. - \en Cylinder surface.\~ -\ingroup Data_Interface -*/ -// --- -struct ObCylinder { - static const int SurfaceType = 2; - ObLocation3D location; - double r, h; - ObRange1D uDomain, vDomain; - - ObCylinder() - : location(), r( 0.0 ), h( 0.0 ), uDomain(), vDomain() - {} -}; - - -//------------------------------------------------------------------------------ -/** \brief \ru Коническая поверхность. - \en Cone surface.\~ -\ingroup Data_Interface -*/ -// --- -struct ObCone { - static const int SurfaceType = 3; - ObLocation3D location; - double r, h, halfAngle; - ObRange1D uDomain, vDomain; - - ObCone() - : location(), r( 0.0 ), h( 0.0 ), halfAngle( 0.0 ), uDomain(), vDomain() - {} -}; - - -//------------------------------------------------------------------------------ -/** \brief \ru Сферическая поверхность. - \en Sphere surface.\~ -\ingroup Data_Interface -*/ -// --- -struct ObSphere { - static const int SurfaceType = 4; - ObLocation3D location; - double r; - ObRange1D uDomain, vDomain; - - ObSphere() - : location(), r( 0.0 ), uDomain(), vDomain() - {} -}; - - -//------------------------------------------------------------------------------ -/** \brief \ru Тороидальная поверхность. - \en Torus surface.\~ -\ingroup Data_Interface -*/ -// --- -struct ObTorus { - static const int SurfaceType = 5; - ObLocation3D location; - double rMin, rMax; - ObRange1D uDomain, vDomain; - - ObTorus() - : location(), rMin( 0.0 ), rMax( 0.0 ), uDomain(), vDomain() - {} -}; - - -//------------------------------------------------------------------------------ -/** \brief \ru Поверхность выдавливания. - \en Extrusion surface.\~ -\ingroup Data_Interface -*/ -// --- -struct ObExtrusion { - static const int SurfaceType = 6; - int curve; - ObPrimitive3D direction; - - ObExtrusion() - : curve( 0 ), direction() - {} -}; - - -//------------------------------------------------------------------------------ -/** \brief \ru Поверхность вращения. - \en Revolution surface.\~ -\ingroup Data_Interface -*/ -// --- -struct ObRevolution { - static const int SurfaceType = 7; - int curveId; - ObPrimitive3D axisOrigin, axisDirection; - ObRange1D vRange; - - ObRevolution() - : curveId( 0 ), axisOrigin(), axisDirection(), vRange() - {} -}; - - -//------------------------------------------------------------------------------ -/** \brief \ru Линейчатая поверхность. - \en Ruled surface.\~ -\ingroup Data_Interface -*/ -// --- -struct ObRuled { - static const int SurfaceType = 8; - int curve1, curve2; - - ObRuled() - : curve1( 0 ), curve2( 0 ) - {} -}; - - -//------------------------------------------------------------------------------ -/** \brief \ru Сплайновая поверхность. - \en Spline surface.\~ -\ingroup Data_Interface -*/ -// --- -struct ObSplineSurface { - static const int SurfaceType = 9; - int knotsUId, knotsVId, verticisListId; - int degreeU, degreeV; - int closedU, closedV; - - ObSplineSurface() - : knotsUId( 0 ), knotsVId( 0 ), verticisListId( 0 ), degreeU( 0 ), degreeV( 0 ), closedU( 0 ), closedV( 0 ) - {} -}; - - -//------------------------------------------------------------------------------ -/** \brief \ru Сплайновая поверхность. - \en Spline surface.\~ -\ingroup Data_Interface -*/ -// --- -struct ObNURBSSurface { - static const int SurfaceType = 10; - int knotsUId, knotsVId, verticisListListId, weightsListListId; - int degreeU, degreeV; - C3D_PLUGIN_BOOL closedU, closedV; - - ObNURBSSurface() - : knotsUId( 0 ), knotsVId( 0 ), verticisListListId( 0 ), weightsListListId( 0 ), degreeU( 0 ), degreeV( 0 ), closedU( 0 ), closedV( 0 ) - {} -}; - - -//------------------------------------------------------------------------------ -/** \brief \ru Смещённая поверхность. - \en Offset surface.\~ -\ingroup Data_Interface -*/ -// --- -struct ObOffsetSurface { - static const int SurfaceType = 11; - int baseSurface; - double offset; - - ObOffsetSurface() - : baseSurface( 0 ), offset( 0.0 ) - {} -}; - - -//------------------------------------------------------------------------------ -/** \brief \ru Цвет. - \en Colour.\~ -\ingroup Data_Interface -*/ -// --- -struct ObColour { - double red, green, blue; - - ObColour() - : red( 0.0 ), green( 0.0 ), blue( 0.0 ) - {} -}; - - -//------------------------------------------------------------------------------ -/** \brief \ru Неопределённый компонент цвета. - \en Undefined component of colour.\~ -\ingroup Data_Interface -*/ -// --- -const double ObUndefinedColourComponent = -1.0; - - -//------------------------------------------------------------------------------ -/** \brief \ru Элемент аннотации. - \en PMI item.\~ -\ingroup Data_Interface -*/ -// --- -struct ObPMI { - ObLocation3D location; - int visualArray; - int textBlockIdArray; - - ObPMI() - : location(), visualArray( 0 ), textBlockIdArray( 0 ) - {} -}; - - -//------------------------------------------------------------------------------ -/** \brief \ru Элемент текста. - \en Text item.\~ -\ingroup Data_Interface -*/ -// --- -struct ObTextBlock { - double originX, originY; - double dirX, dirY; - double extentX, extentY; - - ObTextBlock() - : originX( 0.0 ), originY( 0.0 ), dirX( 0.0 ), dirY( 0.0 ), extentX( 0.0 ), extentY( 0.0 ) - {} -}; - - -//------------------------------------------------------------------------------ -/** \brief \ru Размер. - \en Dimension.\~ -\ingroup Data_Interface -*/ -// --- -struct ObDimension { - double value; - double deviationMin, deviationMax; - int type; - int calloutArrId; - - ObDimension() - : value( 0.0 ), deviationMin( 0.0 ), deviationMax( 0.0 ), type( 0 ), calloutArrId( 0 ) - {} -}; - - -//------------------------------------------------------------------------------ -/** \brief \ru Особая линия. - \en Special line.\~ -\ingroup Data_Interface -*/ -// --- -struct ObPMICallout { - int type; - //int geometry; - ObPrimitive3D head, tail; - bool isArc; - ObPrimitive3D center; - int terminatorHead; - int terminatorTail; - - ObPMICallout() - : type( 0 ), head(), tail(), isArc( false ), center(), terminatorHead( 0 ), terminatorTail( 0 ) - {} -}; - - -//////////////////////////////////////////////////////////////////////////////// -// -// Model source plugin. Basic interface. -// -//////////////////////////////////////////////////////////////////////////////// - - -//------------------------------------------------------------------------------ -/** \brief \ru Источник данных модели. - \en Model source.\~ -\ingroup Data_Interface -*/ -// --- -struct ObModelSource { - - virtual ~ObModelSource() {}; - - virtual C3D_PLUGIN_BOOL LastOperationSuccess() = 0; - - // Операции с файлом - virtual C3D_PLUGIN_BOOL IsPathWCS() = 0; - virtual C3D_PLUGIN_BOOL Open( const char* ) = 0; - virtual C3D_PLUGIN_BOOL Open( const wchar_t* ) = 0; - virtual void Close() = 0; - - // Значение неопределённого идентификатора. - virtual int UndefinedId() = 0; - - // Управление трассировкой событий - virtual void EnableLog() = 0; - virtual void DisableLog() = 0; - - // Контейнеры - - virtual unsigned int ArrayCount ( int arrayId ) = 0; - virtual int ArrayIdentifier ( int arrayId, unsigned int index ) = 0; - virtual double ArrayFloat ( int arrayId, unsigned int index ) = 0; - virtual ObPrimitive3D ArrayPrimitive ( int arrayId, unsigned int index ) = 0; - - virtual ObColour ItemColour( int itemId ) = 0; - - // Модель - virtual int ModelPart() = 0; - - virtual unsigned int PartInstanceCount( int partId ) = 0; - virtual int PartInstance( int partId, unsigned int inst ) = 0; - - virtual const wchar_t* WPartName( int partId ) = 0; - virtual const wchar_t* WPartLabel( int partId ) = 0; - virtual const wchar_t* WPartAuthor( int partId ) = 0; - virtual const wchar_t* WPartOrganization( int partId ) = 0; - virtual const wchar_t* WPartDescription( int partId ) = 0; - - virtual const char* CPartName( int partId ) = 0; - virtual const char* CPartLabel( int partId ) = 0; - virtual const char* CPartAuthor( int partId ) = 0; - virtual const char* CPartOrganization( int partId ) = 0; - virtual const char* CPartDescription( int partId ) = 0; - - virtual int InstancePart( int instanceId ) = 0; - virtual ObLocation3D InstanceLocation( int instanceId ) = 0; - - virtual unsigned int SolidsCount( int partId ) = 0; - - // Топология граничного представления - virtual int Solid( int partId, unsigned int solid ) = 0; - virtual ObLocation3D SolidLocation( int solidId ) = 0; - - virtual unsigned int SpaceCurvesCount( int partId ) = 0; - virtual int SpaceCurve( int partId, unsigned int curve ) = 0; - - virtual unsigned int ShellsCount( int solidId ) = 0; - virtual int Shell( int solid, unsigned int shell ) = 0; - - virtual C3D_PLUGIN_BOOL ShellClosed( int shellId ) = 0; - virtual unsigned int ShellFacesCount( int shellId ) = 0; - virtual int ShellFace( int shellId, unsigned int face ) = 0; - - virtual unsigned int FaceBoundsCount( int faceId ) = 0; - virtual int FaceBound( int faceId, unsigned int bound ) = 0; - virtual C3D_PLUGIN_BOOL FaceSurfaceSameOriented( int faceId ) = 0; - - virtual int BoundType( int boundId ) = 0; - virtual unsigned int BoundCoedgesCount( int boundId ) = 0; - virtual int BoundCoedge( int boundId, unsigned int coedge ) = 0; - - virtual int CoedgeEdge( int coedgeId ) = 0; - virtual C3D_PLUGIN_BOOL CoedgeEdgeSameOriented( int coedgeId ) = 0; - - virtual int EdgeStartVertex( int edgeId ) = 0; - virtual int EdgeEndVertex( int edgeId ) = 0; - - // Методы получения геометрии - - virtual int FaceGeometry( int faceId ) = 0; - virtual int EdgeGeometry( int edgeId ) = 0; - virtual ObPrimitive3D VertexGeometry( int vertexId ) = 0; - - // Типы геометрических объектов - - virtual int SurfaceType( int surfaceId ) = 0; - virtual int Curve3DType( int curveId ) = 0; - - // Данные геометрии - - // Пространственные кривые - - virtual ObSegment3D LineSegment3D( int curveId ) = 0; - virtual ObPolyline3D Polyline3D( int curveId ) = 0; - virtual ObArc3D Arc3D( int curveId ) = 0; - virtual ObParabola3D Parabola3D( int curveId ) = 0; - virtual ObHyperbola3D Hyperbola3D( int curveId ) = 0; - virtual ObSplineCurve3D SplineCurve3D( int curveId ) = 0; - virtual ObNURBSCurve3D NURBSCurve3D( int curveId ) = 0; - virtual ObCompositeCurve3D CompositeCurve3D( int curveId ) = 0; - - virtual unsigned int CompositeCurveSegmentsCount( int curveId ) = 0; - virtual int CompositeCurveSegment( int curveId, unsigned int index ) = 0; - virtual C3D_PLUGIN_BOOL CompositeCurveSegmentsSameOriented( int curveId, unsigned int index ) = 0; - - // Поверхности - - virtual ObPlane Plane( int surfaceId ) = 0; - virtual ObCylinder Cylinder( int surfaceId ) = 0; - virtual ObCone Cone( int surfaceId ) = 0; - virtual ObSphere Sphere( int surfaceId ) = 0; - virtual ObTorus Torus( int surfaceId ) = 0; - virtual ObExtrusion Extrusion( int surfaceId ) = 0; - virtual ObRevolution Revolution( int surfaceId ) = 0; - virtual ObRuled Ruled( int surfaceId ) = 0; - virtual ObSplineSurface SplineSurface( int surfaceId ) = 0; - virtual ObNURBSSurface NURBSSurface( int surfaceId ) = 0; - virtual ObOffsetSurface OffsetSurface( int surfaceId ) = 0; - - virtual unsigned int PartPMICount( int partIdId ) = 0; - virtual int PartPMI( int partId, unsigned int index ) = 0; - virtual ObPMI PMI( int pmiId ) = 0; - - virtual C3D_PLUGIN_BOOL IsDimension( int pmiId ) = 0; - virtual ObDimension Dimension( int pmiId ) = 0; - - virtual ObPMICallout PMICallout( int calloutId ) = 0; - - virtual int PMITextType( int textBlockId ) = 0; - virtual ObTextBlock PMITextLocation( int textBlockId ) = 0; - virtual const char* PMITextSymbol( int textBlockId ) = 0; - virtual const wchar_t* WPMIText( int textId ) = 0; - virtual const char* CPMIText( int textBlockId ) = 0; - virtual unsigned int CompositeTextCount( int textId ) = 0; - virtual int CompositeText( int textId, unsigned int index ) = 0; - - virtual unsigned int PMICalloutCount( int pmiId ) = 0; - virtual ObPMICallout PMICallout( int pmiId, unsigned int index ) = 0; - - virtual double LengthUnitsFactor() = 0; - -}; - - -struct IWSelectConfigurationCallback { - virtual void AddConfiguration( const wchar_t* ) = 0; - virtual void SetActiveConfiguration( int ) = 0; - virtual int SelectConfiguration() const = 0; -}; - - -#endif // __CONV_PUGIN_IMPORT_H - diff --git a/C3d/Include/conv_requestor.h b/C3d/Include/conv_requestor.h index fbc324e..bcdcb6b 100644 --- a/C3d/Include/conv_requestor.h +++ b/C3d/Include/conv_requestor.h @@ -34,6 +34,26 @@ public: }; +//------------------------------------------------------------------------------ +/** +\brief \ru Интерфейс для сохранения списка имен атрибутов модели. + \en Interface for collecting model attribute names. \~ +\details \ru Вызывается во время импорта предварительных данных модели + для задания списка имен атрибутов модели. + \en Called during import of preliminary model data to specify + a list of model attribute names . \~ + \note \ru ЭКСПЕРИМЕНТАЛЬНАЯ. + \en EXPEREIMENTAL. \~ +*/ +// --- +class IAttributeNamesCollector : public MbRefItem +{ +public: + virtual void AddAttributeName( const c3d::string_t& configurationName ) = 0; +}; + + + //------------------------------------------------------------------------------ /// /** diff --git a/C3d/Include/conv_topo_mesh.h b/C3d/Include/conv_topo_mesh.h index d3c23bc..7a4cc6c 100644 --- a/C3d/Include/conv_topo_mesh.h +++ b/C3d/Include/conv_topo_mesh.h @@ -54,33 +54,47 @@ namespace JTC { std::vector boundaryPoints; double metricTolerance; public: - TopoMesh(); // Конструктор + /// Конструктор + TopoMesh(); - virtual ~TopoMesh(); //Деструктор + /// Деструктор + virtual ~TopoMesh(); - bool Init( const MbMesh& mesh, bool enableDiagnostics = false ); // Инициализировать + /// Инициализировать + bool Init( const MbMesh& mesh, bool enableDiagnostics = false ); - const MbMesh* GetMesh() const; // Получить сетку + /// Получить сетку + const MbMesh* GetMesh() const; - size_t MeshPolygonsCount() const; // Число полигонов + /// Число полигонов + size_t MeshPolygonsCount() const; - MeshPolygonPtr Polygon( size_t index ) const; // Получить полигон + /// Получить полигон + MeshPolygonPtr Polygon( size_t index ) const; - size_t MeshVerticisCount() const; // Число вершин + /// Число вершин + size_t MeshVerticisCount() const; - MeshVertexPtr Vertex( size_t index ) const; // Получить вершину + /// Получить вершину + MeshVertexPtr Vertex( size_t index ) const; - std::map< size_t, std::vector > GetDegeneratedTriangles() const; // Получить вырожденные треуголники + /// Получить вырожденные треуголники + std::map< size_t, std::vector > GetDegeneratedTriangles() const; - std::vector GetBoundaryPoints() const; // Получить граничные точки сетки + /// Получить граничные точки сетки + std::vector GetBoundaryPoints() const; - void Reset(); // Сбросить все данные + /// Сбросить все данные + void Reset(); - size_t NextBoundaryVertex( size_t indexBoundaryVertex, const std::vector& allBoundary ) const; // Получить следующую в цепочке граничную вершину. + /// Получить следующую в цепочке граничную вершину. + size_t NextBoundaryVertex( size_t indexBoundaryVertex, const std::vector& allBoundary ) const; - bool InitVoidBoundFrom( std::vector& freeBoundaryVerticis ); // Сформировать внешнюю границу начиная с указанной вершины. + /// Сформировать внешнюю границу начиная с указанной вершины. + bool InitVoidBoundFrom( std::vector& freeBoundaryVerticis ); - double MetricTolerance() const; // Получить точность задания расстояния. + /// Получить точность задания расстояния. + double MetricTolerance() const; OBVIOUS_PRIVATE_COPY( TopoMesh ) }; diff --git a/C3d/Include/cr_attribute_provider.h b/C3d/Include/cr_attribute_provider.h index b01d81b..696ed87 100644 --- a/C3d/Include/cr_attribute_provider.h +++ b/C3d/Include/cr_attribute_provider.h @@ -70,20 +70,20 @@ public: ~MbAttributeProvider(); virtual MbeCreatorType IsA() const; // \ru Выдать тип элемента. \en Get an element type. - virtual void Transform( const MbMatrix3D & matr, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. - virtual void Move( const MbVector3D & to, MbRegTransform * = c3d_null ); // \ru Сдвинуть вдоль вектора. \en Move along a vector. - virtual void Rotate( const MbAxis3D & axis, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси. \en Rotate about an axis. + virtual void Transform( const MbMatrix3D & matr, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. + virtual void Move( const MbVector3D & to, MbRegTransform * = nullptr ); // \ru Сдвинуть вдоль вектора. \en Move along a vector. + virtual void Rotate( const MbAxis3D & axis, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси. \en Rotate about an axis. virtual bool IsSame( const MbCreator &, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal? virtual bool IsSimilar( const MbCreator & ) const; // \ru Определить, являются ли объекты подобными. \en Determine whether the objects are similar. virtual bool SetEqual( const MbCreator & ); // \ru Сделать равным. \en Make equal. - virtual MbCreator & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию. \en Create a copy. + virtual MbCreator & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию. \en Create a copy. virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта. \en Get properties of the object. virtual void SetProperties( const MbProperties & ); // \ru Записать свойства объекта. \en Set properties of the object. virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта. \en Get a name of object property. virtual bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell, - RPArray * items = c3d_null ); // \ru Построение \en Construction. + RPArray * items = nullptr ); // \ru Построение \en Construction. // \ru Добавить отдельный атрибут (забрать во владение) \en Add a separate attribute. void AddAttribute( const MbName & name, MbAttribute * attr ); @@ -125,7 +125,7 @@ public: /// \ru Записать полученные атрибуты. \en Save the received attributes. void ReceiveAttributes ( c3d::AttrVector & attrs ); /// \ru Скопировать атрибуты. \en Copy attributes. - void DuplicateAttributes( c3d::AttrVector & attrs, MbRegDuplicate * iReg = c3d_null ) const; + void DuplicateAttributes( c3d::AttrVector & attrs, MbRegDuplicate * iReg = nullptr ) const; /// \ru Дать количество атрибутов. \en Get the attributes count. size_t AttributesCount() const { return attributes.size(); } /// \ru Добавить атрибут. \en Add an attribute. diff --git a/C3d/Include/cr_boolean_solid.h b/C3d/Include/cr_boolean_solid.h index 1f3e3dc..c0d95ee 100644 --- a/C3d/Include/cr_boolean_solid.h +++ b/C3d/Include/cr_boolean_solid.h @@ -67,10 +67,10 @@ public : // \ru Общие функции математического объекта \en Common functions of the mathematical object virtual MbeCreatorType IsA() const; // \ru Тип элемента. \en A type of element. - virtual void Transform( const MbMatrix3D &, MbRegTransform * ireg = c3d_null ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. - virtual void Move ( const MbVector3D &, MbRegTransform * ireg = c3d_null ); // \ru Сдвиг. \en Translation. - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * ireg = c3d_null ); // \ru Повернуть вокруг оси. \en Rotate around an axis. - virtual MbCreator & Duplicate( MbRegDuplicate * = c3d_null ) const ; // \ru Сделать копию \en Create a copy + virtual void Transform( const MbMatrix3D &, MbRegTransform * ireg = nullptr ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. + virtual void Move ( const MbVector3D &, MbRegTransform * ireg = nullptr ); // \ru Сдвиг. \en Translation. + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * ireg = nullptr ); // \ru Повернуть вокруг оси. \en Rotate around an axis. + virtual MbCreator & Duplicate( MbRegDuplicate * = nullptr ) const ; // \ru Сделать копию \en Create a copy virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта \en Get a name of object property. virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта. \en Get properties of the object. @@ -90,7 +90,7 @@ public : // \ru Общие функции твердого тела. \en Common functions of solid. virtual bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell, - RPArray * items = c3d_null ); // \ru Построение \en Construction + RPArray * items = nullptr ); // \ru Построение \en Construction virtual void SetYourVersion( VERSION version, bool forAll ); @@ -107,7 +107,7 @@ public: /// \ru Общее количество строителей. \en Total count of creators. size_t GetCreatorsCount() const { return creators.size(); } /// \ru Дать строитель. \en Get the creator. - const MbCreator * GetCreator( size_t k ) const { return ( (k < creators.size()) ? creators[k] : c3d_null ); } + const MbCreator * GetCreator( size_t k ) const { return ( (k < creators.size()) ? creators[k] : nullptr ); } /// \ru Удалить из журнала строители первого тела. \en Delete first-solid creators from the history tree. bool DeleteFirstCreators(); private : diff --git a/C3d/Include/cr_chamfer_solid.h b/C3d/Include/cr_chamfer_solid.h index f311a8b..7a1e6b6 100644 --- a/C3d/Include/cr_chamfer_solid.h +++ b/C3d/Include/cr_chamfer_solid.h @@ -39,7 +39,7 @@ public : // \ru Общие функции математического объекта \en Common functions of the mathematical object virtual MbeCreatorType IsA() const; // \ru Тип элемента \en A type of element - virtual MbCreator & Duplicate( MbRegDuplicate * = c3d_null ) const ; // \ru Сделать копию \en Create a copy + virtual MbCreator & Duplicate( MbRegDuplicate * = nullptr ) const ; // \ru Сделать копию \en Create a copy virtual void GetProperties( MbProperties &properties ); // \ru Выдать свойства объекта \en Get properties of the object virtual void SetProperties( const MbProperties &properties ); // \ru Записать свойства объекта \en Set properties of the object @@ -51,7 +51,7 @@ public : // \ru Общие функции твердого тела \en Common functions of solid virtual bool CreateShell( MbFaceShell *&shell, MbeCopyMode sameShell, - RPArray * items = c3d_null ); // \ru Построение \en Construction + RPArray * items = nullptr ); // \ru Построение \en Construction private : virtual void ReadDistances ( reader &in ); diff --git a/C3d/Include/cr_connecting_curve.h b/C3d/Include/cr_connecting_curve.h index 78d432c..86fe02b 100644 --- a/C3d/Include/cr_connecting_curve.h +++ b/C3d/Include/cr_connecting_curve.h @@ -62,15 +62,15 @@ public : // \ru Общие функции строителя \en The common functions of the creator virtual MbeCreatorType IsA() const; // \ru Тип элемента \en A type of element - virtual MbCreator & Duplicate( MbRegDuplicate * iReg = c3d_null ) const; // \ru Сделать копию \en Create a copy + virtual MbCreator & Duplicate( MbRegDuplicate * iReg = nullptr ) const; // \ru Сделать копию \en Create a copy virtual bool IsSame ( const MbCreator &, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal? virtual bool IsSimilar( const MbCreator & ) const; // \ru Являются ли объекты подобными \en Whether the objects are similar virtual bool SetEqual ( const MbCreator & ); // \ru Сделать равным \en Make equal - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate about an axis + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate about an axis virtual MbePrompt GetPropertyName(); // \ru Дать имя свойства объекта \en Get the object property name virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта \en Get properties of the object @@ -80,7 +80,7 @@ public : virtual void SetBasisPoints( const MbControlData3D & ); // \ru Изменить объект по контрольным точкам. \en Change the object by control points. // \ru Построить кривую по журналу построения \en Create a curve from the history tree - virtual bool CreateSpaceCurve( MbWireFrame *&, MbeCopyMode, RPArray * items = c3d_null ); + bool CreateWireFrame( MbWireFrame *&, MbeCopyMode, RPArray * items = nullptr ) override; /** \} */ @@ -115,8 +115,10 @@ IMPL_PERSISTENT_OPS( MbConnectingCurveCreator ) \en An object defining the edges names. \~ \param[out] res - \ru Код результата операции. \en Operation result code. \~ - \param[out] surface - \ru Поверхность, которая будет создана и на которой базируется соединительная кривая, (может быть возращён c3d_null). - \en A surface on which the fillet curve is based on, it will be created by the method (can be c3d_null). \~ + \param[out] surface - \ru Поверхность, которая будет создана и на которой базируется соединительная кривая, (может быть возращён nullptr). + \en A surface on which the fillet curve is based on, it will be created by the method (can be nullptr). \~ + \param[out] edge - \ru Построенная кривая сопряжения. + \en The constructed conjugation edge. \~ \result \ru Возвращает строитель. \en Returns the constructor. \~ \ingroup Curve3D_Modeling @@ -142,6 +144,8 @@ MATH_FUNC (MbCreator *) CreateFilletEdge( const MbCurve3D & curve1, double & t1, \en Curve 1. \~ \param[in] curve2 - \ru Кривая 2. \en Curve 2. \~ + \param[out] edge - \ru Построенная кривая сопряжения. + \en The constructed conjugation edge. \~ \result \ru Возвращает строитель. \en Returns the constructor. \~ \ingroup Curve3D_Modeling @@ -164,6 +168,8 @@ MATH_FUNC (MbCreator *) CreateSplineEdge( const MbCurve3D & curve1, double t1, M \en Curve 1. \~ \param[in] curve2 - \ru Кривая 2. \en Curve 2. \~ + \param[out] edge - \ru Построенная кривая сопряжения. + \en The constructed conjugation edge. \~ \result \ru Возвращает строитель. \en Returns the constructor. \~ \ingroup Curve3D_Modeling @@ -177,14 +183,16 @@ MATH_FUNC (MbCreator *) CreateConnectingEdge( const MbCurve3D & curve1, bool isB //------------------------------------------------------------------------------ -/** \brief \ru Cоздание строителя сопряжения двух кривых кубическим сплайном Эрмита (кривой-мостиком). +/** \brief \ru Создание строителя сопряжения двух кривых кубическим сплайном Эрмита (кривой-мостиком). \en Create a constructor of two curves conjugation by a cubic Hermite spline (transition curve). \~ - \details \ru Cоздание строителя сопряжения двух кривых кубическим сплайном Эрмита (кривой-мостиком).\n + \details \ru Создание строителя сопряжения двух кривых кубическим сплайном Эрмита (кривой-мостиком).\n \en Create a constructor of two curves conjugation by a cubic Hermite spline (transition curve).\n \~ \param[in] curve1 - \ru Кривая 1. \en Curve 1. \~ \param[in] curve2 - \ru Кривая 2. \en Curve 2. \~ + \param[out] edge - \ru Построенная кривая сопряжения. + \en The constructed conjugation edge. \~ \result \ru Возвращает строитель. \en Returns the constructor. \~ \ingroup Curve3D_Modeling @@ -194,7 +202,7 @@ MATH_FUNC (MbCreator *) CreateBridgeEdge( const MbCurve3D & curve1, double t1, b const MbCurve3D & curve2, double t2, bool sense2, const MbSNameMaker & names, MbResultType & res, - MbEdge *& edge ); + MbEdge *& edge ); #endif // __CR_CONNECTING_CURVE_H \ No newline at end of file diff --git a/C3d/Include/cr_cutting_solid.h b/C3d/Include/cr_cutting_solid.h index 02af35a..4acf7aa 100644 --- a/C3d/Include/cr_cutting_solid.h +++ b/C3d/Include/cr_cutting_solid.h @@ -66,10 +66,10 @@ public : // \ru Общие функции математического объекта \en Common functions of the mathematical object virtual MbeCreatorType IsA() const; // \ru Тип элемента \en A type of element - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate around an axis - virtual MbCreator & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию \en Create a copy + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate around an axis + virtual MbCreator & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию \en Create a copy virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта \en Get a name of object property virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта \en Get properties of the object @@ -85,7 +85,7 @@ public : // \ru Общие функции твердого тела \en Common functions of solid virtual bool CreateShell( MbFaceShell *&, MbeCopyMode sameShell, - RPArray * = c3d_null ); // \ru Построение \en Construction + RPArray * = nullptr ); // \ru Построение \en Construction // \ru Оставляемая часть (если part больше 0, то оставляем часть тела со стороны нормали поверхности). \en A part to be kept (if part is bigger than 0, then keep a part of solid from the side of surface normal). ThreeStates GetPart() const { return part; } diff --git a/C3d/Include/cr_detach_solid.h b/C3d/Include/cr_detach_solid.h index c61ebd2..6fc792f 100644 --- a/C3d/Include/cr_detach_solid.h +++ b/C3d/Include/cr_detach_solid.h @@ -42,10 +42,10 @@ public : \en \name Common functions of the mathematical object. \{ */ virtual MbeCreatorType IsA() const; // \ru Тип элемента \en Type of element - virtual MbCreator & Duplicate( MbRegDuplicate * = c3d_null ) const ; // \ru Сделать копию \en Create a copy - virtual void Transform( const MbMatrix3D & matr, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move( const MbVector3D & to, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate( const MbAxis3D & axis, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate about an axis + virtual MbCreator & Duplicate( MbRegDuplicate * = nullptr ) const ; // \ru Сделать копию \en Create a copy + virtual void Transform( const MbMatrix3D & matr, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move( const MbVector3D & to, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate( const MbAxis3D & axis, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate about an axis virtual void GetProperties( MbProperties & properties ); // \ru Выдать свойства объекта \en Get properties of the object virtual void SetProperties( const MbProperties & properties ); // \ru Записать свойства объекта \en Set properties of the object @@ -56,7 +56,7 @@ public : virtual bool SetEqual ( const MbCreator & ); // \ru Сделать равным. \en Make equal. virtual bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell, - RPArray * items = c3d_null ); // \ru Построение \en Construction + RPArray * items = nullptr ); // \ru Построение \en Construction /** \} */ /** \ru \name Функции строителя, разделяющие отдельные части оболочки. \en \name Functions of the creator subdividing separate parts of the shell. @@ -183,7 +183,7 @@ MbCreator * CreateDetach( MbFaceShell & solid, MbResultType & res ) { res = rt_Error; - MbCreator * result = c3d_null; + MbCreator * result = nullptr; ::MakeDetachShells( solid, partSolid, sort ); diff --git a/C3d/Include/cr_displace_creator.h b/C3d/Include/cr_displace_creator.h index ad4cf1f..8948356 100644 --- a/C3d/Include/cr_displace_creator.h +++ b/C3d/Include/cr_displace_creator.h @@ -42,12 +42,12 @@ public: // \ru Деструктор \en Destructor public: // \ru Общие функции математического объекта \en Common functions of the mathematical object virtual MbeCreatorType IsA() const; // \ru Тип элемента \en A type of element virtual MbeCreatorType Type() const; // \ru Получить групповой тип объекта. \en Get the group type of the object. - virtual MbCreator & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию \en Create a copy + virtual MbCreator & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию \en Create a copy virtual bool IsSame( const MbCreator & other, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal? virtual bool SetEqual ( const MbCreator & ); // \ru Сделать равным \en Make equal - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать по матрице \en Transform according to the matrix - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг по вектору \en Translation by a vector - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate around an axis + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать по матрице \en Transform according to the matrix + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг по вектору \en Translation by a vector + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate around an axis virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта \en Get a name of object property virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта \en Get properties of the object @@ -55,13 +55,13 @@ public: // \ru Общие функции математического объе /// \ru Построение оболочки \en Creation of a shell. virtual bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell, - RPArray * items = c3d_null ); + RPArray * items = nullptr ); /// \ru Построение каркаса кривых. \en Creation of a wire-frame. virtual bool CreateWireFrame( MbWireFrame *& frame, MbeCopyMode sameShell, - RPArray * items = c3d_null ); + RPArray * items = nullptr ); /// \ru Построение каркаса точек. \en Creation of a point-frame. virtual bool CreatePointFrame( MbPointFrame *& frame, MbeCopyMode sameShell, - RPArray * items = c3d_null ); + RPArray * items = nullptr ); /// \ru Переместить строитель. \en Displace the creator. virtual bool Perform( MbCreator * ) const; @@ -110,12 +110,12 @@ public: // \ru Деструктор \en Destructor public: // \ru Общие функции математического объекта \en Common functions of the mathematical object virtual MbeCreatorType IsA() const; // \ru Тип элемента \en A type of element virtual MbeCreatorType Type() const; // \ru Получить групповой тип объекта. \en Get the group type of the object. - virtual MbCreator & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию \en Create a copy + virtual MbCreator & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию \en Create a copy virtual bool IsSame( const MbCreator & other, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal? virtual bool SetEqual ( const MbCreator & ); // \ru Сделать равным \en Make equal - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать по матрице \en Transform according to the matrix - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг по вектору \en Translation by a vector - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate around an axis + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать по матрице \en Transform according to the matrix + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг по вектору \en Translation by a vector + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate around an axis virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта \en Get a name of object property virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта \en Get properties of the object @@ -123,13 +123,13 @@ public: // \ru Общие функции математического объе /// \ru Построение оболочки \en Creation of a shell. virtual bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell, - RPArray * items = c3d_null ); + RPArray * items = nullptr ); /// \ru Построение каркаса кривых. \en Creation of a wire-frame. virtual bool CreateWireFrame( MbWireFrame *& frame, MbeCopyMode sameShell, - RPArray * items = c3d_null ); + RPArray * items = nullptr ); /// \ru Построение каркаса точек. \en Creation of a point-frame. virtual bool CreatePointFrame( MbPointFrame *& frame, MbeCopyMode sameShell, - RPArray * items = c3d_null ); + RPArray * items = nullptr ); /// \ru Переместить строитель. \en Displace the creator. virtual bool Perform( MbCreator * ) const; @@ -177,12 +177,12 @@ public: // \ru Деструктор \en Destructor public: // \ru Общие функции математического объекта \en Common functions of the mathematical object virtual MbeCreatorType IsA() const; // \ru Тип элемента \en A type of element virtual MbeCreatorType Type() const; // \ru Получить групповой тип объекта. \en Get the group type of the object. - virtual MbCreator & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию \en Create a copy + virtual MbCreator & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию \en Create a copy virtual bool IsSame( const MbCreator & other, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal? virtual bool SetEqual ( const MbCreator & ); // \ru Сделать равным \en Make equal - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать по матрице \en Transform according to the matrix - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг по вектору \en Translation by a vector - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate around an axis + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать по матрице \en Transform according to the matrix + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг по вектору \en Translation by a vector + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate around an axis virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта \en Get a name of object property virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта \en Get properties of the object @@ -190,13 +190,13 @@ public: // \ru Общие функции математического объе /// \ru Построение оболочки \en Creation of a shell. virtual bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell, - RPArray * items = c3d_null ); + RPArray * items = nullptr ); /// \ru Построение каркаса кривых. \en Creation of a wire-frame. virtual bool CreateWireFrame( MbWireFrame *& frame, MbeCopyMode sameShell, - RPArray * items = c3d_null ); + RPArray * items = nullptr ); /// \ru Построение каркаса точек. \en Creation of a point-frame. virtual bool CreatePointFrame( MbPointFrame *& frame, MbeCopyMode sameShell, - RPArray * items = c3d_null ); + RPArray * items = nullptr ); /// \ru Переместить строитель. \en Displace the creator. virtual bool Perform( MbCreator * ) const; diff --git a/C3d/Include/cr_draft_solid.h b/C3d/Include/cr_draft_solid.h index b7c916b..7868991 100644 --- a/C3d/Include/cr_draft_solid.h +++ b/C3d/Include/cr_draft_solid.h @@ -47,7 +47,7 @@ public: , fp ( faceProp ) , np ( new MbPlacement3D( nPlace ) ) , edgeNb ( -1 ) - , pl ( c3d_null ) + , pl ( nullptr ) , reverse ( rev ) , step ( false ) { @@ -65,7 +65,7 @@ public: , angle ( ang ) , faceIndices( ) , fp ( faceProp ) - , np ( nPlace ? new MbPlacement3D( *nPlace ) : c3d_null ) + , np ( nPlace ? new MbPlacement3D( *nPlace ) : nullptr ) , edgeNb ( edgeInd ) , pl ( new SArray( partLines ) ) , reverse ( rev ) @@ -82,10 +82,10 @@ public : // \ru Общие функции математического объекта \en Common functions of the mathematical object virtual MbeCreatorType IsA() const; // \ru Тип элемента \en A type of element - virtual MbCreator & Duplicate( MbRegDuplicate * = c3d_null ) const; - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate around an axis + virtual MbCreator & Duplicate( MbRegDuplicate * = nullptr ) const; + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate around an axis virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта \en Get properties of the object virtual void SetProperties( const MbProperties & ); // \ru Записать свойства объекта \en Set properties of the object @@ -98,7 +98,7 @@ public : // \ru Общие функции твердого тела \en Common functions of solid virtual bool CreateShell( MbFaceShell *&, MbeCopyMode sameShell, - RPArray * = c3d_null ); // \ru Построение \en Construction + RPArray * = nullptr ); // \ru Построение \en Construction private : // \ru Объявление оператора присваивания без реализации, чтобы не было присваивания по умолчанию. \en The declaration of the assignment operator without implementation to prevent an assignment by default. diff --git a/C3d/Include/cr_duplication_solid.h b/C3d/Include/cr_duplication_solid.h index 03636fe..039d6f7 100644 --- a/C3d/Include/cr_duplication_solid.h +++ b/C3d/Include/cr_duplication_solid.h @@ -46,10 +46,10 @@ public: \{ */ /// \ru Получить регистрационный тип (для копирования, дублирования). \en Get the registration type (for copying, duplication). virtual MbeCreatorType IsA() const; - virtual MbCreator & Duplicate( MbRegDuplicate * = c3d_null ) const ; // \ru сделать копию \en create a copy - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate about an axis + virtual MbCreator & Duplicate( MbRegDuplicate * = nullptr ) const ; // \ru сделать копию \en create a copy + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate about an axis virtual void GetProperties( MbProperties & ); // \ru выдать свойства объекта \en get properties of the object virtual void SetProperties( const MbProperties & ); // \ru записать свойства объекта \en set properties of the object @@ -60,7 +60,7 @@ public: virtual bool SetEqual ( const MbCreator & ); // \ru сделать равным \en make equal virtual bool CreateShell( MbFaceShell *&, MbeCopyMode sameShell, - RPArray * items = c3d_null ); // \ru Построение \en Construction + RPArray * items = nullptr ); // \ru Построение \en Construction /** \} */ private : diff --git a/C3d/Include/cr_elementary_solid.h b/C3d/Include/cr_elementary_solid.h index f68766b..fb72164 100644 --- a/C3d/Include/cr_elementary_solid.h +++ b/C3d/Include/cr_elementary_solid.h @@ -111,10 +111,10 @@ public : \en \name Common functions of the shell creator. \{ */ virtual MbeCreatorType IsA() const; // \ru Тип элемента \en Type of element - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate about an axis - virtual MbCreator & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию \en Create a copy + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate about an axis + virtual MbCreator & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию \en Create a copy virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта \en Get a name of object property virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта \en Get properties of the object @@ -128,7 +128,7 @@ public : virtual bool SetEqual( const MbCreator & ); // \ru Сделать равным \en Make equal virtual bool CreateShell( MbFaceShell *&, MbeCopyMode sameShell, - RPArray * = c3d_null ); // \ru Построение \en Construction + RPArray * = nullptr ); // \ru Построение \en Construction /** \} */ private: diff --git a/C3d/Include/cr_evolution_solid.h b/C3d/Include/cr_evolution_solid.h index f2e211a..13976c9 100644 --- a/C3d/Include/cr_evolution_solid.h +++ b/C3d/Include/cr_evolution_solid.h @@ -27,7 +27,7 @@ class MATH_CLASS MbCurveEvolutionSolid : public MbCurveSweptSolid { protected : MbSweptData sweptData; ///< \ru Данные об образующей. \en Generating curve data. SPtr spineCurve; ///< \ru Направляющая кривая. \en Spine curve. - SPtr directionCurve; ///< \ru Кривая вектора ориентации матрицы преобразования (может быть c3d_null для простой траектории). \en A curve of the transformation matrix orientation (it may be c3d_null for a simple trajectory). + SPtr directionCurve; ///< \ru Кривая вектора ориентации матрицы преобразования (может быть nullptr для простой траектории). \en A curve of the transformation matrix orientation (it may be nullptr for a simple trajectory). MbVector3D direction; ///< \ru Вектор ориентации матрицы преобразования (может быть нулевой, в случае автоопределения). \en Vector of transformation matrix orientation (it's equal zero in the mode of automatic direction calculation). SPtr spineNames; ///< \ru Именователь направляющей. \en An object defining the name of the spine curve. EvolutionValues parameters; ///< \ru Параметры. \en Parameters. @@ -128,10 +128,10 @@ public : \en \name Common functions of the mathematical object. \{ */ virtual MbeCreatorType IsA() const; // \ru Тип элемента \en A type of element - virtual MbCreator & Duplicate( MbRegDuplicate * = c3d_null ) const ; // \ru Сделать копию \en Create a copy - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate around an axis + virtual MbCreator & Duplicate( MbRegDuplicate * = nullptr ) const ; // \ru Сделать копию \en Create a copy + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate around an axis virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта \en Get properties of the object virtual void SetProperties( const MbProperties & ); // \ru Записать свойства объекта \en Set properties of the object diff --git a/C3d/Include/cr_extending_curve.h b/C3d/Include/cr_extending_curve.h new file mode 100644 index 0000000..2acf7e3 --- /dev/null +++ b/C3d/Include/cr_extending_curve.h @@ -0,0 +1,103 @@ +//////////////////////////////////////////////////////////////////////////////// +/** + \file + \brief \ru Строитель продления кривой. + \en Constructor of curve extension. +*/ +//////////////////////////////////////////////////////////////////////////////// + +#ifndef __CR_EXTENDING_CURVE_H +#define __CR_EXTENDING_CURVE_H + + +#include +#include + +//------------------------------------------------------------------------------ +/** \brief \ru Строитель продления кривой. + \en Constructor of curve extension. \~ + \details \ru Строитель продления кривой. + \en Constructor of curve extension. \~ + \ingroup Model_Creators + \warning \ru В разработке. + \en Under development. \~ +*/ +// --- +class MATH_CLASS MbExtendCurveCreator : public MbCreator +{ +private: + SPtr sourceCurve; // \ru Исходная (расширяемая) кривая. Всегда не ноль. \en Source (extended) curve. It is not nullptr. \~ + MbCurveExtensionParameters parameters; // \ru Параметры продления. \en Extension parameters. \~ + +protected: + /// \ru Конструктор копирования. \en Copy-constructor. + MbExtendCurveCreator( const MbExtendCurveCreator &, MbRegDuplicate * iReg ); +private: + MbExtendCurveCreator( const MbExtendCurveCreator & ); // \ru Не реализовано \en Not implemented + MbExtendCurveCreator(); // \ru Не реализовано. \en Not implemented. + +public: + /// \ru Конструктор по параметрам. \en Constructor by parameters. + MbExtendCurveCreator( const MbCurve3D & curve, const MbCurveExtensionParameters & extendParams, const MbSNameMaker & nm ); + + /// \ru Деструктор. \en Destructor. + ~MbExtendCurveCreator() override; + + // \ru Общие функции строителя. \en The common functions of the creator. + MbeCreatorType IsA() const override { return ct_ExtensionCurveCreator; }; // \ru Тип элемента. \en A type of element. + MbCreator & Duplicate( MbRegDuplicate * iReg = nullptr ) const override; // \ru Сделать копию. \en Create a copy. + + bool IsSame( const MbCreator &, double accuracy ) const override; // \ru Являются ли объекты равными? \en Determine whether an object is equal? + bool IsSimilar( const MbCreator & ) const override; // \ru Являются ли объекты подобными? \en Whether the objects are similar? + bool SetEqual( const MbCreator & ) override; // \ru Сделать равным. \en Make equal. + + void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ) override; // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. + void Move( const MbVector3D &, MbRegTransform * = nullptr ) override; // \ru Сдвиг. \en Translation. + void Rotate( const MbAxis3D &, double angle, MbRegTransform * = nullptr ) override; // \ru Повернуть вокруг оси. \en Rotate about the axis. + + MbePrompt GetPropertyName() override; // \ru Дать имя свойства объекта. \en Get the object property name. + void GetProperties( MbProperties & ) override; // \ru Выдать свойства объекта. \en Get properties of the object. + void SetProperties( const MbProperties & ) override; // \ru Записать свойства объекта. \en Set properties of the object. + + /** \} */ + + bool CreateWireFrame( MbWireFrame *&, MbeCopyMode, RPArray * ) override; // \ru Построить кривую по журналу построения. \en Create a curve from the history tree. \~ + +private: + // \ru Объявление оператора присваивания без реализации, чтобы не было присваивания по умолчанию. \en The declaration of the assignment operator without implementation, to prevent an assignment by default. + void operator = ( const MbExtendCurveCreator & ); + + DECLARE_PERSISTENT_CLASS_NEW_DEL( MbExtendCurveCreator ) +}; + +IMPL_PERSISTENT_OPS( MbExtendCurveCreator ) + +//------------------------------------------------------------------------------ +/** \brief \ru Создание строителя продления кривой. + \en Create a constructor of extending curve. \~ + \details \ru Создание строителя продления кривой.\n + \en Create a constructor of extending curve.\n \~ + \param[in] sourceCurve - \ru Исходная (удлиняемая) кривая. + \en Source (extended) curve. \~ + \param[in] parameters - \ru Параметры удлинения. + \en Parameters of extension. \~ + \param[in] names - \ru Именователь построенного ребра. + \en An object defining the edges names. \~ + \param[out] res - \ru Код результата операции. + \en Operation result code. \~ + \param[out] resCurve - \ru Возвращаемая (удлиненная) кривая. Может быть nullptr. + \en The curve returned (extended). Can be nullptr. \~ + \result \ru Возвращает строитель. + \en Returns the constructor. \~ + \ingroup Curve3D_Modeling + \warning \ru В разработке. + \en Under development. \~ +*/ +// --- +MATH_FUNC (MbCreator *) CreateExtendedCurve( const MbCurve3D & sourceCurve, + const MbCurveExtensionParameters & parameters, + const MbSNameMaker & names, + MbResultType & res, + MbCurve3D *& resCurve ); + +#endif // __CR_EXTENDING_CURVE_H \ No newline at end of file diff --git a/C3d/Include/cr_extension_shell.h b/C3d/Include/cr_extension_shell.h index bf2a62c..7fe8c42 100644 --- a/C3d/Include/cr_extension_shell.h +++ b/C3d/Include/cr_extension_shell.h @@ -46,10 +46,10 @@ public : // \ru Общие функции математического объекта \en Common functions of the mathematical object virtual MbeCreatorType IsA() const; // \ru Тип элемента \en Type of element - virtual MbCreator & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию \en Create a copy - virtual void Transform( const MbMatrix3D & matr, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move( const MbVector3D & to, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate( const MbAxis3D & axis, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate about an axis + virtual MbCreator & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию \en Create a copy + virtual void Transform( const MbMatrix3D & matr, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move( const MbVector3D & to, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate( const MbAxis3D & axis, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate about an axis virtual void GetProperties( MbProperties & properties ); // \ru Выдать свойства объекта \en Get properties of the object virtual void SetProperties( const MbProperties & properties ); // \ru Записать свойства объекта \en Set properties of the object @@ -62,7 +62,7 @@ public : // \ru Общие функции твердого тела \en Common functions of solid solid virtual bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell, - RPArray * items = c3d_null ); // \ru Построение \en Construction + RPArray * items = nullptr ); // \ru Построение \en Construction // \ru Дать параметры. \en Get the parameters. void GetParameters( ExtensionValues & params ) const { params = parameters; } diff --git a/C3d/Include/cr_extrusion_solid.h b/C3d/Include/cr_extrusion_solid.h index 93e122d..8aa896f 100644 --- a/C3d/Include/cr_extrusion_solid.h +++ b/C3d/Include/cr_extrusion_solid.h @@ -59,7 +59,7 @@ public : OperationType oType, const MbSNameMaker & operNames, const RPArray & contoursNames, - const c3d::CreatorsSPtrVector * creators = c3d_null, + const c3d::CreatorsSPtrVector * creators = nullptr, bool sameCreators = true ); private : @@ -73,10 +73,10 @@ public : \en \name Common functions of the mathematical object. \{ */ virtual MbeCreatorType IsA() const; // \ru Тип элемента. \en A type of element. - virtual MbCreator & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Cделать копию. \en Make a copy. - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. - virtual void Move( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг. \en Move. - virtual void Rotate( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси. \en Rotate around an axis. + virtual MbCreator & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Cделать копию. \en Make a copy. + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. + virtual void Move( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг. \en Move. + virtual void Rotate( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси. \en Rotate around an axis. virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта. \en Get properties of the object. virtual void SetProperties( const MbProperties & ); // \ru Записать свойства объекта. \en Set properties of the object. @@ -94,7 +94,7 @@ public : \en \name Common functions of the rigid solid (forming operations). \{ */ virtual bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell, - RPArray * items = c3d_null ); // \ru Построение. \en Construction. + RPArray * items = nullptr ); // \ru Построение. \en Construction. virtual MbFaceShell * InitShell( bool in ); virtual void InitBasis( RPArray & items ); diff --git a/C3d/Include/cr_fillet_solid.h b/C3d/Include/cr_fillet_solid.h index 1bea799..a29bcbb 100644 --- a/C3d/Include/cr_fillet_solid.h +++ b/C3d/Include/cr_fillet_solid.h @@ -60,10 +60,10 @@ public : // \ru Общие функции математического объекта. \en Common functions of the mathematical object. virtual MbeCreatorType IsA() const; // \ru Тип элемента. \en A type of element. - virtual MbCreator & Duplicate( MbRegDuplicate * = c3d_null ) const ; // \ru Сделать копию \en Create a copy - virtual void Transform( const MbMatrix3D &matr, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move( const MbVector3D &to, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate( const MbAxis3D &axis, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate around an axis + virtual MbCreator & Duplicate( MbRegDuplicate * = nullptr ) const ; // \ru Сделать копию \en Create a copy + virtual void Transform( const MbMatrix3D &matr, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move( const MbVector3D &to, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate( const MbAxis3D &axis, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate around an axis virtual void GetProperties( MbProperties & properties ); // \ru Выдать свойства объекта. \en Get properties of the object. virtual void SetProperties( const MbProperties & properties ); // \ru Записать свойства объекта. \en Set properties of the object. @@ -76,7 +76,7 @@ public : // \ru Общие функции твердого тела \en Common functions of solid virtual bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell, - RPArray * items = c3d_null ); // \ru Построение \en Construction + RPArray * items = nullptr ); // \ru Построение \en Construction private : virtual void ReadDistances ( reader &in ); diff --git a/C3d/Include/cr_hole_solid.h b/C3d/Include/cr_hole_solid.h index 66aa257..1216b4f 100644 --- a/C3d/Include/cr_hole_solid.h +++ b/C3d/Include/cr_hole_solid.h @@ -69,10 +69,10 @@ public : // \ru Переопределение функций базового класса \en The base class functions override virtual MbeCreatorType IsA() const; // \ru Тип элемента \en A type of element - virtual MbCreator & Duplicate( MbRegDuplicate * = c3d_null ) const ; // \ru Сделать копию \en Create a copy - virtual void Transform( const MbMatrix3D & matr, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move( const MbVector3D & to, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate( const MbAxis3D & axis, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate around an axis + virtual MbCreator & Duplicate( MbRegDuplicate * = nullptr ) const ; // \ru Сделать копию \en Create a copy + virtual void Transform( const MbMatrix3D & matr, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move( const MbVector3D & to, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate( const MbAxis3D & axis, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate around an axis virtual void GetProperties( MbProperties & properties ); // \ru Выдать свойства объекта \en Get properties of the object virtual void SetProperties( const MbProperties & properties ); // \ru Записать свойства объекта \en Set properties of the object @@ -88,7 +88,7 @@ public : // \ru Общие функции твердого тела \en Common functions of solid virtual bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell, - RPArray * items = c3d_null ); // \ru Построение \en Construction + RPArray * items = nullptr ); // \ru Построение \en Construction virtual MbFaceShell * InitShell( bool in ); virtual void InitBasis( RPArray & items ); diff --git a/C3d/Include/cr_intersection_curve.h b/C3d/Include/cr_intersection_curve.h index ca58b4b..30c6dd9 100644 --- a/C3d/Include/cr_intersection_curve.h +++ b/C3d/Include/cr_intersection_curve.h @@ -45,15 +45,15 @@ public: // \ru Общие функции строителя. \en The common functions of the creator. virtual MbeCreatorType IsA() const; // \ru Тип элемента \en A type of element - virtual MbCreator & Duplicate( MbRegDuplicate * iReg = c3d_null ) const; // \ru Сделать копию \en Create a copy + virtual MbCreator & Duplicate( MbRegDuplicate * iReg = nullptr ) const; // \ru Сделать копию \en Create a copy virtual bool IsSame ( const MbCreator &, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal? virtual bool IsSimilar( const MbCreator & ) const; // \ru Являются ли объекты подобными \en Whether the objects are similar virtual bool SetEqual ( const MbCreator & ); // \ru Сделать равным \en Make equal - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate about an axis + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate about an axis virtual MbePrompt GetPropertyName(); // \ru Дать имя свойства объекта \en Get the object property name virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта \en Get properties of the object @@ -63,7 +63,7 @@ public: virtual void SetBasisPoints( const MbControlData3D & ); // \ru Изменить объект по контрольным точкам. \en Change the object by control points. // \ru Построить кривую по журналу построения \en Create a curve from the history tree - virtual bool CreateWireFrame( MbWireFrame *&, MbeCopyMode, RPArray * items = c3d_null ); + virtual bool CreateWireFrame( MbWireFrame *&, MbeCopyMode, RPArray * items = nullptr ); /** \} */ diff --git a/C3d/Include/cr_join_shell.h b/C3d/Include/cr_join_shell.h index 8058e1e..cd10433 100644 --- a/C3d/Include/cr_join_shell.h +++ b/C3d/Include/cr_join_shell.h @@ -39,10 +39,10 @@ public : // \ru Общие функции математического объекта \en Common functions of the mathematical object virtual MbeCreatorType IsA () const; ///< \ru Тип элемента \en Element type - virtual MbCreator & Duplicate( MbRegDuplicate * = c3d_null ) const; ///< \ru Сделать копию \en Make a copy - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); ///< \ru Преобразовать элемент согласно матрице \en Transform an element according to the matrix - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); ///< \ru Сдвиг \en Translation - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); ///< \ru Поворот вокруг оси \en Rotation about an axis + virtual MbCreator & Duplicate( MbRegDuplicate * = nullptr ) const; ///< \ru Сделать копию \en Make a copy + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); ///< \ru Преобразовать элемент согласно матрице \en Transform an element according to the matrix + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); ///< \ru Сдвиг \en Translation + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); ///< \ru Поворот вокруг оси \en Rotation about an axis virtual bool IsSame( const MbCreator &, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal? virtual bool IsSimilar( const MbCreator & ) const; // \ru Являются ли объекты подобными. \en Whether the objects are similar @@ -58,7 +58,7 @@ public : // \ru Общие функции твердого тела \en Common functions of solid solid virtual bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell, - RPArray * items = c3d_null ); ///< \ru Построение \en Construction + RPArray * items = nullptr ); ///< \ru Построение \en Construction // \ru Дать параметры. \en Get the parameters. diff --git a/C3d/Include/cr_lofted_solid.h b/C3d/Include/cr_lofted_solid.h index 52e35be..30ccfe1 100644 --- a/C3d/Include/cr_lofted_solid.h +++ b/C3d/Include/cr_lofted_solid.h @@ -29,7 +29,7 @@ protected : RPArray curves; ///< \ru Плоские сечения. \en Plane sections. SPtr spine; ///< \ru Осевая линия (может отсутствовать). \en Spine curve (can be absent). LoftedValues parameters; ///< \ru Параметры. \en Parameters. - RPArray * guideCurves; ///< \ru Массив направляющих кривых (может быть c3d_null). \en An array of guide curves (can be c3d_null). + RPArray * guideCurves; ///< \ru Массив направляющих кривых (может быть nullptr). \en An array of guide curves (can be nullptr). SArray * userPnts; ///< \ru Пользовательские точки на сечениях. \en Custom points on the sections. public: @@ -64,10 +64,10 @@ public : // \ru Общие функции математического объекта \en Common functions of the mathematical object virtual MbeCreatorType IsA() const; // \ru Тип элемента \en A type of element - virtual MbCreator & Duplicate( MbRegDuplicate * = c3d_null ) const ; // \ru Сделать копию \en Create a copy - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать \en Transform - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate around an axis + virtual MbCreator & Duplicate( MbRegDuplicate * = nullptr ) const ; // \ru Сделать копию \en Create a copy + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать \en Transform + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate around an axis virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта \en Get properties of the object virtual void SetProperties( const MbProperties & ); // \ru Записать свойства объекта \en Set properties of the object diff --git a/C3d/Include/cr_median_shell.h b/C3d/Include/cr_median_shell.h index 4c4105d..031f713 100644 --- a/C3d/Include/cr_median_shell.h +++ b/C3d/Include/cr_median_shell.h @@ -48,13 +48,13 @@ private: public: virtual MbeCreatorType IsA() const; // \ru Тип элемента \en Type of element - virtual MbCreator & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию \en Create a copy + virtual MbCreator & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию \en Create a copy virtual bool IsSame( const MbCreator &, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal? virtual bool IsSimilar( const MbCreator & ) const; // \ru Являются ли объекты подобными \en Whether the objects are similar virtual bool SetEqual ( const MbCreator & ); // \ru Сделать равным \en Make equal - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate about an axis + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate about an axis virtual void GetProperties( MbProperties & properties ); // \ru Выдать свойства объекта \en Get properties of the object virtual void SetProperties( const MbProperties & properties ); // \ru Записать свойства объекта \en Set properties of the object @@ -62,7 +62,7 @@ public: // \ru Построение оболочки по исходным данным \en Construction of a shell from the given data virtual bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell, - RPArray * items = c3d_null ); + RPArray * items = nullptr ); /// \ru Дать параметры. \en Get the parameters. void GetParameters( MedianShellValues & params ) const { params = parameters; } diff --git a/C3d/Include/cr_mesh_shell.h b/C3d/Include/cr_mesh_shell.h index d0097ca..c17f67d 100644 --- a/C3d/Include/cr_mesh_shell.h +++ b/C3d/Include/cr_mesh_shell.h @@ -42,12 +42,12 @@ public: public: // \ru Общие функции математического объекта \en Common functions of the mathematical object virtual MbeCreatorType IsA() const; ///< \ru Тип элемента \en Element type - virtual MbCreator & Duplicate( MbRegDuplicate * = c3d_null ) const; ///< \ru Сделать копию \en Make a copy + virtual MbCreator & Duplicate( MbRegDuplicate * = nullptr ) const; ///< \ru Сделать копию \en Make a copy virtual bool IsSame( const MbCreator &, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal? virtual bool SetEqual ( const MbCreator & ); ///< \ru Сделать равным \en Make equal - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); ///< \ru Преобразовать по матрице \en Transform according to the matrix - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); ///< \ru Сдвиг по вектору \en Translation by the vector - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); ///< \ru Поворот вокруг оси \en Rotation about an axis + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); ///< \ru Преобразовать по матрице \en Transform according to the matrix + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); ///< \ru Сдвиг по вектору \en Translation by the vector + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); ///< \ru Поворот вокруг оси \en Rotation about an axis virtual MbePrompt GetPropertyName(); ///< \ru Выдать заголовок свойства объекта \en Get name of object property virtual void GetProperties( MbProperties & ); ///< \ru Выдать свойства объекта \en Get properties of the object @@ -59,7 +59,7 @@ public: // \ru Общие функции математического объе public: /// \ru Построение оболочки \en Creation of a shell virtual bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell, - RPArray * items = c3d_null ); + RPArray * items = nullptr ); // \ru Дать параметры. \en Get the parameters. void GetParameters( MeshSurfaceValues & params ) const; // \ru Установить параметры. \en Set the parameters. diff --git a/C3d/Include/cr_modified_nurbs_.h b/C3d/Include/cr_modified_nurbs_.h index e42dfbf..6a668d3 100644 --- a/C3d/Include/cr_modified_nurbs_.h +++ b/C3d/Include/cr_modified_nurbs_.h @@ -41,12 +41,12 @@ public: // \ru деструктор \en destructor public: // \ru Общие функции математического объекта \en Common functions of the mathematical object virtual MbeCreatorType IsA() const; // \ru Тип элемента \en A type of element - virtual MbCreator & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru сделать копию \en create a copy + virtual MbCreator & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru сделать копию \en create a copy virtual bool IsSame( const MbCreator & other, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal? virtual bool SetEqual ( const MbCreator & ); // \ru сделать равным \en make equal - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать по матрице \en Transform according to the matrix - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru сдвиг по вектору \en translation by a vector - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate around an axis + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать по матрице \en Transform according to the matrix + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru сдвиг по вектору \en translation by a vector + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate around an axis virtual MbePrompt GetPropertyName(); // \ru выдать заголовок свойства объекта \en get a name of object property virtual void GetProperties( MbProperties & properties ); // \ru выдать свойства объекта \en get properties of the object @@ -56,7 +56,7 @@ public: // \ru Общие функции математического объе /// \ru Построение оболочки. \en creation of a shell virtual bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell, - RPArray * items = c3d_null ); + RPArray * items = nullptr ); virtual void Refresh( MbFaceShell & outer ); ///< \ru обновить форму оболочки \en update shape of the shell // \ru Выдать базовые объекты. \en Get basis objects. virtual void GetBasisItems( RPArray & s ); @@ -106,12 +106,12 @@ public: // \ru деструктор \en destructor public: // \ru Общие функции математического объекта \en Common functions of the mathematical object virtual MbeCreatorType IsA() const; // \ru Тип элемента \en A type of element - virtual MbCreator & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru сделать копию \en create a copy + virtual MbCreator & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru сделать копию \en create a copy virtual bool IsSame( const MbCreator & other, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal? virtual bool SetEqual ( const MbCreator & ); // \ru сделать равным \en make equal - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать по матрице \en Transform according to the matrix - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru сдвиг по вектору \en translation by a vector - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate around an axis + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать по матрице \en Transform according to the matrix + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru сдвиг по вектору \en translation by a vector + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate around an axis virtual MbePrompt GetPropertyName(); // \ru выдать заголовок свойства объекта \en get a name of object property virtual void GetProperties( MbProperties & properties ); // \ru выдать свойства объекта \en get properties of the object @@ -121,7 +121,7 @@ public: // \ru Общие функции математического объе /// \ru построение оболочки \en creation of a shell virtual bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell, - RPArray * items = c3d_null ); + RPArray * items = nullptr ); virtual void Refresh( MbFaceShell & outer ); ///< \ru обновить форму оболочки \en update shape of the shell // \ru Выдать базовые объекты. \en Get basis objects. virtual void GetBasisItems( RPArray & s ); diff --git a/C3d/Include/cr_modified_solid.h b/C3d/Include/cr_modified_solid.h index 981e0d9..9b5e659 100644 --- a/C3d/Include/cr_modified_solid.h +++ b/C3d/Include/cr_modified_solid.h @@ -62,12 +62,12 @@ public: // \ru Общие функции математического объекта \en Common functions of the mathematical object virtual MbeCreatorType IsA() const; // \ru Тип элемента \en A type of element - virtual MbCreator & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию \en Create a copy + virtual MbCreator & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию \en Create a copy virtual bool IsSame( const MbCreator & other, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal? virtual bool SetEqual ( const MbCreator & ); // \ru Сделать равным \en Make equal - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать по матрице \en Transform according to the matrix - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг по вектору \en Translation by the vector - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate around an axis + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать по матрице \en Transform according to the matrix + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг по вектору \en Translation by the vector + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate around an axis virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта \en Get a name of object property virtual void GetProperties( MbProperties & properties ); // \ru Выдать свойства объекта \en Get properties of the object @@ -77,7 +77,7 @@ public: /// \ru Построение оболочки \en Creation of a shell virtual bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell, - RPArray * items = c3d_null ); + RPArray * items = nullptr ); virtual void Refresh( MbFaceShell & outer ); ///< \ru Обновить форму оболочки \en Update shape of the shell // \ru Дать параметры. \en Get the parameters. diff --git a/C3d/Include/cr_nurbs3d.h b/C3d/Include/cr_nurbs3d.h index a217629..4b0e269 100644 --- a/C3d/Include/cr_nurbs3d.h +++ b/C3d/Include/cr_nurbs3d.h @@ -53,15 +53,15 @@ public: // \ru Общие функции строителя. \en The common functions of the creator. virtual MbeCreatorType IsA() const; // \ru Тип элемента \en A type of element - virtual MbCreator & Duplicate( MbRegDuplicate * iReg = c3d_null ) const; // \ru Сделать копию \en Create a copy + virtual MbCreator & Duplicate( MbRegDuplicate * iReg = nullptr ) const; // \ru Сделать копию \en Create a copy virtual bool IsSame ( const MbCreator &, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal? virtual bool IsSimilar( const MbCreator & ) const; // \ru Являются ли объекты подобными \en Whether the objects are similar virtual bool SetEqual ( const MbCreator & ); // \ru Сделать равным \en Make equal - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate about an axis + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate about an axis virtual MbePrompt GetPropertyName(); // \ru Дать имя свойства объекта \en Get the object property name virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта \en Get properties of the object @@ -71,7 +71,7 @@ public: virtual void SetBasisPoints( const MbControlData3D & ); // \ru Изменить объект по контрольным точкам. \en Change the object by control points. // \ru Построить кривую по журналу построения \en Create a curve from the history tree - virtual bool CreateWireFrame( MbWireFrame *&, MbeCopyMode, RPArray * items = c3d_null ); + virtual bool CreateWireFrame( MbWireFrame *&, MbeCopyMode, RPArray * items = nullptr ); /** \} */ diff --git a/C3d/Include/cr_nurbs_block_solid.h b/C3d/Include/cr_nurbs_block_solid.h index 6c4f70c..28e3b31 100644 --- a/C3d/Include/cr_nurbs_block_solid.h +++ b/C3d/Include/cr_nurbs_block_solid.h @@ -40,12 +40,12 @@ public: // \ru Деструктор \en Destructor public: // \ru Общие функции математического объекта \en Common functions of the mathematical object virtual MbeCreatorType IsA() const; // \ru Тип элемента \en A type of element - virtual MbCreator & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию \en Create a copy + virtual MbCreator & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию \en Create a copy virtual bool IsSame( const MbCreator & other, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal? virtual bool SetEqual ( const MbCreator & ); // \ru Сделать равным \en Make equal - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать по матрице \en Transform according to the matrix - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг по вектору \en Translation by a vector - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate around an axis + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать по матрице \en Transform according to the matrix + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг по вектору \en Translation by a vector + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate around an axis virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта \en Get a name of object property virtual void GetProperties( MbProperties & properties ); // \ru Выдать свойства объекта \en Get properties of the object @@ -57,7 +57,7 @@ public: // \ru Общие функции математического объе public: /// \ru Построение оболочки \en Creation of a shell virtual bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell, - RPArray * items = c3d_null ); + RPArray * items = nullptr ); virtual void Refresh( MbFaceShell & outer ); ///< \ru Обновить форму оболочки \en Update shape of the shell private: diff --git a/C3d/Include/cr_nurbs_surfaces_shell.h b/C3d/Include/cr_nurbs_surfaces_shell.h index dc84e16..8cd79dd 100644 --- a/C3d/Include/cr_nurbs_surfaces_shell.h +++ b/C3d/Include/cr_nurbs_surfaces_shell.h @@ -43,7 +43,7 @@ MATH_FUNC (MbFaceShell *) CreateNurbsSurfacesShell( NurbsSurfaceValues & p const MbSNameMaker & operNames, bool isPhantom, MbResultType & res, - IProgressIndicator * indicator = c3d_null ); + IProgressIndicator * indicator = nullptr ); //------------------------------------------------------------------------------ @@ -65,7 +65,7 @@ MATH_FUNC (MbFaceShell *) CreateNurbsSurfacesShell( NurbsSurfaceValues & p // --- MATH_FUNC (MbResultType) CheckNurbsSurfacesShell( const NurbsSurfaceValues & params, const MbFaceShell & shell, - IProgressIndicator * indicator = c3d_null ); + IProgressIndicator * indicator = nullptr ); #endif // __NURBS_SURFACES_SHELL_H diff --git a/C3d/Include/cr_nurbs_surfaces_solid.h b/C3d/Include/cr_nurbs_surfaces_solid.h index d4d335b..4a6be91 100644 --- a/C3d/Include/cr_nurbs_surfaces_solid.h +++ b/C3d/Include/cr_nurbs_surfaces_solid.h @@ -50,12 +50,12 @@ public: public: // \ru Общие функции математического объекта \en Common functions of the mathematical object virtual MbeCreatorType IsA() const; // \ru Тип элемента \en Type of element - virtual MbCreator & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru сделать копию \en create a copy + virtual MbCreator & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru сделать копию \en create a copy virtual bool IsSame( const MbCreator &, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal? virtual bool SetEqual ( const MbCreator & ); // \ru сделать равным \en make equal - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать по матрице \en Transform according to the matrix - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru сдвиг по вектору \en translation by a vector - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate about an axis + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать по матрице \en Transform according to the matrix + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru сдвиг по вектору \en translation by a vector + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate about an axis virtual MbePrompt GetPropertyName(); // \ru выдать заголовок свойства объекта \en get a name of object property virtual void GetProperties( MbProperties & properties ); // \ru выдать свойства объекта \en get properties of the object @@ -67,7 +67,7 @@ public: // \ru Общие функции математического объе public: /// \ru построение оболочки \en creation of a shell virtual bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell, - RPArray * items = c3d_null ); + RPArray * items = nullptr ); virtual void Refresh( MbFaceShell & outer ); ///< \ru обновить форму оболочки \en update shape of the shell // \ru Дать параметры. \en Get the parameters. @@ -110,7 +110,7 @@ MATH_FUNC (MbCreator *) CreateNurbsShell( NurbsSurfaceValues & parameters, bool isPhantom, MbResultType & res, MbFaceShell *& shell, - IProgressIndicator * indicator = c3d_null ); + IProgressIndicator * indicator = nullptr ); #endif // __CR_NURBS_SURFACES_SOLID_H diff --git a/C3d/Include/cr_offset_curve.h b/C3d/Include/cr_offset_curve.h index 1477a02..4196550 100644 --- a/C3d/Include/cr_offset_curve.h +++ b/C3d/Include/cr_offset_curve.h @@ -92,15 +92,15 @@ public : // \ru Общие функции строителя. \en The common functions of the creator. virtual MbeCreatorType IsA() const; // \ru Тип элемента \en A type of element - virtual MbCreator & Duplicate( MbRegDuplicate * iReg = c3d_null ) const; // \ru Сделать копию \en Create a copy + virtual MbCreator & Duplicate( MbRegDuplicate * iReg = nullptr ) const; // \ru Сделать копию \en Create a copy virtual bool IsSame ( const MbCreator &, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal? virtual bool IsSimilar( const MbCreator & ) const; // \ru Являются ли объекты подобными \en Whether the objects are similar virtual bool SetEqual ( const MbCreator & ); // \ru Сделать равным \en Make equal - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate about an axis + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate about an axis virtual MbePrompt GetPropertyName(); // \ru Дать имя свойства объекта \en Get the object property name virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта \en Get properties of the object @@ -113,7 +113,7 @@ public : virtual bool SetInternalCreators( MbeCreatorType, c3d::CreatorsSPtrVector & ); // \ru Получить внутренние построители по типу. \en Get internal creators by type. // \ru Построить кривую по журналу построения \en Create a curve from the history tree - virtual bool CreateWireFrame( MbWireFrame *&, MbeCopyMode, RPArray * items = c3d_null ); + virtual bool CreateWireFrame( MbWireFrame *&, MbeCopyMode, RPArray * items = nullptr ); /** \} */ diff --git a/C3d/Include/cr_patch_creator.h b/C3d/Include/cr_patch_creator.h index 3dd4dad..2a5859f 100644 --- a/C3d/Include/cr_patch_creator.h +++ b/C3d/Include/cr_patch_creator.h @@ -32,12 +32,12 @@ class MATH_CLASS MbFaceShell; // --- class MATH_CLASS MbPatchCreator : public MbCreator { protected: - std::vector> initCurves; ///< \ru Кривые, определяющие края заплатки. \en Curves determining the boundaries of a patch. - PatchValues parameters; ///< \ru Параметры построения заплатки. \en Parameters of patch construction. + std::vector> initCurves; ///< \ru Кривые, определяющие края заплатки. \en Curves determining the boundaries of a patch. + PatchValues parameters; ///< \ru Параметры построения заплатки. \en Parameters of patch construction. /// \ru Cледующие данные имеются только, если обрабатываются ребра. \en The following data are defined only when edges are being processed. - SArray orientations; ///< \ru Ориентация кривых для замыкания в цепь. \en Orientation of curves for enclosing into a chain. - SArray tolerances; ///< \ru Толерантности стыков кривых для замыкания в цепь. \en Tolerances of joints of curves for enclosing into a chain. - SArray surfInds; ///< \ru Номер поверхности кривой пересечения, отвечающей существующей грани. \en Number of surface of the intersection curve corresponding to the existent face. + SArray orientations; ///< \ru Ориентация кривых для замыкания в цепь. \en Orientation of curves for enclosing into a chain. + SArray tolerances; ///< \ru Толерантности стыков кривых для замыкания в цепь. \en Tolerances of joints of curves for enclosing into a chain. + SArray surfInds; ///< \ru Номер поверхности кривой пересечения, отвечающей существующей грани. \en Number of surface of the intersection curve corresponding to the existent face. private : MbPatchCreator( const MbPatchCreator &, MbRegDuplicate * ireg ); @@ -46,7 +46,7 @@ public : MbPatchCreator( const std::vector> & curves, const PatchValues & params, const MbSNameMaker & n, - const SArray * surfInds, + const SArray * surfInds, const SArray * orientations, const SArray * tolerances ); virtual ~MbPatchCreator(); @@ -54,10 +54,10 @@ public : // \ru Общие функции математического объекта \en Common functions of the mathematical object virtual MbeCreatorType IsA() const; // \ru Тип элемента \en Type of element - virtual MbCreator & Duplicate( MbRegDuplicate * = c3d_null ) const ; - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); + virtual MbCreator & Duplicate( MbRegDuplicate * = nullptr ) const ; + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта \en Get a name of object property virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта \en Get properties of the object @@ -72,7 +72,7 @@ public : // \ru Построение оболочки по исходным данным \en Construction of a shell from the given data virtual bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell, - RPArray * items = c3d_null ); + RPArray * items = nullptr ); // \ru Дать параметры. \en Get the parameters. void GetParameters( PatchValues & params ) const { params = parameters; } diff --git a/C3d/Include/cr_projection_curve.h b/C3d/Include/cr_projection_curve.h index 4a64aa1..af43bb1 100644 --- a/C3d/Include/cr_projection_curve.h +++ b/C3d/Include/cr_projection_curve.h @@ -52,15 +52,15 @@ public: // \ru Общие функции строителя. \en The common functions of the creator. virtual MbeCreatorType IsA() const; // \ru Тип элемента \en A type of element - virtual MbCreator & Duplicate( MbRegDuplicate * iReg = c3d_null ) const; // \ru Сделать копию \en Create a copy + virtual MbCreator & Duplicate( MbRegDuplicate * iReg = nullptr ) const; // \ru Сделать копию \en Create a copy virtual bool IsSame ( const MbCreator &, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal? virtual bool IsSimilar( const MbCreator & ) const; // \ru Являются ли объекты подобными \en Whether the objects are similar virtual bool SetEqual ( const MbCreator & ); // \ru Сделать равным \en Make equal - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate about an axis + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate about an axis virtual MbePrompt GetPropertyName(); // \ru Дать имя свойства объекта \en Get the object property name virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта \en Get properties of the object @@ -73,7 +73,7 @@ public: virtual bool SetInternalCreators( MbeCreatorType, c3d::CreatorsSPtrVector & ); // \ru Получить внутренние построители по типу. \en Get internal creators by type. // \ru Построить кривую по журналу построения \en Create a curve from the history tree - virtual bool CreateWireFrame( MbWireFrame *&, MbeCopyMode, RPArray * items = c3d_null ); + virtual bool CreateWireFrame( MbWireFrame *&, MbeCopyMode, RPArray * items = nullptr ); /** \} */ diff --git a/C3d/Include/cr_revolution_solid.h b/C3d/Include/cr_revolution_solid.h index c645843..20679b7 100644 --- a/C3d/Include/cr_revolution_solid.h +++ b/C3d/Include/cr_revolution_solid.h @@ -65,10 +65,10 @@ public : \en \name Common functions of the mathematical object. \{ */ virtual MbeCreatorType IsA() const; // \ru Тип элемента \en A type of element - virtual MbCreator & Duplicate( MbRegDuplicate * = c3d_null ) const ; // \ru Сделать копию \en Create a copy - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate around an axis + virtual MbCreator & Duplicate( MbRegDuplicate * = nullptr ) const ; // \ru Сделать копию \en Create a copy + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate around an axis virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта \en Get properties of the object virtual void SetProperties( const MbProperties & ); // \ru Записать свойства объекта \en Set properties of the object diff --git a/C3d/Include/cr_rib_solid.h b/C3d/Include/cr_rib_solid.h index 379080b..72fef7d 100644 --- a/C3d/Include/cr_rib_solid.h +++ b/C3d/Include/cr_rib_solid.h @@ -43,10 +43,10 @@ public : // \ru Общие функции математического объекта \en Common functions of the mathematical object virtual MbeCreatorType IsA () const; // \ru Тип элемента \en A type of element - virtual MbCreator & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию \en Create a copy - virtual void Transform ( const MbMatrix3D & matr, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move ( const MbVector3D & to, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate ( const MbAxis3D & axis, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate around an axis + virtual MbCreator & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию \en Create a copy + virtual void Transform ( const MbMatrix3D & matr, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move ( const MbVector3D & to, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate ( const MbAxis3D & axis, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate around an axis virtual void GetProperties( MbProperties & properties ); // \ru Выдать свойства объекта \en Get properties of the object virtual void SetProperties( const MbProperties & properties ); // \ru Записать свойства объекта \en Set properties of the object @@ -60,7 +60,7 @@ public : // \ru Общие функции твердого тела \en Common functions of solid virtual bool CreateShell( MbFaceShell *&shell, MbeCopyMode sameShell, - RPArray *items = c3d_null ); // \ru Построение \en Construction + RPArray *items = nullptr ); // \ru Построение \en Construction // \ru Дать параметры. \en Get the parameters. void GetParameters( RibValues & params ) const { params = parameters; } diff --git a/C3d/Include/cr_ruled_shell.h b/C3d/Include/cr_ruled_shell.h index 06d1c5b..a3a2acd 100644 --- a/C3d/Include/cr_ruled_shell.h +++ b/C3d/Include/cr_ruled_shell.h @@ -46,12 +46,12 @@ public: public: // \ru Общие функции математического объекта \en Common functions of the mathematical object virtual MbeCreatorType IsA() const; ///< \ru Тип элемента \en Element type - virtual MbCreator & Duplicate( MbRegDuplicate * = c3d_null ) const; ///< \ru Сделать копию \en Make a copy + virtual MbCreator & Duplicate( MbRegDuplicate * = nullptr ) const; ///< \ru Сделать копию \en Make a copy virtual bool IsSame( const MbCreator &, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal? virtual bool SetEqual ( const MbCreator & ); ///< \ru Сделать равным \en Make equal - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); ///< \ru Преобразовать по матрице \en Transform according to the matrix - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); ///< \ru Сдвиг по вектору \en Translation by the vector - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); ///< \ru Поворот вокруг оси \en Rotation about an axis + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); ///< \ru Преобразовать по матрице \en Transform according to the matrix + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); ///< \ru Сдвиг по вектору \en Translation by the vector + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); ///< \ru Поворот вокруг оси \en Rotation about an axis virtual void GetProperties( MbProperties & properties ); ///< \ru Выдать свойства объекта \en Get properties of the object virtual void SetProperties( const MbProperties & properties ); ///< \ru Записать свойства объекта \en Write properties of the object @@ -63,7 +63,7 @@ public: // \ru Общие функции математического объе public: /// \ru Построение оболочки \en Creation of a shell virtual bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell, - RPArray * items = c3d_null ); + RPArray * items = nullptr ); // \ru Дать параметры. \en Get the parameters. void GetParameters( RuledSurfaceValues & params ) const; // \ru Установить параметры. \en Set the parameters. diff --git a/C3d/Include/cr_section_shell.h b/C3d/Include/cr_section_shell.h index 3626994..5615418 100644 --- a/C3d/Include/cr_section_shell.h +++ b/C3d/Include/cr_section_shell.h @@ -54,10 +54,10 @@ public : \en \name Common functions of the mathematical object. \{ */ virtual MbeCreatorType IsA() const; // \ru Тип элемента \en A type of element - virtual MbCreator & Duplicate( MbRegDuplicate * = c3d_null ) const ; // \ru Сделать копию \en Create a copy - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate around an axis + virtual MbCreator & Duplicate( MbRegDuplicate * = nullptr ) const ; // \ru Сделать копию \en Create a copy + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate around an axis virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта \en Get properties of the object virtual void SetProperties( const MbProperties & ); // \ru Записать свойства объекта \en Set properties of the object @@ -75,7 +75,7 @@ public : \en \name Common functions of the rigid solid (forming operations). \{ */ virtual bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell, - RPArray * items = c3d_null ); // \ru Построение \en Construction + RPArray * items = nullptr ); // \ru Построение \en Construction virtual void SetYourVersion( VERSION version ); /** \} */ diff --git a/C3d/Include/cr_sheet_bend_any_solid.h b/C3d/Include/cr_sheet_bend_any_solid.h index 09eb4bb..1ff4ef8 100644 --- a/C3d/Include/cr_sheet_bend_any_solid.h +++ b/C3d/Include/cr_sheet_bend_any_solid.h @@ -47,15 +47,15 @@ public: // \ru Общие функции математического объекта \en Common functions of the mathematical object virtual MbeCreatorType IsA() const; // \ru Тип элемента \en Type of element - virtual MbCreator & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию \en Create a copy + virtual MbCreator & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию \en Create a copy virtual bool IsSame ( const MbCreator & other, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal? virtual bool IsSimilar( const MbCreator & item ) const; // \ru Являются ли объекты подобными? \en Determine whether an object is similar? virtual bool SetEqual ( const MbCreator & ); // \ru Сделать равным \en Make equal - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate ( const MbAxis3D &, double, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate about an axis + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate ( const MbAxis3D &, double, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate about an axis virtual void GetProperties( MbProperties & properties ); // \ru Выдать свойства объекта \en Get properties of the object virtual void SetProperties( const MbProperties & properties ); // \ru Записать свойства объекта \en Set properties of the object @@ -65,7 +65,7 @@ public: virtual bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell, - RPArray * items = c3d_null ); // \ru Построение \en Construction + RPArray * items = nullptr ); // \ru Построение \en Construction private: // \ru Объявление оператора присваивания без реализации, чтобы не было присваивания по умолчанию. \en The declaration of the assignment operator without implementation to prevent an assignment by default. diff --git a/C3d/Include/cr_sheet_bend_by_edge_solid.h b/C3d/Include/cr_sheet_bend_by_edge_solid.h index 2786936..b6a75d8 100644 --- a/C3d/Include/cr_sheet_bend_by_edge_solid.h +++ b/C3d/Include/cr_sheet_bend_by_edge_solid.h @@ -58,14 +58,14 @@ public: // \ru Общие функции математического объекта \en Common functions of the mathematical object virtual MbeCreatorType IsA() const; // \ru Тип элемента \en Type of element - virtual MbCreator & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию \en Create a copy + virtual MbCreator & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию \en Create a copy virtual bool IsSame ( const MbCreator & other, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal? virtual bool IsSimilar( const MbCreator & item ) const; // \ru Являются ли объекты подобными? \en Determine whether an object is similar? virtual bool SetEqual ( const MbCreator & ); // \ru Сделать равным \en Make equal - virtual void Transform( const MbMatrix3D & matr, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move ( const MbVector3D & to, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate ( const MbAxis3D & axis, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate about an axis + virtual void Transform( const MbMatrix3D & matr, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move ( const MbVector3D & to, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate ( const MbAxis3D & axis, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate about an axis virtual void GetProperties( MbProperties & properties ); // \ru Выдать свойства объекта \en Get properties of the object virtual void SetProperties( const MbProperties & properties ); // \ru Записать свойства объекта \en Set properties of the object @@ -76,7 +76,7 @@ public: virtual bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell, - RPArray * items = c3d_null ); // \ru Построение \en Construction + RPArray * items = nullptr ); // \ru Построение \en Construction // \ru Дать параметры. \en Get the parameters. void GetParameters( MbBendByEdgeValues & params ) const { params = parameters; } diff --git a/C3d/Include/cr_sheet_bend_over_seg_solid.h b/C3d/Include/cr_sheet_bend_over_seg_solid.h index 8617fdc..aa8dd15 100644 --- a/C3d/Include/cr_sheet_bend_over_seg_solid.h +++ b/C3d/Include/cr_sheet_bend_over_seg_solid.h @@ -49,15 +49,15 @@ public: // \ru Общие функции математического объекта \en Common functions of the mathematical object virtual MbeCreatorType IsA() const; // \ru Тип элемента \en Type of element - virtual MbCreator & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию \en Create a copy + virtual MbCreator & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию \en Create a copy virtual bool IsSame ( const MbCreator & other, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal? virtual bool IsSimilar( const MbCreator & item ) const; // \ru Являются ли объекты подобными? \en Determine whether an object is similar? virtual bool SetEqual ( const MbCreator & ); // \ru Сделать равным \en Make equal - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate about an axis + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate about an axis virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта \en Get a name of object property virtual void GetProperties( MbProperties & properties ); // \ru Выдать свойства объекта \en Get properties of the object @@ -69,7 +69,7 @@ public: // \ru Общие функции твердого тела \en Common functions of solid solid virtual bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell, - RPArray * items = c3d_null ); // \ru Построение \en Construction + RPArray * items = nullptr ); // \ru Построение \en Construction // \ru Дать параметры. \en Get the parameters. void GetParameters( MbBendOverSegValues & params ) const { params = parameters; } diff --git a/C3d/Include/cr_sheet_bend_unbend_solid.h b/C3d/Include/cr_sheet_bend_unbend_solid.h index a6be1a7..3a8e687 100644 --- a/C3d/Include/cr_sheet_bend_unbend_solid.h +++ b/C3d/Include/cr_sheet_bend_unbend_solid.h @@ -50,15 +50,15 @@ public: // \ru Общие функции математического объекта \en Common functions of the mathematical object virtual MbeCreatorType IsA() const; // \ru Тип элемента \en Type of element - virtual MbCreator & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию \en Create a copy + virtual MbCreator & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию \en Create a copy virtual bool IsSame ( const MbCreator & other, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal? virtual bool IsSimilar( const MbCreator & item ) const; // \ru Являются ли объекты подобными? \en Determine whether an object is similar? virtual bool SetEqual ( const MbCreator & ); // \ru Сделать равным \en Make equal - virtual void Transform( const MbMatrix3D & matr, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move ( const MbVector3D & to, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate ( const MbAxis3D & axis, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate about an axis + virtual void Transform( const MbMatrix3D & matr, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move ( const MbVector3D & to, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate ( const MbAxis3D & axis, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate about an axis virtual void GetProperties( MbProperties & properties ); // \ru Выдать свойства объекта \en Get properties of the object virtual void SetProperties( const MbProperties & properties ); // \ru Записать свойства объекта \en Set properties of the object @@ -68,7 +68,7 @@ public: virtual bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell, - RPArray * items = c3d_null ); // \ru Построение \en Construction + RPArray * items = nullptr ); // \ru Построение \en Construction private: // \ru Объявление оператора присваивания без реализации, чтобы не было присваивания по умолчанию. \en The declaration of the assignment operator without implementation to prevent an assignment by default. @@ -122,7 +122,7 @@ MATH_FUNC (MbCreator *) CreateBendUnbend( SPtr & init const MbSNameMaker & names, MbResultType & res, MbFaceShell *& shell, - RPArray * ribContours = c3d_null ); + RPArray * ribContours = nullptr ); diff --git a/C3d/Include/cr_sheet_builder_solid.h b/C3d/Include/cr_sheet_builder_solid.h index 6f551b9..3396263 100644 --- a/C3d/Include/cr_sheet_builder_solid.h +++ b/C3d/Include/cr_sheet_builder_solid.h @@ -44,15 +44,15 @@ public: // \ru Общие функции математического объекта. \en Common functions of the mathematical object. virtual MbeCreatorType IsA() const; // \ru Тип элемента. \en A type of element. - virtual MbCreator & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию. \en Create a copy. + virtual MbCreator & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию. \en Create a copy. virtual bool IsSame ( const MbCreator & other, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal? virtual bool IsSimilar( const MbCreator & item ) const; // \ru Являются ли объекты подобными? \en Determine whether an object is similar? virtual bool SetEqual ( const MbCreator & ); // \ru Сделать равным. \en Make equal. - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг. \en Translation. - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси. \en Rotate around an axis. + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг. \en Translation. + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси. \en Rotate around an axis. virtual void GetProperties ( MbProperties & properties ); // \ru Выдать свойства объекта. \en Get properties of the object. virtual void SetProperties ( const MbProperties & properties ); // \ru Записать свойства объекта. \en Set properties of the object. @@ -61,7 +61,7 @@ public: // \ru Общие функции твердого тела. \en Common functions of solid. // \ru Построение оболочки листового тела. \en Construction of a sheet metal shell. - virtual bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell, RPArray *items = c3d_null ); + virtual bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell, RPArray *items = nullptr ); // \ru Получить параметры. \en Get the parameters. void GetParameters( MbSolidToSheetMetalValues & params ) const { params = parameters; } // \ru Установить параметры. \en Set the parameters. diff --git a/C3d/Include/cr_sheet_closed_corner_solid.h b/C3d/Include/cr_sheet_closed_corner_solid.h index fa86c6c..f72c2b5 100644 --- a/C3d/Include/cr_sheet_closed_corner_solid.h +++ b/C3d/Include/cr_sheet_closed_corner_solid.h @@ -50,15 +50,15 @@ public: // \ru Общие функции математического объекта \en Common functions of the mathematical object virtual MbeCreatorType IsA() const; // \ru Тип элемента \en Type of element - virtual MbCreator & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию \en Create a copy + virtual MbCreator & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию \en Create a copy virtual bool IsSame ( const MbCreator & other, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal? virtual bool IsSimilar( const MbCreator & item ) const; // \ru Являются ли объекты подобными? \en Determine whether an object is similar? virtual bool SetEqual ( const MbCreator & ); // \ru Сделать равным \en Make equal - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate about an axis + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate about an axis virtual void GetProperties( MbProperties & properties ); // \ru Выдать свойства объекта \en Get properties of the object virtual void SetProperties( const MbProperties & properties ); // \ru Записать свойства объекта \en Set properties of the object @@ -68,7 +68,7 @@ public: virtual bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell, - RPArray * items = c3d_null ); // \ru Построение \en Construction + RPArray * items = nullptr ); // \ru Построение \en Construction // \ru Дать параметры. \en Get the parameters. void GetParameters( MbClosedCornerValues & params ) const { params = parameters; } diff --git a/C3d/Include/cr_sheet_joint_bend_solid.h b/C3d/Include/cr_sheet_joint_bend_solid.h index 1e7dc69..3a517c3 100644 --- a/C3d/Include/cr_sheet_joint_bend_solid.h +++ b/C3d/Include/cr_sheet_joint_bend_solid.h @@ -57,15 +57,15 @@ public: // \ru Общие функции математического объекта \en Common functions of the mathematical object virtual MbeCreatorType IsA() const; // \ru Тип элемента \en Type of element - virtual MbCreator & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию \en Create a copy + virtual MbCreator & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию \en Create a copy virtual bool IsSame ( const MbCreator & other, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal? virtual bool IsSimilar( const MbCreator & item ) const; // \ru Являются ли объекты подобными? \en Determine whether an object is similar? virtual bool SetEqual ( const MbCreator & ); // \ru Сделать равным \en Make equal - virtual void Transform( const MbMatrix3D & matr, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move ( const MbVector3D & to, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate ( const MbAxis3D & axis, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate about an axis + virtual void Transform( const MbMatrix3D & matr, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move ( const MbVector3D & to, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate ( const MbAxis3D & axis, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate about an axis virtual void GetProperties( MbProperties & properties ); // \ru Выдать свойства объекта \en Get properties of the object virtual void SetProperties( const MbProperties & properties ); // \ru Записать свойства объекта \en Set properties of the object @@ -74,7 +74,7 @@ public: // \ru Общие функции твердого тела \en Common functions of solid solid virtual bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell, - RPArray * items = c3d_null ); // \ru Построение \en Construction + RPArray * items = nullptr ); // \ru Построение \en Construction // \ru Дать параметры. \en Get the parameters. void GetParameters( MbJointBendValues & params ) const { params = parameters; } diff --git a/C3d/Include/cr_sheet_metal_solid.h b/C3d/Include/cr_sheet_metal_solid.h index 0b96d9f..08ffef3 100644 --- a/C3d/Include/cr_sheet_metal_solid.h +++ b/C3d/Include/cr_sheet_metal_solid.h @@ -82,10 +82,10 @@ public : // \ru Общие функции математического объекта \en Common functions of the mathematical object virtual MbeCreatorType IsA() const; // \ru Тип элемента \en Type of element - virtual MbCreator & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию \en Create a copy - virtual void Transform( const MbMatrix3D & matr, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move( const MbVector3D & to, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate( const MbAxis3D & axis, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate about an axis + virtual MbCreator & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию \en Create a copy + virtual void Transform( const MbMatrix3D & matr, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move( const MbVector3D & to, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate( const MbAxis3D & axis, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate about an axis virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта \en Get a name of object property virtual void GetProperties( MbProperties & properties ); // \ru Выдать свойства объекта \en Get properties of the object @@ -101,7 +101,7 @@ public : // \ru Общие функции твердого тела \en Common functions of solid solid virtual bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell, - RPArray * items = c3d_null ); // \ru Построение \en Construction + RPArray * items = nullptr ); // \ru Построение \en Construction virtual MbFaceShell * InitShell( bool in ); diff --git a/C3d/Include/cr_sheet_normalize_holes_solid.h b/C3d/Include/cr_sheet_normalize_holes_solid.h new file mode 100644 index 0000000..7a1a009 --- /dev/null +++ b/C3d/Include/cr_sheet_normalize_holes_solid.h @@ -0,0 +1,94 @@ +//////////////////////////////////////////////////////////////////////////////// +/** +\file +\brief \ru Нормализация отверстий листовых тел. +\en Normalization of the holes of sheet solid. \~ + +*/ +//////////////////////////////////////////////////////////////////////////////// + +#ifndef __CR_SHEET_NORMALIZE_HOLES_SOLID_H +#define __CR_SHEET_NORMALIZE_HOLES_SOLID_H + + +#include + + +//------------------------------------------------------------------------------ +/** \brief \ru Строитель нормализации отверстий листовых тел. +\en Constructor of the normalization of the holes of sheet solid. \~ +\details \ru Строитель нормализации отверстий листовых тел. \n +\en Constructor of the normalization of the holes of sheet solid.\n \~ +\ingroup Model_Creators +*/ +// --- +class MATH_CLASS MbNormalizeHolesSolid : public MbCreator { + +public : + MbNormalizeHolesSolid( const MbSNameMaker & names ); +private: + MbNormalizeHolesSolid( const MbNormalizeHolesSolid &, MbRegDuplicate * iReg ); + // \ru Объявление конструктора копирования без реализации, чтобы не было копирования по умолчанию. \en Declaration without implementation of the copy-constructor to prevent copying by default. + MbNormalizeHolesSolid( const MbNormalizeHolesSolid & ); + +public: + virtual ~MbNormalizeHolesSolid(); + + // \ru Общие функции математического объекта \en Common functions of the mathematical object + + virtual MbeCreatorType IsA() const; // \ru Тип элемента \en Type of element + virtual MbCreator & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию \en Create a copy + + virtual bool IsSame ( const MbCreator & other, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal? + virtual bool IsSimilar( const MbCreator & item ) const; // \ru Являются ли объекты подобными? \en Determine whether an object is similar? + virtual bool SetEqual ( const MbCreator & ); // \ru Сделать равным \en Make equal + + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate ( const MbAxis3D &, double, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate about an axis + + virtual void GetProperties( MbProperties & properties ); // \ru Выдать свойства объекта \en Get properties of the object + virtual void SetProperties( const MbProperties & properties ); // \ru Записать свойства объекта \en Set properties of the object + virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта \en Get a name of object property + + // \ru Общие функции твердого тела \en Common functions of solid solid + + virtual bool CreateShell( MbFaceShell *& shell, + MbeCopyMode sameShell, + RPArray * items = nullptr ); // \ru Построение \en Construction + +private: + // \ru Объявление оператора присваивания без реализации, чтобы не было присваивания по умолчанию. \en The declaration of the assignment operator without implementation to prevent an assignment by default. + MbNormalizeHolesSolid & operator = ( const MbNormalizeHolesSolid & ); // \ru Не реализовано \en Not implemented + + DECLARE_PERSISTENT_CLASS_NEW_DEL( MbNormalizeHolesSolid ) +}; + +IMPL_PERSISTENT_OPS( MbNormalizeHolesSolid ) + +//------------------------------------------------------------------------------ +/** \brief \ru Нормализовать вырезы листового тела. +\en Normalize of the holes of sheet solid. \~ +\details \ru Нормализовать вырезы листового тела. \n +\en Normalize of the holes of sheet solid. \n \~ +\param[in] initialShell - \ru Исходная оболочка. +\en The source shell. \~ +\param[in] sameShell - \ru Флаг удаления оболочки исходного тела. +\en Whether to delete the shell of the source solid. \~ +\param[in] nameMaker - \ru Именователь. +\en An object for naming the new objects. \~ +\param[out] res - \ru Код результата операции. +\en Operation result code. \~ +\param[out] shell - \ru Построенная оболочка. +\en The resultant shell. \~ +\result \ru Возвращает строитель оболочки. +\en Returns the shell constructor. \~ +\ingroup Sheet_Metal_Modeling +*/ +// --- +MATH_FUNC (MbCreator *) NormalizeHolesSides ( MbFaceShell & initialShell, + const MbeCopyMode sameShell, + const MbSNameMaker & nameMaker, + MbResultType & res, + MbFaceShell *& shell ); +#endif // __CR_SHEET_NORMALIZE_HOLES_SOLID_H diff --git a/C3d/Include/cr_sheet_restored_edges_solid.h b/C3d/Include/cr_sheet_restored_edges_solid.h index 08839eb..96be164 100644 --- a/C3d/Include/cr_sheet_restored_edges_solid.h +++ b/C3d/Include/cr_sheet_restored_edges_solid.h @@ -45,15 +45,15 @@ public: // \ru Общие функции математического объекта \en Common functions of the mathematical object virtual MbeCreatorType IsA() const; // \ru Тип элемента \en Type of element - virtual MbCreator & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию \en Create a copy + virtual MbCreator & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию \en Create a copy virtual bool IsSame ( const MbCreator & other, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal? virtual bool IsSimilar( const MbCreator & item ) const; // \ru Являются ли объекты подобными? \en Determine whether an object is similar? virtual bool SetEqual ( const MbCreator & ); // \ru Сделать равным \en Make equal - virtual void Transform( const MbMatrix3D & matr, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move ( const MbVector3D & to, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate ( const MbAxis3D & axis, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate about an axis + virtual void Transform( const MbMatrix3D & matr, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move ( const MbVector3D & to, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate ( const MbAxis3D & axis, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate about an axis virtual void GetProperties( MbProperties & properties ); // \ru Выдать свойства объекта \en Get properties of the object virtual void SetProperties( const MbProperties & properties ); // \ru Записать свойства объекта \en Set properties of the object @@ -63,7 +63,7 @@ public: virtual bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell, - RPArray * items = c3d_null ); // \ru Построение \en Construction + RPArray * items = nullptr ); // \ru Построение \en Construction private: // \ru Объявление оператора присваивания без реализации, чтобы не было присваивания по умолчанию. \en The declaration of the assignment operator without implementation to prevent an assignment by default. diff --git a/C3d/Include/cr_sheet_simplified_flat_solid.h b/C3d/Include/cr_sheet_simplified_flat_solid.h index 0e73ead..2749c7d 100644 --- a/C3d/Include/cr_sheet_simplified_flat_solid.h +++ b/C3d/Include/cr_sheet_simplified_flat_solid.h @@ -42,15 +42,15 @@ public: // \ru Общие функции математического объекта \en Common functions of the mathematical object virtual MbeCreatorType IsA() const; // \ru Тип элемента \en Type of element - virtual MbCreator & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию \en Create a copy + virtual MbCreator & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию \en Create a copy virtual bool IsSame ( const MbCreator & other, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal? virtual bool IsSimilar( const MbCreator & item ) const; // \ru Являются ли объекты подобными? \en Determine whether an object is similar? virtual bool SetEqual ( const MbCreator & ); // \ru Сделать равным \en Make equal - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate ( const MbAxis3D &, double, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate about an axis + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate ( const MbAxis3D &, double, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate about an axis virtual void GetProperties( MbProperties & properties ); // \ru Выдать свойства объекта \en Get properties of the object virtual void SetProperties( const MbProperties & properties ); // \ru Записать свойства объекта \en Set properties of the object @@ -60,7 +60,7 @@ public: virtual bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell, - RPArray * items = c3d_null ); // \ru Построение \en Construction + RPArray * items = nullptr ); // \ru Построение \en Construction private: // \ru Объявление оператора присваивания без реализации, чтобы не было присваивания по умолчанию. \en The declaration of the assignment operator without implementation to prevent an assignment by default. diff --git a/C3d/Include/cr_sheet_union_solid.h b/C3d/Include/cr_sheet_union_solid.h index 18b4a26..03cd429 100644 --- a/C3d/Include/cr_sheet_union_solid.h +++ b/C3d/Include/cr_sheet_union_solid.h @@ -43,10 +43,10 @@ public : // \ru Общие функции математического объекта \en Common functions of the mathematical object virtual MbeCreatorType IsA() const; // \ru Тип элемента \en Type of element - virtual void Transform( const MbMatrix3D &, MbRegTransform * ireg = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move ( const MbVector3D &, MbRegTransform * ireg = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * ireg = c3d_null ); // \ru Повернуть вокруг оси \en Rotate about an axis - virtual MbCreator & Duplicate( MbRegDuplicate * = c3d_null ) const ; // \ru Сделать копию \en Create a copy + virtual void Transform( const MbMatrix3D &, MbRegTransform * ireg = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move ( const MbVector3D &, MbRegTransform * ireg = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * ireg = nullptr ); // \ru Повернуть вокруг оси \en Rotate about an axis + virtual MbCreator & Duplicate( MbRegDuplicate * = nullptr ) const ; // \ru Сделать копию \en Create a copy virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта \en Get a name of object property virtual void GetProperties( MbProperties & properties ); // \ru Выдать свойства объекта \en Get properties of the object @@ -62,7 +62,7 @@ public : // \ru Общие функции твердого тела \en Common functions of solid virtual bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell, - RPArray * items = c3d_null ); // \ru Построение \en Construction + RPArray * items = nullptr ); // \ru Построение \en Construction virtual void SetYourVersion( VERSION version, bool forAll ); diff --git a/C3d/Include/cr_simple_creator.h b/C3d/Include/cr_simple_creator.h index 23a94c6..cd30980 100644 --- a/C3d/Include/cr_simple_creator.h +++ b/C3d/Include/cr_simple_creator.h @@ -68,10 +68,10 @@ public : \en \name Common functions of the shell creator. \{ */ virtual MbeCreatorType IsA() const; // \ru Тип элемента \en Type of element - virtual MbCreator & Duplicate( MbRegDuplicate * = c3d_null ) const ; // \ru Сделать копию \en Create a copy - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate about an axis + virtual MbCreator & Duplicate( MbRegDuplicate * = nullptr ) const ; // \ru Сделать копию \en Create a copy + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate about an axis virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта \en Get a name of object property virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта \en Get properties of the object @@ -85,7 +85,7 @@ public : virtual bool SetEqual( const MbCreator & ); // \ru Сделать равным \en Make equal virtual bool CreateShell( MbFaceShell *&shell, MbeCopyMode sameShell, - RPArray * items = c3d_null ); // \ru Построение \en Construction + RPArray * items = nullptr ); // \ru Построение \en Construction /** \} */ const MbFaceShell * GetShell() const { return outer; } /// \ru Дать оболочку. \en Get a shell. @@ -158,7 +158,7 @@ bool MbSimpleCreator::DeleteShellCopies( const CreatorsVector & creators ) size_t i; for ( i = 0; i < creatorsCnt; ++i ) { MbCreator * creator = creators[i]; - if ( creator != c3d_null ) { + if ( creator != nullptr ) { if ( creator->IsA() == ct_SimpleCreator ) { MbSimpleCreator * simpleCreator = static_cast(creator); simpleShells.push_back( std::make_pair( i, simpleCreator->GetShell() ) ); @@ -184,7 +184,7 @@ bool MbSimpleCreator::DeleteShellCopies( const CreatorsVector & creators ) if ( shell1 && shell2 && (shell1 != shell2) ) { if ( shell1->IsSame( *shell2, LENGTH_EPSILON ) ) { sc2.SetShell( *shell1 ); - simpleShells[j].second = c3d_null; + simpleShells[j].second = nullptr; isReplaced = true; } } @@ -194,7 +194,7 @@ bool MbSimpleCreator::DeleteShellCopies( const CreatorsVector & creators ) std::sort( simpleShells.begin(), simpleShells.end(), ::SortByShellPointers ); simpleShells.erase( std::unique( simpleShells.begin(), simpleShells.end(), ::AreEqualShellPointers ), simpleShells.end() ); if ( simpleShells.size() > 1 ) { - if ( simpleShells.front().second == c3d_null ) + if ( simpleShells.front().second == nullptr ) simpleShells.erase( simpleShells.begin() ); } } @@ -215,7 +215,7 @@ bool MbSimpleCreator::IsThisShell( const MbFaceShell & shell, const CreatorsVect if ( creators.size() > 0 ) { for ( size_t i = creators.size(); i--; ) { const MbCreator * creator = creators[i]; - if ( (creator != c3d_null) && (creator->IsA() == ct_SimpleCreator) ) { + if ( (creator != nullptr) && (creator->IsA() == ct_SimpleCreator) ) { const MbSimpleCreator & simpleCreator = static_cast(*creator); if ( simpleCreator.GetShell() == &shell ) { res = true; @@ -253,10 +253,10 @@ public : \en \name Common functions of the shell creator. \{ */ virtual MbeCreatorType IsA() const; // \ru Тип элемента \en Type of element - virtual MbCreator & Duplicate( MbRegDuplicate * = c3d_null ) const ; // \ru Сделать копию \en Create a copy - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate about an axis + virtual MbCreator & Duplicate( MbRegDuplicate * = nullptr ) const ; // \ru Сделать копию \en Create a copy + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate about an axis virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта \en Get a name of object property virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта \en Get properties of the object @@ -267,7 +267,7 @@ public : virtual bool IsSimilar ( const MbCreator & ) const; // \ru Являются ли объекты подобными \en Whether the objects are similar virtual bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell, - RPArray * items = c3d_null ); // \ru Построение \en Construction + RPArray * items = nullptr ); // \ru Построение \en Construction /** \} */ DECLARE_PERSISTENT_CLASS_NEW_DEL( MbReverseCreator ) diff --git a/C3d/Include/cr_smooth_solid.h b/C3d/Include/cr_smooth_solid.h index 3f35057..2a9ff67 100644 --- a/C3d/Include/cr_smooth_solid.h +++ b/C3d/Include/cr_smooth_solid.h @@ -41,10 +41,10 @@ public : virtual MbeCreatorType IsA() const = 0; // \ru Тип элемента \en A type of element virtual MbeCreatorType Type() const; // \ru Тип элемента \en A type of element - virtual MbCreator & Duplicate( MbRegDuplicate *iReg = c3d_null ) const = 0; // \ru Сделать копию \en Create a copy - virtual void Transform( const MbMatrix3D &matr, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move( const MbVector3D &to, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate( const MbAxis3D &axis, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate around an axis + virtual MbCreator & Duplicate( MbRegDuplicate *iReg = nullptr ) const = 0; // \ru Сделать копию \en Create a copy + virtual void Transform( const MbMatrix3D &matr, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move( const MbVector3D &to, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate( const MbAxis3D &axis, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate around an axis virtual void GetProperties( MbProperties & ) = 0; // \ru Выдать свойства объекта \en Get properties of the object virtual void SetProperties( const MbProperties & ) = 0; // \ru Записать свойства объекта \en Set properties of the object @@ -57,7 +57,7 @@ public : // \ru Общие функции твердого тела \en Common functions of solid virtual bool CreateShell( MbFaceShell *&shell, MbeCopyMode sameShell, - RPArray * items = c3d_null ) = 0; // \ru Построение \en Construction + RPArray * items = nullptr ) = 0; // \ru Построение \en Construction /// \ru Дать параметры. \en Get the parameters. void GetParameters( SmoothValues & params ) const { params = parameters; } diff --git a/C3d/Include/cr_split_data.h b/C3d/Include/cr_split_data.h index b1d4102..7922df9 100644 --- a/C3d/Include/cr_split_data.h +++ b/C3d/Include/cr_split_data.h @@ -91,7 +91,7 @@ public: , spaceCurves ( ) , surfaces ( ) , creators ( ) - , solidShell ( c3d_null ) + , solidShell ( nullptr ) { } /// \ru Конструктор по двумерному контуру в локальной системе координат. \en Constructor by two-dimensional contour in the local coordinate system. @@ -103,7 +103,7 @@ public: , spaceCurves ( ) , surfaces ( ) , creators ( ) - , solidShell ( c3d_null ) + , solidShell ( nullptr ) { SPtr sketchContour; sketchContour = same ? const_cast(&item) : static_cast(&item.Duplicate()); @@ -118,7 +118,7 @@ public: , spaceCurves ( ) , surfaces ( ) , creators ( ) - , solidShell ( c3d_null ) + , solidShell ( nullptr ) { C3D_ASSERT( (direction.MaxFactor() < LENGTH_EPSILON) || !direction.Orthogonal( place.GetAxisZ(), ANGLE_EPSILON ) ); @@ -136,7 +136,7 @@ public: , spaceCurves ( ) , surfaces ( ) , creators ( ) - , solidShell ( c3d_null ) + , solidShell ( nullptr ) { ::AddRefItems( items, same, sketchContours ); } @@ -150,7 +150,7 @@ public: , spaceCurves ( ) , surfaces ( ) , creators ( ) - , solidShell ( c3d_null ) + , solidShell ( nullptr ) { C3D_ASSERT( (direction.MaxFactor() < LENGTH_EPSILON) || !direction.Orthogonal( place.GetAxisZ(), ANGLE_EPSILON ) ); @@ -165,7 +165,7 @@ public: , spaceCurves ( ) , surfaces ( ) , creators ( ) - , solidShell ( c3d_null ) + , solidShell ( nullptr ) { ::AddRefItems( items, same, spaceCurves ); } @@ -178,7 +178,7 @@ public: , spaceCurves ( ) , surfaces ( ) , creators ( ) - , solidShell ( c3d_null ) + , solidShell ( nullptr ) { ::AddRefItems( items, same, spaceCurves ); } @@ -191,7 +191,7 @@ public: , spaceCurves ( ) , surfaces ( ) , creators ( ) - , solidShell ( c3d_null ) + , solidShell ( nullptr ) { SPtr surface; surface = same ? const_cast(&item) : static_cast(&item.Duplicate()); @@ -206,7 +206,7 @@ public: , spaceCurves ( ) , surfaces ( ) , creators ( ) - , solidShell ( c3d_null ) + , solidShell ( nullptr ) { ::AddRefItems( items, same, surfaces ); } @@ -219,7 +219,7 @@ public: , spaceCurves ( ) , surfaces ( ) , creators ( ) - , solidShell ( c3d_null ) + , solidShell ( nullptr ) { ::AddRefItems( items, same, surfaces ); } @@ -322,12 +322,12 @@ public: DeleteItems(); size_t creatorsCnt = solidCreators.size(); if ( creatorsCnt > 0 ) { - MbRegDuplicate * iReg = c3d_null; + MbRegDuplicate * iReg = nullptr; MbAutoRegDuplicate autoReg( iReg ); SPtr creator; creators.reserve( creatorsCnt ); for ( size_t k = 0; k < creatorsCnt; ++k ) { - if ( solidCreators[k] != c3d_null ) { + if ( solidCreators[k] != nullptr ) { creator = sameCreators ? &const_cast( *solidCreators[k] ) : static_cast( &solidCreators[k]->Duplicate( iReg ) ); creators.push_back( creator ); ::DetachItem( creator ); @@ -343,17 +343,17 @@ public: /// \ru Являются ли объекты подобными. \en Determine whether the objects are similar. bool IsSimilar( const MbSplitData & ) const; /// \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. - void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); + void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); /// \ru Сдвинуть по вектору. \en Shift by a vector. - void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); + void Move ( const MbVector3D &, MbRegTransform * = nullptr ); /// \ru Повернуть вокруг оси. \en Rotate about an axis. - void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); + void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); /// \ru Отсутствуют ли объекты? \en Are the objects absent? bool IsEmpty() const { return ( sketchContours.empty() && spaceCurves.empty() && surfaces.empty() && - (creators.empty() && (solidShell == c3d_null)) ); } + (creators.empty() && (solidShell == nullptr)) ); } /// \ru Являются ли объекты равными? \en Determine whether an object is equal? bool IsSame( const MbSplitData &, double accuracy ) const; @@ -377,9 +377,9 @@ public: /// \ru Установить направление выдавливания двумерных кривых. \en Set extrusion direction of two-dimensional curves. void SetSketchSense( MbeSenseValue zdir ) { sense = zdir; } /// \ru Получить двумерную кривую по индексу. \en Get two-dimensional curve by index. - const MbContour * GetSketchCurve( size_t k ) const { return ((k < sketchContours.size()) ? sketchContours[k].get() : c3d_null ); } + const MbContour * GetSketchCurve( size_t k ) const { return ((k < sketchContours.size()) ? sketchContours[k].get() : nullptr ); } /// \ru Получить двумерную кривую по индексу. \en Get two-dimensional curve by index. - MbContour * SetSketchCurve( size_t k ) { return ((k < sketchContours.size()) ? sketchContours[k].get() : c3d_null ); } + MbContour * SetSketchCurve( size_t k ) { return ((k < sketchContours.size()) ? sketchContours[k].get() : nullptr ); } /// \ru Получить все двумерные кривые. \en Get all two-dimensional curves. template void GetSketchCurves( PlaneContoursVector & curvs ) const @@ -401,9 +401,9 @@ public: /// \ru Выдать количество пространственных кривых. \en Get number of spatial curves. size_t GetSpaceCurvesCount() const { return spaceCurves.size(); } /// \ru Получить пространственную кривую по индексу. \en Get a spatial curve by index. - const MbCurve3D * GetSpaceCurve( size_t k ) const { return ((k < spaceCurves.size()) ? spaceCurves[k].get() : c3d_null ); } + const MbCurve3D * GetSpaceCurve( size_t k ) const { return ((k < spaceCurves.size()) ? spaceCurves[k].get() : nullptr ); } /// \ru Получить пространственную кривую по индексу. \en Get a spatial curve by index. - MbCurve3D * SetSpaceCurve( size_t k ) { return ((k < spaceCurves.size()) ? spaceCurves[k].get() : c3d_null ); } + MbCurve3D * SetSpaceCurve( size_t k ) { return ((k < spaceCurves.size()) ? spaceCurves[k].get() : nullptr ); } /// \ru Получить все пространственные кривые. \en Get all spatial curves. template void GetSpaceCurves( SpaceCurvesVector & curvs ) const @@ -425,9 +425,9 @@ public: /// \ru Выдать количество поверхностей. \en Get number of surfaces. size_t GetSurfacesCount() const { return surfaces.size(); } /// \ru Получить поверхность по индексу. \en Get a surface by index. - const MbSurface * GetSurface( size_t k ) const { return ((k < surfaces.size()) ? surfaces[k].get() : c3d_null); } + const MbSurface * GetSurface( size_t k ) const { return ((k < surfaces.size()) ? surfaces[k].get() : nullptr); } /// \ru Получить поверхность по индексу. \en Get a surface by index. - MbSurface * SetSurface( size_t k ) { return ((k < surfaces.size()) ? surfaces[k].get() : c3d_null); } + MbSurface * SetSurface( size_t k ) { return ((k < surfaces.size()) ? surfaces[k].get() : nullptr); } /// \ru Получить все поверхности. \en Get all surfaces. template void GetSurfaces( SurfacesVector & surfs ) const @@ -449,9 +449,9 @@ public: /// \ru Выдать количество строителей тела. \en Get number of solid creators. size_t GetCreatorsCount() const { return creators.size(); } /// \ru Получить строитель по индексу. \en Get constructor by index. - const MbCreator * GetCreator( size_t k ) const { return ((k < creators.size()) ? creators[k].get() : c3d_null ); } + const MbCreator * GetCreator( size_t k ) const { return ((k < creators.size()) ? creators[k].get() : nullptr ); } /// \ru Получить строитель по индексу. \en Get constructor by index. - MbCreator * SetCreator( size_t k ) { return ((k < creators.size()) ? creators[k].get() : c3d_null ); } + MbCreator * SetCreator( size_t k ) { return ((k < creators.size()) ? creators[k].get() : nullptr ); } /// \ru Получить все строители. \en Get all creators. template void GetCreators( CreatorsVector & crs ) const @@ -468,17 +468,17 @@ public: template void GetCreatorsCopies( CreatorsVector & crs ) const { - MbRegDuplicate * iReg = c3d_null; + MbRegDuplicate * iReg = nullptr; MbAutoRegDuplicate autoReg( iReg ); crs.reserve( crs.size() + creators.size() ); c3d::CreatorSPtr creator; for ( size_t k = 0, addCnt = creators.size(); k < addCnt; ++k ) { - if ( creators[k] != c3d_null ) + if ( creators[k] != nullptr ) creator = static_cast( &creators[k]->Duplicate( iReg ) ); crs.push_back( creator ); ::DetachItem( creator ); - creator = c3d_null; + creator = nullptr; } } /// \ru Получить все строители. \en Get all creators. diff --git a/C3d/Include/cr_split_shell.h b/C3d/Include/cr_split_shell.h index bf977ee..067a7b0 100644 --- a/C3d/Include/cr_split_shell.h +++ b/C3d/Include/cr_split_shell.h @@ -41,10 +41,10 @@ public : // \ru Общие функции математического объекта \en Common functions of the mathematical object virtual MbeCreatorType IsA () const; // \ru Тип элемента \en A type of element - virtual MbCreator & Duplicate( MbRegDuplicate * = c3d_null ) const; - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate around an axis + virtual MbCreator & Duplicate( MbRegDuplicate * = nullptr ) const; + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate around an axis virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта \en Get a name of object property virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта \en Get properties of the object @@ -58,7 +58,7 @@ public : // \ru Общие функции твердого тела \en Common functions of solid virtual bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell, - RPArray * items = c3d_null ); // \ru Построение \en Construction + RPArray * items = nullptr ); // \ru Построение \en Construction private: // \ru Не реализовано \en Not implemented // \ru Объявление конструктора копирования без реализации, чтобы не было копирования по умолчанию. \en Declaration without implementation of the copy-constructor to prevent copying by default. diff --git a/C3d/Include/cr_stamp_bead_solid.h b/C3d/Include/cr_stamp_bead_solid.h index d75828a..12ecdbd 100644 --- a/C3d/Include/cr_stamp_bead_solid.h +++ b/C3d/Include/cr_stamp_bead_solid.h @@ -67,15 +67,15 @@ public: // \ru Общие функции математического объекта \en Common functions of the mathematical object virtual MbeCreatorType IsA () const; // \ru Тип элемента \en A type of element - virtual MbCreator & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию \en Create a copy + virtual MbCreator & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию \en Create a copy virtual bool IsSame ( const MbCreator & other, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal? virtual bool IsSimilar( const MbCreator & item ) const; // \ru Являются ли объекты подобными? \en Determine whether an object is similar? virtual bool SetEqual ( const MbCreator & ); // \ru Сделать равным \en Make equal - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate around an axis + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate around an axis virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта \en Get a name of object property virtual void GetProperties ( MbProperties &properties ); // \ru Выдать свойства объекта \en Get properties of the object @@ -87,7 +87,7 @@ public: // \ru Общие функции твердого тела \en Common functions of solid virtual bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell, - RPArray * items = c3d_null ); // \ru Построение \en Construction + RPArray * items = nullptr ); // \ru Построение \en Construction // \ru Дать параметры. \en Get the parameters. void GetParameters( MbBeadValues & params ) const { params = parameters; } diff --git a/C3d/Include/cr_stamp_jalousie_solid.h b/C3d/Include/cr_stamp_jalousie_solid.h index 5173b53..94a8629 100644 --- a/C3d/Include/cr_stamp_jalousie_solid.h +++ b/C3d/Include/cr_stamp_jalousie_solid.h @@ -66,13 +66,13 @@ public: // \ru Общие функции математического объекта \en Common functions of the mathematical object virtual MbeCreatorType IsA () const; // \ru Тип элемента \en A type of element - virtual MbCreator & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию \en Create a copy + virtual MbCreator & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию \en Create a copy virtual bool IsSame ( const MbCreator & other, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal? virtual bool IsSimilar( const MbCreator & item ) const; // \ru Являются ли объекты подобными? \en Determine whether an object is similar? virtual bool SetEqual ( const MbCreator & ); // \ru Сделать равным \en Make equal - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate around an axis + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate around an axis virtual void GetProperties ( MbProperties &properties ); // \ru Выдать свойства объекта \en Get properties of the object virtual void SetProperties ( const MbProperties &properties ); // \ru Записать свойства объекта \en Set properties of the object @@ -84,7 +84,7 @@ public: // \ru Общие функции твердого тела \en Common functions of solid virtual bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell, - RPArray * items = c3d_null ); // \ru Построение \en Construction + RPArray * items = nullptr ); // \ru Построение \en Construction // \ru Дать параметры. \en Get the parameters. void GetParameters( MbJalousieValues & params ) const { params = parameters; } diff --git a/C3d/Include/cr_stamp_jog_solid.h b/C3d/Include/cr_stamp_jog_solid.h index b3ce5c2..75380d6 100644 --- a/C3d/Include/cr_stamp_jog_solid.h +++ b/C3d/Include/cr_stamp_jog_solid.h @@ -63,13 +63,13 @@ public: // \ru Общие функции математического объекта \en Common functions of the mathematical object virtual MbeCreatorType IsA() const; // \ru Тип элемента \en A type of element - virtual MbCreator & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию \en Create a copy + virtual MbCreator & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию \en Create a copy virtual bool IsSame ( const MbCreator & other, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal? virtual bool IsSimilar( const MbCreator & item ) const; // \ru Являются ли объекты подобными? \en Determine whether an object is similar? virtual bool SetEqual ( const MbCreator & ); // \ru Сделать равным \en Make equal - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate around an axis + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate around an axis virtual void GetProperties( MbProperties & properties ); // \ru Выдать свойства объекта \en Get properties of the object virtual void SetProperties( const MbProperties & properties ); // \ru Записать свойства объекта \en Set properties of the object @@ -82,7 +82,7 @@ public: virtual bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell, - RPArray * items = c3d_null ); // \ru Построение \en Construction + RPArray * items = nullptr ); // \ru Построение \en Construction // \ru Дать параметры. \en Get the parameters. void GetParameters( MbJogValues & params ) const { params = jogParameters; } diff --git a/C3d/Include/cr_stamp_remove_solid.h b/C3d/Include/cr_stamp_remove_solid.h index 00de62a..c35c497 100644 --- a/C3d/Include/cr_stamp_remove_solid.h +++ b/C3d/Include/cr_stamp_remove_solid.h @@ -59,15 +59,15 @@ public: // \ru Общие функции математического объекта \en Common functions of the mathematical object virtual MbeCreatorType IsA() const; // \ru Тип элемента \en Type of element - virtual MbCreator & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию \en Create a copy + virtual MbCreator & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию \en Create a copy virtual bool IsSame ( const MbCreator & other, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal? virtual bool IsSimilar( const MbCreator & item ) const; // \ru Являются ли объекты подобными? \en Determine whether an object is similar? virtual bool SetEqual ( const MbCreator & ); // \ru Сделать равным \en Make equal - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate ( const MbAxis3D &, double, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate about an axis + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate ( const MbAxis3D &, double, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate about an axis virtual void GetProperties( MbProperties & properties ); // \ru Выдать свойства объекта \en Get properties of the object virtual void SetProperties( const MbProperties & properties ); // \ru Записать свойства объекта \en Set properties of the object @@ -77,7 +77,7 @@ public: virtual bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell, - RPArray * items = c3d_null ); // \ru Построение \en Construction + RPArray * items = nullptr ); // \ru Построение \en Construction private: // \ru Объявление оператора присваивания без реализации, чтобы не было присваивания по умолчанию. \en The declaration of the assignment operator without implementation to prevent an assignment by default. diff --git a/C3d/Include/cr_stamp_rib_solid.h b/C3d/Include/cr_stamp_rib_solid.h index 615d611..c6042a5 100644 --- a/C3d/Include/cr_stamp_rib_solid.h +++ b/C3d/Include/cr_stamp_rib_solid.h @@ -46,10 +46,10 @@ public : // \ru Общие функции математического объекта \en Common functions of the mathematical object virtual MbeCreatorType IsA () const; // \ru Тип элемента \en A type of element - virtual MbCreator & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию \en Create a copy - virtual void Transform ( const MbMatrix3D & matr, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move ( const MbVector3D & to, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate ( const MbAxis3D & axis, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate around an axis + virtual MbCreator & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию \en Create a copy + virtual void Transform ( const MbMatrix3D & matr, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move ( const MbVector3D & to, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate ( const MbAxis3D & axis, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate around an axis virtual void GetProperties( MbProperties & properties ); // \ru Выдать свойства объекта \en Get properties of the object virtual void SetProperties( const MbProperties & properties ); // \ru Записать свойства объекта \en Set properties of the object @@ -62,7 +62,7 @@ public : // \ru Общие функции твердого тела \en Common functions of solid virtual bool CreateShell( MbFaceShell *&shell, MbeCopyMode sameShell, - RPArray *items = c3d_null ); // \ru Построение \en Construction + RPArray *items = nullptr ); // \ru Построение \en Construction // \ru Дать параметры. \en Get the parameters. void GetParameters( SheetRibValues & params ) const { params = parameters; } diff --git a/C3d/Include/cr_stamp_ruled_solid.h b/C3d/Include/cr_stamp_ruled_solid.h index 6ddb86a..ad2be8c 100644 --- a/C3d/Include/cr_stamp_ruled_solid.h +++ b/C3d/Include/cr_stamp_ruled_solid.h @@ -49,15 +49,15 @@ public: // \ru Общие функции математического объекта \en Common functions of the mathematical object virtual MbeCreatorType IsA() const; // \ru Тип элемента \en A type of element - virtual MbCreator & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию \en Create a copy + virtual MbCreator & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию \en Create a copy virtual bool IsSame ( const MbCreator & other, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal? virtual bool IsSimilar( const MbCreator & item ) const; // \ru Являются ли объекты подобными? \en Determine whether an object is similar? virtual bool SetEqual ( const MbCreator & ); // \ru Сделать равным \en Make equal - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate around an axis + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate around an axis virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта \en Get properties of the object virtual void SetProperties( const MbProperties & ); // \ru Записать свойства объекта \en Set properties of the object @@ -69,7 +69,7 @@ public: virtual bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell, - RPArray * items = c3d_null ); // \ru Построение \en Construction + RPArray * items = nullptr ); // \ru Построение \en Construction // \ru Дать базовые объекты. \en Get the base objects. virtual void GetBasisItems( RPArray & s ); diff --git a/C3d/Include/cr_stamp_solid.h b/C3d/Include/cr_stamp_solid.h index 546710c..3581b46 100644 --- a/C3d/Include/cr_stamp_solid.h +++ b/C3d/Include/cr_stamp_solid.h @@ -65,15 +65,15 @@ public: // \ru Общие функции математического объекта \en Common functions of the mathematical object virtual MbeCreatorType IsA() const; // \ru Тип элемента \en A type of element - virtual MbCreator & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию \en Create a copy + virtual MbCreator & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию \en Create a copy virtual bool IsSame ( const MbCreator & other, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal? virtual bool IsSimilar( const MbCreator & item ) const; // \ru Являются ли объекты подобными? \en Determine whether an object is similar? virtual bool SetEqual ( const MbCreator & ); // \ru Сделать равным \en Make equal - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate around an axis + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate around an axis virtual void GetProperties ( MbProperties &properties ); // \ru Выдать свойства объекта \en Get properties of the object virtual void SetProperties ( const MbProperties &properties ); // \ru Записать свойства объекта \en Set properties of the object @@ -85,7 +85,7 @@ public: // \ru Общие функции твердого тела \en Common functions of solid virtual bool CreateShell( MbFaceShell *&shell, MbeCopyMode sameShell, - RPArray *items = c3d_null ); // \ru Построение \en Construction + RPArray *items = nullptr ); // \ru Построение \en Construction // \ru Дать параметры. \en Get the parameters. void GetParameters( MbStampingValues & params ) const { params = parameters; } diff --git a/C3d/Include/cr_stamp_spherical_solid.h b/C3d/Include/cr_stamp_spherical_solid.h index f83ff7e..8e12b92 100644 --- a/C3d/Include/cr_stamp_spherical_solid.h +++ b/C3d/Include/cr_stamp_spherical_solid.h @@ -60,15 +60,15 @@ public: // \ru Общие функции математического объекта \en Common functions of the mathematical object virtual MbeCreatorType IsA() const; // \ru Тип элемента \en A type of element - virtual MbCreator & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию \en Create a copy + virtual MbCreator & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию \en Create a copy virtual bool IsSame ( const MbCreator & other, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal? virtual bool IsSimilar( const MbCreator & item ) const; // \ru Являются ли объекты подобными? \en Determine whether an object is similar? virtual bool SetEqual ( const MbCreator & ); // \ru Сделать равным \en Make equal - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate around an axis + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate around an axis virtual void GetProperties ( MbProperties &properties ); // \ru Выдать свойства объекта \en Get properties of the object virtual void SetProperties ( const MbProperties &properties ); // \ru Записать свойства объекта \en Set properties of the object @@ -80,7 +80,7 @@ public: // \ru Общие функции твердого тела \en Common functions of solid virtual bool CreateShell( MbFaceShell *&shell, MbeCopyMode sameShell, - RPArray *items = c3d_null ); // \ru Построение \en Construction + RPArray *items = nullptr ); // \ru Построение \en Construction // \ru Дать параметры. \en Get the parameters. void GetParameters( MbStampingValues & params ) const { params = parameters; } diff --git a/C3d/Include/cr_stamp_user_solid.h b/C3d/Include/cr_stamp_user_solid.h index d27ee72..b9a91f9 100644 --- a/C3d/Include/cr_stamp_user_solid.h +++ b/C3d/Include/cr_stamp_user_solid.h @@ -60,15 +60,15 @@ public: // \ru Общие функции математического объекта. \en Common functions of the mathematical object. virtual MbeCreatorType IsA() const; // \ru Тип элемента. \en A type of element. - virtual MbCreator & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию. \en Create a copy. + virtual MbCreator & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию. \en Create a copy. virtual bool IsSame ( const MbCreator & other, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal? virtual bool IsSimilar( const MbCreator & item ) const; // \ru Являются ли объекты подобными? \en Determine whether an object is similar? virtual bool SetEqual ( const MbCreator & ); // \ru Сделать равным. \en Make equal. - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг. \en Translation. - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси. \en Rotate around an axis. + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг. \en Translation. + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси. \en Rotate around an axis. virtual void GetProperties ( MbProperties &properties ); // \ru Выдать свойства объекта. \en Get properties of the object. virtual void SetProperties ( const MbProperties &properties ); // \ru Записать свойства объекта. \en Set properties of the object. @@ -77,7 +77,7 @@ public: // \ru Общие функции твердого тела. \en Common functions of solid. virtual bool CreateShell( MbFaceShell *&shell, MbeCopyMode sameShell, - RPArray *items = c3d_null ); // \ru Построение оболочки штамповки. \en Construction of a stamping shell. + RPArray *items = nullptr ); // \ru Построение оболочки штамповки. \en Construction of a stamping shell. // \ru Получить параметры. \en Get the parameters. void GetParameters( MbToolStampingValues & params ) const { params = parameters; } diff --git a/C3d/Include/cr_stitch_solid.h b/C3d/Include/cr_stitch_solid.h index 656074d..bc0ceb8 100644 --- a/C3d/Include/cr_stitch_solid.h +++ b/C3d/Include/cr_stitch_solid.h @@ -78,11 +78,11 @@ public : size_t estSimpleCnt = 0; for ( i = 0; i < setsCnt; ++i ) { Creators * creatorsSet = creatorsData[i]; - if ( creatorsSet != c3d_null ) { + if ( creatorsSet != nullptr ) { size_t count = creatorsSet->size(); for ( size_t j = 0; j < count; ++j ) { MbCreator * creator = (*creatorsSet)[j]; - if ( creator != c3d_null ) + if ( creator != nullptr ) estSimpleCnt += creator->GetCreatorsCount( ct_SimpleCreator ); } } @@ -93,13 +93,13 @@ public : c3d::CreatorSPtr creator; for ( i = 0; i < setsCnt; ++i ) { Creators * creatorsSet = creatorsData[i]; - if ( creatorsSet != c3d_null ) { + if ( creatorsSet != nullptr ) { size_t count = creatorsSet->size(); RPArray * creators = new RPArray( count, 1 ); creatorsArray.push_back( creators ); for ( size_t j = 0; j < count; ++j ) { // важен порядок перебора creator = (*creatorsSet)[j]; - if ( creator != c3d_null ) { + if ( creator != nullptr ) { creators->push_back( creator ); if ( creator->IsA() == ct_SimpleCreator ) simpleCreators.push_back( creator ); @@ -125,12 +125,12 @@ public: // \ru Общие функции математического объекта \en Common functions of the mathematical object virtual MbeCreatorType IsA() const; // \ru Тип элемента \en A type of element - virtual MbCreator & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию \en Create a copy + virtual MbCreator & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию \en Create a copy virtual bool IsSame( const MbCreator & other, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal? virtual bool SetEqual ( const MbCreator & ); // \ru Сделать равным \en Make equal - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate around an axis + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate around an axis virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта \en Get properties of the object virtual void SetProperties( const MbProperties & ); // \ru Записать свойства объекта \en Set properties of the object @@ -146,7 +146,7 @@ public: virtual bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell, - RPArray * items = c3d_null ); // \ru Построение \en Construction + RPArray * items = nullptr ); // \ru Построение \en Construction virtual void SetYourVersion( VERSION version, bool forAll ); diff --git a/C3d/Include/cr_surface_spline.h b/C3d/Include/cr_surface_spline.h index d984d2c..6494965 100644 --- a/C3d/Include/cr_surface_spline.h +++ b/C3d/Include/cr_surface_spline.h @@ -60,15 +60,15 @@ public : // \ru Общие функции строителя. \en The common functions of the creator. virtual MbeCreatorType IsA() const; // \ru Тип элемента \en A type of element - virtual MbCreator & Duplicate( MbRegDuplicate * iReg = c3d_null ) const; // \ru Сделать копию \en Create a copy + virtual MbCreator & Duplicate( MbRegDuplicate * iReg = nullptr ) const; // \ru Сделать копию \en Create a copy virtual bool IsSame ( const MbCreator &, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal? virtual bool IsSimilar( const MbCreator & ) const; // \ru Являются ли объекты подобными \en Whether the objects are similar virtual bool SetEqual ( const MbCreator & ); // \ru Сделать равным \en Make equal - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate about an axis + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate about an axis virtual MbePrompt GetPropertyName(); // \ru Дать имя свойства объекта \en Get the object property name virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта \en Get properties of the object @@ -78,7 +78,7 @@ public : virtual void SetBasisPoints( const MbControlData3D & ); // \ru Изменить объект по контрольным точкам. \en Change the object by control points. // \ru Построить кривую по журналу построения \en Create a curve from the history tree - virtual bool CreateWireFrame( MbWireFrame *&, MbeCopyMode, RPArray * items = c3d_null ); + virtual bool CreateWireFrame( MbWireFrame *&, MbeCopyMode, RPArray * items = nullptr ); /** \} */ diff --git a/C3d/Include/cr_swept_solid.h b/C3d/Include/cr_swept_solid.h index fc14a99..3e7e73e 100644 --- a/C3d/Include/cr_swept_solid.h +++ b/C3d/Include/cr_swept_solid.h @@ -78,10 +78,10 @@ public : \{ */ virtual MbeCreatorType IsA() const = 0; // \ru Тип элемента \en A type of element virtual MbeCreatorType Type() const; // \ru Тип элемента \en A type of element - virtual MbCreator & Duplicate( MbRegDuplicate * = c3d_null ) const = 0; // \ru Сделать копию \en Create a copy - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ) = 0; // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ) = 0; // \ru Сдвиг \en Translation - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ) = 0; // \ru Повернуть вокруг оси \en Rotate around an axis + virtual MbCreator & Duplicate( MbRegDuplicate * = nullptr ) const = 0; // \ru Сделать копию \en Create a copy + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ) = 0; // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ) = 0; // \ru Сдвиг \en Translation + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ) = 0; // \ru Повернуть вокруг оси \en Rotate around an axis virtual bool IsSame( const MbCreator &, double accuracy ) const = 0; // \ru Являются ли объекты равными? \en Determine whether an object is equal? virtual bool IsSimilar( const MbCreator & ) const = 0; // \ru Являются ли объекты подобными. \en Whether the objects are similar @@ -99,7 +99,7 @@ public : \en \name Common functions of the rigid solid (forming operations). \{ */ virtual bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell, - RPArray * items = c3d_null ); // \ru Построение \en Construction + RPArray * items = nullptr ); // \ru Построение \en Construction virtual MbFaceShell * InitShell( bool in ) = 0; virtual void InitBasis( RPArray & ) = 0; diff --git a/C3d/Include/cr_symmetry_solid.h b/C3d/Include/cr_symmetry_solid.h index 03e8f13..1cd5ff5 100644 --- a/C3d/Include/cr_symmetry_solid.h +++ b/C3d/Include/cr_symmetry_solid.h @@ -44,10 +44,10 @@ public : // \ru Общие функции математического объекта \en Common functions of the mathematical object virtual MbeCreatorType IsA() const; // \ru Тип элемента \en A type of element - virtual MbCreator & Duplicate( MbRegDuplicate * = c3d_null ) const ; // \ru Сделать копию \en Create a copy - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate around an axis + virtual MbCreator & Duplicate( MbRegDuplicate * = nullptr ) const ; // \ru Сделать копию \en Create a copy + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate around an axis virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта \en Get properties of the object virtual void SetProperties( const MbProperties & ); // \ru Записать свойства объекта \en Set properties of the object @@ -60,7 +60,7 @@ public : // \ru Общие функции твердого тела \en Common functions of solid virtual bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell, - RPArray * items = c3d_null ); // \ru Построение \en Construction + RPArray * items = nullptr ); // \ru Построение \en Construction private : // \ru Объявление оператора присваивания без реализации, чтобы не было присваивания по умолчанию. \en The declaration of the assignment operator without implementation to prevent an assignment by default. diff --git a/C3d/Include/cr_thin_sheet.h b/C3d/Include/cr_thin_sheet.h index 160fc0b..4aaef57 100644 --- a/C3d/Include/cr_thin_sheet.h +++ b/C3d/Include/cr_thin_sheet.h @@ -43,10 +43,10 @@ public : // \ru Общие функции математического объекта \en Common functions of the mathematical object virtual MbeCreatorType IsA() const; // \ru Тип элемента \en Type of element - virtual MbCreator & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию \en Create a copy - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate about an axis + virtual MbCreator & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию \en Create a copy + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate about an axis virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта \en Get properties of the object virtual void SetProperties( const MbProperties & ); // \ru Записать свойства объекта \en Set properties of the object @@ -62,7 +62,7 @@ public : // \ru Общие функции твердого тела \en Common functions of solid solid virtual bool CreateShell( MbFaceShell *&shell, MbeCopyMode sameShell, - RPArray * items = c3d_null ); // \ru Построение \en Construction + RPArray * items = nullptr ); // \ru Построение \en Construction // \ru Дать параметры. \en Get the parameters. void GetParameters( SweptValues & params ) const { params = parameters; } diff --git a/C3d/Include/cr_thin_shell_solid.h b/C3d/Include/cr_thin_shell_solid.h index 9ff8943..a63bda5 100644 --- a/C3d/Include/cr_thin_shell_solid.h +++ b/C3d/Include/cr_thin_shell_solid.h @@ -64,10 +64,10 @@ private : public : // \ru Общие функции математического объекта \en Common functions of the mathematical object virtual MbeCreatorType IsA() const; // \ru Тип элемента \en A type of element - virtual MbCreator & Duplicate( MbRegDuplicate * = c3d_null ) const ; // \ru Сделать копию \en Create a copy - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate around an axis + virtual MbCreator & Duplicate( MbRegDuplicate * = nullptr ) const ; // \ru Сделать копию \en Create a copy + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate around an axis virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта \en Get properties of the object virtual void SetProperties( const MbProperties & ); // \ru Записать свойства объекта \en Set properties of the object @@ -79,7 +79,7 @@ public : // \ru Общие функции твердого тела \en Common functions of solid virtual bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell, - RPArray * items = c3d_null ); // \ru Построение \en Construction + RPArray * items = nullptr ); // \ru Построение \en Construction /// \ru Дать параметры. \en Get the parameters. void GetParameters( SweptValues & params ) const { params = parameters; } diff --git a/C3d/Include/cr_transformed_solid.h b/C3d/Include/cr_transformed_solid.h index 938c151..c6b5628 100644 --- a/C3d/Include/cr_transformed_solid.h +++ b/C3d/Include/cr_transformed_solid.h @@ -43,12 +43,12 @@ public: // \ru Деструктор \en Destructor public: // \ru Общие функции математического объекта \en Common functions of the mathematical object virtual MbeCreatorType IsA() const; // \ru Тип элемента \en A type of element - virtual MbCreator & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию \en Create a copy + virtual MbCreator & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию \en Create a copy virtual bool IsSame( const MbCreator & other, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal? virtual bool SetEqual ( const MbCreator & ); // \ru Сделать равным \en Make equal - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать по матрице \en Transform according to the matrix - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг по вектору \en Translation by a vector - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate around an axis + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать по матрице \en Transform according to the matrix + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг по вектору \en Translation by a vector + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate around an axis virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта \en Get a name of object property virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта \en Get properties of the object @@ -58,7 +58,7 @@ public: // \ru Общие функции математического объе /// \ru Построение оболочки \en Creation of a shell virtual bool CreateShell( MbFaceShell *&, MbeCopyMode sameShell, - RPArray * items = c3d_null ); + RPArray * items = nullptr ); virtual void Refresh( MbFaceShell & ); ///< \ru Обновить форму оболочки \en Update shape of the shell // \ru Добавить модификацию по матрице \en Add a modification by a matrix void AddMatrix( MbFaceShell &, const MbMatrix3D & ); diff --git a/C3d/Include/cr_truncated_shell.h b/C3d/Include/cr_truncated_shell.h index ca2993a..f0801be 100644 --- a/C3d/Include/cr_truncated_shell.h +++ b/C3d/Include/cr_truncated_shell.h @@ -68,11 +68,11 @@ private: public: virtual MbeCreatorType IsA() const; // \ru Тип элемента \en Type of element - virtual MbCreator & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию \en Create a copy + virtual MbCreator & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию \en Create a copy - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate about an axis + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate about an axis virtual void GetProperties( MbProperties & properties ); // \ru Выдать свойства объекта \en Get properties of the object virtual void SetProperties( const MbProperties & properties ); // \ru Записать свойства объекта \en Set properties of the object @@ -90,7 +90,7 @@ public: // \ru Построение оболочки по исходным данным \en Construction of a shell from the given data virtual bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell, - RPArray * items = c3d_null ); + RPArray * items = nullptr ); // \ru Установить номера выбраных граней усекаемого тела \en Set indices of selected faces of the solid being truncated. void SetSelIndices( const std::vector & selInds ); diff --git a/C3d/Include/cr_union_solid.h b/C3d/Include/cr_union_solid.h index 0dd7d06..c4b5076 100644 --- a/C3d/Include/cr_union_solid.h +++ b/C3d/Include/cr_union_solid.h @@ -79,10 +79,10 @@ public : // \ru Общие функции математического объекта \en Common functions of the mathematical object virtual MbeCreatorType IsA() const; // \ru Тип элемента \en A type of element - virtual MbCreator & Duplicate( MbRegDuplicate * = c3d_null ) const ; // \ru Сделать копию \en Create a copy - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate around an axis + virtual MbCreator & Duplicate( MbRegDuplicate * = nullptr ) const ; // \ru Сделать копию \en Create a copy + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate around an axis virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта \en Get a name of object property virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта \en Get properties of the object @@ -102,7 +102,7 @@ public : // \ru Общие функции твердого тела \en Common functions of solid virtual bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell, - RPArray * items = c3d_null ); // \ru Построение \en Construction + RPArray * items = nullptr ); // \ru Построение \en Construction virtual void SetYourVersion( VERSION version, bool forAll ); @@ -115,9 +115,9 @@ public: /// \ru Общее количество строителей. \en Total count of creators. size_t GetCreatorsCount() const { return creators.size(); } /// \ru Дать строитель. \en Get the creator. - const MbCreator * GetCreator( size_t k ) const { return ((k < creators.size()) ? &(*creators[k]) : c3d_null); } + const MbCreator * GetCreator( size_t k ) const { return ((k < creators.size()) ? &(*creators[k]) : nullptr); } /// \ru Дать строитель. \en Get the creator. - MbCreator * SetCreator( size_t k ) { return ((k < creators.size()) ? &(*creators[k]) : c3d_null); } + MbCreator * SetCreator( size_t k ) { return ((k < creators.size()) ? &(*creators[k]) : nullptr); } public: /// \ru Собрать группы общих строителей тел. \en Collect groups of shared creators. @@ -142,8 +142,8 @@ IMPL_PERSISTENT_OPS( MbUnionSolid ) Before the operation a shell set is united into a single shell which contains all the faces of shell set. Union of the intersected shells is performed if necessary. The function simultaneously constructs the shell and creates its constructor. \n \~ - \param[in] solid - \ru Оболочка, с которой выполняется булева операция объединённого множества оболочек (может быть c3d_null). - \en The shell the Boolean operation of the united shell set is performed with (can be c3d_null). \~ + \param[in] solid - \ru Оболочка, с которой выполняется булева операция объединённого множества оболочек (может быть nullptr). + \en The shell the Boolean operation of the united shell set is performed with (can be nullptr). \~ \param[in] sameShell - \ru Способ копирования граней оболочки. \en Method of shell faces copying. \~ \param[in] creators - \ru Строители набора оболочек. @@ -188,7 +188,7 @@ MATH_FUNC (MbCreator *) CreateUnion( MbFaceShell * solid, bool isArray, // \ru Флаг массива \en Flag of array MbResultType & res, MbFaceShell *& shell, - RPArray * notGluedShells = c3d_null ); + RPArray * notGluedShells = nullptr ); //------------------------------------------------------------------------------ diff --git a/C3d/Include/creator.h b/C3d/Include/creator.h index 0f2af4b..f0206b1 100644 --- a/C3d/Include/creator.h +++ b/C3d/Include/creator.h @@ -85,6 +85,7 @@ enum MbeCreatorType { ct_OffsetCurveCreator = 205, ///< \ru Строитель эквидистантной кривой. \en Constructor of the offset curve. ct_IntersectionCurveCreator = 206, ///< \ru Строитель кривой пересечения. \en Constructor of the intersection curve. ct_ConnectingCurveCreator = 207, ///< \ru Строитель кривой скругления двух кривых. \en Constructor of the curve connecting two curves. \n + ct_ExtensionCurveCreator = 208, ///< \ru Строитель удлиняемой кривой. \en Constructor of the extended curve. \n // \ru Строители тел. \en Creators of solids. ct_ShellCreator = 501, ///< \ru Строитель оболочки. \en Constructor of shell. @@ -141,6 +142,7 @@ enum MbeCreatorType { ct_UserStampSolid = 619, ///< \ru Строитель оболочки с штамповкой телом. \en Constructor of a shell with stamping by solid. ct_RemoveOperationSolid = 620, ///< \ru Строитель удаления операции листового тела. \en Constructor of removing of the sheet solid. ct_BuildSheetMetalSolid = 621, ///< \ru Строитель листового тела по произвольному телу. \en Constructor of building sheet metal solid based on an arbitary solid. + ct_NormalizeHolesSolid = 622, ///< \ru Строитель нормализации отверстий листовых тел. \en Constructor of the normalization of the holes of sheet solid. // \ru Строители оболочек. \en Creators of shells. ct_JoinShell = 701, ///< \ru Строитель оболочки соединения. \en Constructor of a joint shell. @@ -251,7 +253,7 @@ public : \return \ru Копия объекта. \en The object copy. \~ */ - virtual MbCreator & Duplicate( MbRegDuplicate * iReg = c3d_null ) const = 0; + virtual MbCreator & Duplicate( MbRegDuplicate * iReg = nullptr ) const = 0; /** \brief \ru Преобразовать согласно матрице. \en Transform according to the matrix. \~ @@ -274,7 +276,7 @@ public : \param[in] iReg - \ru Регистратор. \en Registrator. \~ */ - virtual void Transform( const MbMatrix3D & matr, MbRegTransform * iReg = c3d_null ) = 0; + virtual void Transform( const MbMatrix3D & matr, MbRegTransform * iReg = nullptr ) = 0; /** \brief \ru Сдвинуть вдоль вектора. \en Translate along a vector. \~ @@ -297,7 +299,7 @@ public : \param[in] iReg - \ru Регистратор. \en Registrator. \~ */ - virtual void Move ( const MbVector3D & to, MbRegTransform * iReg = c3d_null ) = 0; + virtual void Move ( const MbVector3D & to, MbRegTransform * iReg = nullptr ) = 0; /** \brief \ru Повернуть объект вокруг оси. \en Rotate an object about the axis. \~ @@ -322,7 +324,7 @@ public : \param[in] iReg - \ru Регистратор. \en Registrator. \~ */ - virtual void Rotate ( const MbAxis3D & axis, double angle, MbRegTransform * iReg = c3d_null ) = 0; + virtual void Rotate ( const MbAxis3D & axis, double angle, MbRegTransform * iReg = nullptr ) = 0; /** \brief \ru Являются ли объекты равными? \en Determine whether an object is equal? \~ @@ -360,13 +362,13 @@ public : \en A shell to be modified or a new shell. \~ \param[in] sameShell - \ru Полнота копирования элементов при построении. \en Whether to perform complete copying of elements while constructing. \~ - \param[in] items - \ru Контейнер для складывания элементов невыполненных построений (может быть c3d_null). - \en Container for the elements of not performed constructions (can be c3d_null). \~ + \param[in] items - \ru Контейнер для складывания элементов невыполненных построений (может быть nullptr). + \en Container for the elements of not performed constructions (can be nullptr). \~ \return \ru Выполнено ли построение. \en Whether the construction is performed. \~ */ virtual bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell, - RPArray * items = c3d_null ); + RPArray * items = nullptr ); /** \brief \ru Построить оболочку по исходным данным. \en Create a shell from the initial data. \~ @@ -376,13 +378,13 @@ public : \en A shell to be modified or a new shell. \~ \param[in] sameShell - \ru Полнота копирования элементов при построении. \en Whether to perform complete copying of elements while constructing. \~ - \param[in] items - \ru Контейнер для складывания элементов невыполненных построений (может быть c3d_null). - \en Container for the elements of not performed constructions (can be c3d_null). \~ + \param[in] items - \ru Контейнер для складывания элементов невыполненных построений (может быть nullptr). + \en Container for the elements of not performed constructions (can be nullptr). \~ \return \ru Выполнено ли построение. \en Whether the construction is performed. \~ */ bool CreateShell( c3d::ShellSPtr & shell, MbeCopyMode sameShell, - RPArray * items = c3d_null ); + RPArray * items = nullptr ); /** \brief \ru Построить проволочный каркас по исходным данным. \en Create a wire-frame from the source data. \~ @@ -392,13 +394,13 @@ public : \en A frame to be modified or a new frame. \~ \param[in] sameShell - \ru Полнота копирования элементов при построении. \en Whether to perform complete copying of elements while constructing. \~ - \param[in] items - \ru Контейнер для складывания элементов невыполненных построений (может быть c3d_null). - \en Container for the elements of not performed constructions (can be c3d_null). \~ + \param[in] items - \ru Контейнер для складывания элементов невыполненных построений (может быть nullptr). + \en Container for the elements of not performed constructions (can be nullptr). \~ \return \ru Выполнено ли построение. \en Whether the construction is performed. \~ */ virtual bool CreateWireFrame( MbWireFrame *& frame, MbeCopyMode sameShell, - RPArray * items = c3d_null ); + RPArray * items = nullptr ); /** \brief \ru Построить проволочный каркас по исходным данным. \en Create a wire-frame from the source data. \~ @@ -421,13 +423,13 @@ public : \en A frame to be modified or a new frame. \~ \param[in] sameShell - \ru Полнота копирования элементов при построении. \en Whether to perform complete copying of elements while constructing. \~ - \param[in] items - \ru Контейнер для складывания элементов невыполненных построений (может быть c3d_null). - \en Container for the elements of not performed constructions (can be c3d_null). \~ + \param[in] items - \ru Контейнер для складывания элементов невыполненных построений (может быть nullptr). + \en Container for the elements of not performed constructions (can be nullptr). \~ \return \ru Выполнено ли построение. \en Whether the construction is performed. \~ */ virtual bool CreatePointFrame( MbPointFrame *& frame, MbeCopyMode sameShell, - RPArray * items = c3d_null ); + RPArray * items = nullptr ); /** \brief \ru Построить точечный каркас по исходным данным. \en Create a point-frame from the source data. \~ diff --git a/C3d/Include/creator_transaction.h b/C3d/Include/creator_transaction.h index bb5a16b..02df239 100644 --- a/C3d/Include/creator_transaction.h +++ b/C3d/Include/creator_transaction.h @@ -68,7 +68,7 @@ public: transactions.reserve( iCount ); for ( size_t i = 0; i < iCount; i++ ) { MbCreator * creator = const_cast( creators[i] ); - if ( creator != c3d_null ) { + if ( creator != nullptr ) { creator->AddRef(); transactions.push_back( creator ); } @@ -84,7 +84,7 @@ public: virtual bool RebuildItem( MbeCopyMode sameShell, RPArray * items, IProgressIndicator * progInd ); /// \ru Очистить присланный журнал и скопировать в него строители. \en Clear the given history tree and copy the creators to it. - void CreatorsCopy ( MbTransactions & other, MbRegDuplicate * iReg = c3d_null ) const; + void CreatorsCopy ( MbTransactions & other, MbRegDuplicate * iReg = nullptr ) const; /// \ru Очистить журнал и скопировать в него строители из присланного журнала. \en Clear the history tree and copy the creators from the given history tree to it. void CreatorsAssign ( const MbTransactions & other ); /// \ru Сделать строители равными соответствующим строителям присланного журнала, если строители подобны. \en Make the creators equal to the creators from the given history tree if the creators are similar. @@ -94,11 +94,11 @@ public: // Посчитать внутренние построители по типу. \en Count internal creators by type. size_t GetCreatorsCount( MbeCreatorType ct ) const; /// \ru Преобразовать согласно матрице строители. \en Transform the creators according to the matrix. - void CreatorsTransform( const MbMatrix3D &, MbRegTransform * = c3d_null ); + void CreatorsTransform( const MbMatrix3D &, MbRegTransform * = nullptr ); /// \ru Сдвинуть вдоль вектора строители. \en Move creators along the vector. - void CreatorsMove ( const MbVector3D &, MbRegTransform * = c3d_null ); + void CreatorsMove ( const MbVector3D &, MbRegTransform * = nullptr ); /// \ru Повернуть вокруг оси строители на заданный угол. \en Rotate the creators about the axis by the given angle. - void CreatorsRotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); + void CreatorsRotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); /// \ru Выдать количество строителей. \en Get the creators count. size_t GetCreatorsCount() const { return transactions.size(); } /// \ru Зарезервировать место для строителей. \en Reserve space for creators. @@ -121,7 +121,7 @@ public: c3d::CreatorSPtr creator; creators.reserve( creators.size() + addCnt ); for ( size_t i = 0; i < addCnt; ++i ) { - if ( transactions[i] != c3d_null ) { + if ( transactions[i] != nullptr ) { creator = static_cast(&transactions[i]->Duplicate( iReg )); creators.push_back( creator ); ::DetachItem( creator ); @@ -145,7 +145,7 @@ public: c3d::CreatorSPtr creator; for ( size_t i = 0, addCnt = creators.size(); i < addCnt; ++i ) { creator = creators[i]; - if ( creator != c3d_null ) { + if ( creator != nullptr ) { creator->AddRef(); transactions.push_back( creator ); ::DetachItem( creator ); diff --git a/C3d/Include/cur_arc.h b/C3d/Include/cur_arc.h index b543bc4..a7cc90f 100644 --- a/C3d/Include/cur_arc.h +++ b/C3d/Include/cur_arc.h @@ -36,7 +36,7 @@ class DiskreteLengthData; Кривая может быть замкнутой. У замкнутой кривой trim2–trim1=2pi. \n Радиус-вектор кривой в методе PointOn(double&t,MbCartPoint3D&r) описывается векторной функцией\n r(t) = position.origin + (a cos(trim1+(sense)t) position.axisX) + (b sin(trim1+(sense)t) position.axisY).\n - Радиусы кривой дожны быть больше нуля: a>0, b>0. \n + Радиусы кривой должны быть больше нуля: a>0, b>0. \n Для параметров усечения должны соблюдаться неравенства: trim1trim2 при sense==-1. \n Локальная система координат position может быть как правой, так и левой. Если локальная система координат правая и sense=+1 или локальная система координат левая и sense=–1, @@ -377,12 +377,12 @@ public : \en \name Common functions of a geometric object. \{ */ virtual MbePlaneType IsA() const; // \ru Тип элемента \en A type of element - virtual MbPlaneItem & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента \en Create a copy of the element + virtual MbPlaneItem & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента \en Create a copy of the element virtual bool IsSame ( const MbPlaneItem & other, double accuracy = LENGTH_EPSILON ) const; virtual bool SetEqual ( const MbPlaneItem & ); // \ru Сделать равным \en Make equal - virtual void Transform( const MbMatrix & matr, MbRegTransform * ireg = c3d_null, const MbSurface * newSurface = c3d_null ); // \ru Преобразовать согласно матрице \en Transform according to the matrix - virtual void Move ( const MbVector &, MbRegTransform * = c3d_null, const MbSurface * newSurface = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate( const MbCartPoint & pnt, const MbDirection & angle, MbRegTransform * = c3d_null, const MbSurface * newSurface = c3d_null ); // \ru Поворот \en Rotation + virtual void Transform( const MbMatrix & matr, MbRegTransform * ireg = nullptr, const MbSurface * newSurface = nullptr ); // \ru Преобразовать согласно матрице \en Transform according to the matrix + virtual void Move ( const MbVector &, MbRegTransform * = nullptr, const MbSurface * newSurface = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate( const MbCartPoint & pnt, const MbDirection & angle, MbRegTransform * = nullptr, const MbSurface * newSurface = nullptr ); // \ru Поворот \en Rotation virtual double DistanceToPoint( const MbCartPoint & ) const;// \ru Расстояние до точки \en Distance to a point virtual bool DistanceToPointIfLess( const MbCartPoint & toP, double & d ) const; // \ru Расстояние до точки, если оно меньше d \en Distance to a point if it is less than 'd' virtual void AddYourGabaritTo( MbRect & r ) const; // \ru Добавь свой габарит в прямой прям-к \en Add own bounding rectangle to an upright bounding rectangle @@ -445,7 +445,7 @@ public : /** \ru \name Общие функции кривой \en \name Common functions of the curve \{ */ - virtual void Inverse( MbRegTransform * iReg = c3d_null ); // \ru Изменить направление \en Change direction + virtual void Inverse( MbRegTransform * iReg = nullptr ); // \ru Изменить направление \en Change direction virtual double GetMetricLength() const; // \ru Выдать метрическую длину кривой \en Get the metric length of the curve virtual double CalculateMetricLength() const; // \ru Посчитать метрическую длину \en Calculate metric length @@ -459,7 +459,7 @@ public : virtual double PointProjection( const MbCartPoint & pnt ) const; // \ru Проекция точки на кривую \en Projection of a point onto the curve virtual bool NearPointProjection( const MbCartPoint & pnt, double xEpsilon, double yEpsilon, - double & t, bool ext, MbRect1D * tRange = c3d_null ) const; // \ru Проекция точки на кривую или её продолжение в области поиска проекции \en Projection of the point onto the curve or its extension in the projection region + double & t, bool ext, MbRect1D * tRange = nullptr ) const; // \ru Проекция точки на кривую или её продолжение в области поиска проекции \en Projection of the point onto the curve or its extension in the projection region // \ru Вычисление всех касательных к кривой из данной точки \en Calculation of all the tangents to the curve from a given point virtual void TangentPoint( const MbCartPoint & pnt, SArray & tFind ) const; // \ru Вычисление всех перпендикуляров к кривой из данной точки \en Calculation of all the perpendiculars to the curve from a given point @@ -523,6 +523,9 @@ public : virtual void Isoclinal( const MbVector & angle, SArray & tFind ) const; // \ru Прямые, проходящие под углом к оси 0X и касательные к кривой \en Lines passing angularly to the 0X axis and tangent to the curve virtual bool GetAxisPoint( MbCartPoint & p ) const; // \ru Точка для построения оси \en A point for the axis construction + // \ru Продлить кривую. \en Extend the curve. \~ + virtual MbResultType Extend( const MbCurveExtensionParameters & parameters, MbCurve *& resCurve ) const; + /// \ru Проверить с заданной точностью, является ли эллипс окружностью. \en Check whether the ellipse is a circle with a given tolerance. bool IsCircle( double eps = PARAM_EPSILON ) const; /** \} */ @@ -949,15 +952,15 @@ public : void Init( const MbCartPoint & pc, const MbCartPoint & p1, const MbCartPoint & p2, int initSense ); // \ru Инициализация по начальной и конечной точкам и 1/2 угла раствора дуги \en Initialization by the starting and end points and 1/2 of the arc opening angle - // \ru Если diskrData != c3d_null, то округлить радиус и скорректировать первую \en If diskrData != c3d_null, then round the radius and correct the first + // \ru Если diskrData != nullptr, то округлить радиус и скорректировать первую \en If diskrData != nullptr, then round the radius and correct the first // \ru Или вторую точку (зависит от correctFirstPnt) \en Or the second point (depends on correctFirstPnt) /** \brief \ru Инициализировать дугу окружность. \en Initialize a circular arc. \~ \details \ru Инициализация происходит по начальной и конечной точкам и 1/2 угла раствора дуги. - Если diskrData != c3d_null, радиус округляется и корректируется первая + Если diskrData != nullptr, радиус округляется и корректируется первая или вторая точка (зависит от correctFirstPnt). \en The initialization is performed by the starting and end points and 1/2 of the arc opening angle. - If diskrData != c3d_null, the radius is rounded and the first + If diskrData != nullptr, the radius is rounded and the first or the second point is corrected (depends on correctFirstPnt). \~ \param[in] a2 - \ru 1/2 угла раствора дуги окружности. \en 1/2 of the circular arc opening angle. \~ @@ -973,7 +976,7 @@ public : correctFirstPnt == true - the first point is to be corrected. \~ */ void Init( double a2, MbCartPoint & p1, MbCartPoint & p2, - const DiskreteLengthData * diskrData = c3d_null, + const DiskreteLengthData * diskrData = nullptr, bool correctFirstPnt = true ); // \ru Инициализация эллипса \en Ellipse initialization /** \brief \ru Инициализировать эллипс. diff --git a/C3d/Include/cur_arc3d.h b/C3d/Include/cur_arc3d.h index 8f94db3..940595e 100644 --- a/C3d/Include/cur_arc3d.h +++ b/C3d/Include/cur_arc3d.h @@ -34,7 +34,7 @@ class MATH_CLASS MbArc; Кривая может быть замкнутой. У замкнутой кривой trim2–trim1=2pi. \n Радиус-вектор кривой в методе PointOn(double&t,MbCartPoint3D&r) описывается векторной функцией\n r(t) = position.origin + (a cos(trim1+t) position.axisX) + (b sin(trim1+t) position.axisY).\n - Радиусы кривой дожны быть больше нуля: a>0, b>0. \n + Радиусы кривой должны быть больше нуля: a>0, b>0. \n Для параметров усечения должны соблюдаться неравенства: trim1 & pnts ) const; // \ru Выдать n точек кривой с равными интервалами по длине дуги \en Get n points of curves equally spaced by the arc length - virtual MbCurve * GetMap( const MbMatrix3D &, MbRect1D * pRgn = c3d_null, - VERSION version = Math::DefaultMathVersion(), bool * coincParams = c3d_null ) const; // \ru Дать плоскую проекцию кривой \en Get a planar projection of a curve + virtual MbCurve * GetMap( const MbMatrix3D &, MbRect1D * pRgn = nullptr, + VERSION version = Math::DefaultMathVersion(), bool * coincParams = nullptr ) const; // \ru Дать плоскую проекцию кривой \en Get a planar projection of a curve virtual MbCurve * GetMapPsp( const MbMatrix3D &, double zNear, - MbRect1D * pRgn = c3d_null ) const; + MbRect1D * pRgn = nullptr ) const; virtual double GetRadius() const; // \ru Дать физический радиус объекта или ноль, если это невозможно. \en Get the physical radius of the object or null if it impossible. virtual bool GetCircleAxis ( MbAxis3D & ) const; // \ru Дать ось кривой \en Get the axis of the curve @@ -429,6 +429,9 @@ public : virtual void GetCentre( MbCartPoint3D & ) const; virtual void GetWeightCentre( MbCartPoint3D & ) const; + // \ru Продлить кривую. \en Extend the curve. \~ + virtual MbResultType Extend( const MbCurveExtensionParameters & parameters, MbCurve3D *& resCurve ) const; + bool Normalize(); ///< \ru Ортонормировать локальную систему координат. \en Orthonormalize the local coordinate system. bool IsPositionNormal() const { return ( !position.IsAffine() ); } bool IsPositionCircular() const { return ( position.IsCircular() ); } diff --git a/C3d/Include/cur_b_spline.h b/C3d/Include/cur_b_spline.h index 3f5ed6f..794763e 100644 --- a/C3d/Include/cur_b_spline.h +++ b/C3d/Include/cur_b_spline.h @@ -56,12 +56,12 @@ public: // \ru Общие функции математического объекта \en The common functions of the mathematical object virtual MbeSpaceType IsA() const; // \ru Тип элемента \en A type of element - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента \en Create a copy of the element + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента \en Create a copy of the element virtual bool IsSame( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const; virtual bool SetEqual( const MbSpaceItem & init ); // \ru Сделать равным \en Make equal - virtual void Transform( const MbMatrix3D & matr, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move( const MbVector3D & to, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate( const MbAxis3D & axis, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate about an axis + virtual void Transform( const MbMatrix3D & matr, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move( const MbVector3D & to, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate( const MbAxis3D & axis, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate about an axis virtual void CalculateMesh( const MbStepData & stepData, const MbFormNote & note, MbMesh & mesh ) const; // \ru Построить полигональную копию mesh. \en Build polygonal copy mesh. virtual void GetProperties( MbProperties & properties ); // \ru Выдать свойства объекта \en Get properties of the object @@ -87,7 +87,7 @@ public: virtual MbNurbs3D * NurbsCurve( const MbCurveIntoNurbsInfo & ) const; - virtual void Inverse( MbRegTransform * iReg = c3d_null ); // \ru Изменить направление \en Change direction + virtual void Inverse( MbRegTransform * iReg = nullptr ); // \ru Изменить направление \en Change direction void CalculateOnePolygon( size_t i, const MbStepData & stepData, MbPolygon3D * polygon ) const; // \ru Pассчитать полигон по параметру T \en Calculate polygon of the parameter T // \ru Расчет весовых функций и их первых, вторых и третьих производных \en Calculation of the weight functions and their first, second and third derivatives diff --git a/C3d/Include/cur_bezier.h b/C3d/Include/cur_bezier.h index 0620e3d..00266d0 100644 --- a/C3d/Include/cur_bezier.h +++ b/C3d/Include/cur_bezier.h @@ -222,10 +222,10 @@ public : virtual MbePlaneType IsA() const; // \ru Тип элемента \en A type of element virtual bool SetEqual( const MbPlaneItem & ); // \ru Сделать элементы равными \en Make the elements equal virtual bool IsSame( const MbPlaneItem & other, double accuracy = LENGTH_EPSILON ) const; // \ru Является ли кривая curve копией данной кривой ? \en Whether the 'curve' curve is duplicate of current curve. - virtual void Transform( const MbMatrix & matr, MbRegTransform * ireg = c3d_null, const MbSurface * newSurface = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move( const MbVector & to, MbRegTransform * = c3d_null, const MbSurface * newSurface = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate( const MbCartPoint & pnt, const MbDirection & angle, MbRegTransform * = c3d_null, const MbSurface * newSurface = c3d_null ); // \ru Поворот \en Rotation - virtual MbPlaneItem & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента \en Create a copy of the element + virtual void Transform( const MbMatrix & matr, MbRegTransform * ireg = nullptr, const MbSurface * newSurface = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move( const MbVector & to, MbRegTransform * = nullptr, const MbSurface * newSurface = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate( const MbCartPoint & pnt, const MbDirection & angle, MbRegTransform * = nullptr, const MbSurface * newSurface = nullptr ); // \ru Поворот \en Rotation + virtual MbPlaneItem & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента \en Create a copy of the element /** \} */ /** \ru \name Функции инициализации сплайна. \en \name Spline initialization functions. @@ -312,7 +312,7 @@ public : virtual MbCurve * Trimmed( double t1, double t2, int sense ) const; virtual MbContour * NurbsContour() const; - virtual void Inverse( MbRegTransform * iReg = c3d_null ); // \ru Изменение направления кривой на противоположное \en Change to the opposite direction of a curve + virtual void Inverse( MbRegTransform * iReg = nullptr ); // \ru Изменение направления кривой на противоположное \en Change to the opposite direction of a curve virtual void GetProperties( MbProperties & properties ); // \ru Выдать свойства объекта \en Get properties of the object virtual void SetProperties( const MbProperties & properties ); // \ru Записать свойства объекта \en Set properties of the object @@ -474,7 +474,7 @@ public : virtual bool DistanceAlong( double & t, double len, int curveDir, double eps = Math::LengthEps, VERSION version = Math::DefaultMathVersion() ) const; - virtual bool IsContinuousDerivative( bool & contLength, bool & contDirect, c3d::DoubleVector * params = c3d_null, double epsilon = EPSILON ) const; // \ru Непрерывна ли первая производная? \en Have the first derivative the continuous? + virtual bool IsContinuousDerivative( bool & contLength, bool & contDirect, c3d::DoubleVector * params = nullptr, double epsilon = EPSILON ) const; // \ru Непрерывна ли первая производная? \en Have the first derivative the continuous? // \ru Устранить разрывы первых производных по длине. \en Eliminate the discontinuities of the first derivative at length. virtual bool SetContinuousDerivativeLength( VERSION version, double epsilon = EPSILON ); diff --git a/C3d/Include/cur_bezier3d.h b/C3d/Include/cur_bezier3d.h index 6695acf..d88e14c 100644 --- a/C3d/Include/cur_bezier3d.h +++ b/C3d/Include/cur_bezier3d.h @@ -112,12 +112,12 @@ public : // \ru Общие функции математического объекта \en The common functions of the mathematical object virtual MbeSpaceType IsA() const; // \ru Тип элемента \en A type of element - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента \en Create a copy of the element + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента \en Create a copy of the element virtual bool IsSame ( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const; virtual bool SetEqual ( const MbSpaceItem & ); // \ru Сделать равным \en Make equal - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Поворот \en Rotation + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Поворот \en Rotation virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта \en Get properties of the object virtual void SetProperties( const MbProperties & ); // \ru Записать свойства объекта \en Set properties of the object @@ -137,14 +137,14 @@ public : virtual double Step( double t, double sag ) const; // \ru Вычисление шага аппроксимации \en Calculate step of approximation virtual double DeviationStep( double t, double angle ) const; - virtual void Inverse( MbRegTransform * iReg = c3d_null ); // \ru Изменить направление \en Change direction + virtual void Inverse( MbRegTransform * iReg = nullptr ); // \ru Изменить направление \en Change direction virtual bool Break( MbBezier3D &, double t1, double t2 ) const; // \ru Разбить на две части \en Split into two parts virtual MbNurbs3D * NurbsCurve( const MbCurveIntoNurbsInfo & ) const; virtual MbCurve3D * NurbsCurve( const MbNurbsParameters & ) const; - virtual MbCurve3D * TrimmBreak( double t1, double t2, int sense ) const; + virtual MbCurve3D * Trimmed( double t1, double t2, int sense ) const; // \ru Дать плоскую кривую и плейсмент, если пространственная кривая плоская (после использования вызывать DeleteItem на двумерную кривую) // \en Give a planar curve and placement, if the spatial curve is planar (after using the DeleteItem must be called for a two-dimensional curve) virtual bool GetPlaneCurve( MbCurve *& curve2d, MbPlacement3D & place, bool saveParams, PlanarCheckParams params = PlanarCheckParams() ) const; @@ -180,8 +180,8 @@ public : ptrdiff_t GetSplinesCount() const { return splinesCount; } // \ru Количество сплайнов \en The number of splines // \ru Функции только 3D кривой \en Function for 3D-curve - virtual MbCurve * GetMap( const MbMatrix3D &, MbRect1D * pRgn = c3d_null, - VERSION version = Math::DefaultMathVersion(), bool * coincParams = c3d_null ) const; // \ru Дать плоскую проекцию кривой \en Get a planar projection of curve + virtual MbCurve * GetMap( const MbMatrix3D &, MbRect1D * pRgn = nullptr, + VERSION version = Math::DefaultMathVersion(), bool * coincParams = nullptr ) const; // \ru Дать плоскую проекцию кривой \en Get a planar projection of curve virtual size_t GetCount() const; @@ -191,7 +191,7 @@ public : virtual bool DistanceAlong( double & t, double len, int curveDir, double eps = Math::metricPrecision, VERSION version = Math::DefaultMathVersion() ) const; - virtual bool IsContinuousDerivative( bool & contLength, bool & contDirect, c3d::DoubleVector * params = c3d_null, double epsilon = EPSILON ) const; // \ru Непрерывна ли первая производная? \en Have the first derivative the continuous? + virtual bool IsContinuousDerivative( bool & contLength, bool & contDirect, c3d::DoubleVector * params = nullptr, double epsilon = EPSILON ) const; // \ru Непрерывна ли первая производная? \en Have the first derivative the continuous? // \ru Устранить разрывы первых производных по длине. \en Eliminate the discontinuities of the first derivative at length. virtual bool SetContinuousDerivativeLength( VERSION version, double epsilon = EPSILON ); diff --git a/C3d/Include/cur_bridge3d.h b/C3d/Include/cur_bridge3d.h index 6b178f6..b7c5f51 100644 --- a/C3d/Include/cur_bridge3d.h +++ b/C3d/Include/cur_bridge3d.h @@ -67,13 +67,13 @@ public: // \ru Общие функции математического объекта \en Common functions of the mathematical object virtual MbeSpaceType IsA() const; // \ru Тип элемента \en A type of element - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента \en Create a copy of the element + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента \en Create a copy of the element virtual bool IsSame ( const MbSpaceItem &, double accuracy = LENGTH_EPSILON ) const; // \ru Является ли объект копией \en Whether the object is a copy virtual bool SetEqual ( const MbSpaceItem & ); // \ru Сделать равным \en Make equal virtual bool IsSimilar( const MbSpaceItem & init ) const; // \ru Сделать элементы равными \en Make the elements equal - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate around an axis + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate around an axis virtual void AddYourGabaritTo( MbCube & ) const; // \ru Добавь свой габарит в куб \en Add own bounding box into a bounding box virtual void Refresh(); // \ru Сбросить все временные данные \en Flush all the temporary data virtual void PrepareIntegralData( const bool forced ) const; // \ru Рассчитать временные (mutable) данные объекта. \en Calculate temporary (mutable) data of an object. @@ -97,7 +97,7 @@ public: virtual void Explore( double & t, bool ext, MbCartPoint3D & pnt, MbVector3D & fir, MbVector3D * sec, MbVector3D * thir ) const; - virtual void Inverse ( MbRegTransform * iReg = c3d_null ); // \ru Изменить направление \en Change direction + virtual void Inverse ( MbRegTransform * iReg = nullptr ); // \ru Изменить направление \en Change direction virtual double Step ( double t, double sag ) const; // \ru Вычисление шага аппроксимации \en Calculation of the approximation step virtual double DeviationStep( double t, double angle ) const; diff --git a/C3d/Include/cur_character_curve.h b/C3d/Include/cur_character_curve.h index 630c735..bd7a9a7 100644 --- a/C3d/Include/cur_character_curve.h +++ b/C3d/Include/cur_character_curve.h @@ -71,12 +71,12 @@ public: // \ru Общие функции геометрического объекта. \en Common functions of a geometric object. virtual MbePlaneType IsA() const; // \ru Тип элемента \en A type of element - virtual MbPlaneItem & Duplicate ( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента \en Create a copy of the element + virtual MbPlaneItem & Duplicate ( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента \en Create a copy of the element virtual bool IsSame ( const MbPlaneItem & other, double accuracy = LENGTH_EPSILON ) const; // \ru Кривая есть копия этой кривой ? \en Is a curve a copy of this curve? virtual bool SetEqual ( const MbPlaneItem & ); // \ru Сделать равным \en Make equal - virtual void Transform( const MbMatrix &, MbRegTransform * = c3d_null, const MbSurface * newSurface = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move ( const MbVector &, MbRegTransform * = c3d_null, const MbSurface * newSurface = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate ( const MbCartPoint & pnt, const MbDirection & angle, MbRegTransform * = c3d_null, const MbSurface * newSurface = c3d_null ); // \ru Повернуть вокруг оси \en Rotate around an axis + virtual void Transform( const MbMatrix &, MbRegTransform * = nullptr, const MbSurface * newSurface = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move ( const MbVector &, MbRegTransform * = nullptr, const MbSurface * newSurface = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate ( const MbCartPoint & pnt, const MbDirection & angle, MbRegTransform * = nullptr, const MbSurface * newSurface = nullptr ); // \ru Повернуть вокруг оси \en Rotate around an axis virtual void AddYourGabaritTo( MbRect & ) const; // \ru Добавь в прям-к свой габарит \en Add own bounding rectangle to the bounding rectangle virtual void PrepareIntegralData( const bool forced ) const; // \ru Рассчитать временные (mutable) данные объекта. \en Calculate temporary (mutable) data of an object. @@ -103,7 +103,7 @@ public: virtual double GetLengthEvaluation() const; // \ru Оценка метрической длины кривой \en Metric length evaluation of a curve virtual void CalculateGabarit( MbRect & ) const; // \ru Определить габаритный прямоугольник кривой. - virtual void Inverse ( MbRegTransform * iReg = c3d_null ); // \ru Изменить направление \en Change direction + virtual void Inverse ( MbRegTransform * iReg = nullptr ); // \ru Изменить направление \en Change direction virtual size_t GetCount () const; // \ru Определить количество разбиений для прохода в операциях. \en Define the number of splittings for one passage in operations. virtual MbNurbs * NurbsCurve ( const MbCurveIntoNurbsInfo & ) const; diff --git a/C3d/Include/cur_character_curve3d.h b/C3d/Include/cur_character_curve3d.h index 2fd24e3..8885f0e 100644 --- a/C3d/Include/cur_character_curve3d.h +++ b/C3d/Include/cur_character_curve3d.h @@ -79,12 +79,12 @@ public: VISITING_CLASS( MbCharacterCurve3D ) virtual MbeSpaceType IsA () const; // \ru Тип элемента \en A type of element - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента \en Create a copy of the element + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента \en Create a copy of the element virtual bool IsSame ( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const; // \ru Кривая есть копия этой кривой ? \en Is a curve a copy of this curve? virtual bool SetEqual ( const MbSpaceItem & ); // \ru Сделать равным \en Make equal - virtual void Transform ( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate around an axis + virtual void Transform ( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate around an axis virtual void AddYourGabaritTo( MbCube & ) const; virtual void PrepareIntegralData( const bool forced ) const; // \ru Рассчитать временные (mutable) данные объекта. \en Calculate temporary (mutable) data of an object. @@ -110,7 +110,7 @@ public: virtual double Step ( double t, double sag ) const; ///< \ru Вычисление шага параметра по величине прогиба кривой \en Calculation of parameter step by value of sag of the curve virtual double DeviationStep( double t, double ang ) const; ///< \ru Вычисление шага параметра по углу отклонения касательной \en Calculation of parameter by the angle of tangent deviation - virtual void Inverse( MbRegTransform * iReg = c3d_null ); // \ru Изменить направление \en Change direction + virtual void Inverse( MbRegTransform * iReg = nullptr ); // \ru Изменить направление \en Change direction virtual double GetMetricLength() const; // \ru Метрическая длина кривой \en Metric length of a curve virtual double GetLengthEvaluation() const; @@ -118,8 +118,8 @@ public: virtual bool GetPlacement( MbPlacement3D & place, PlanarCheckParams params = PlanarCheckParams() ) const; // \ru Заполнить плейсемент, если кривая плоская \en Fill the placement if curve is planar // \ru Дать плоскую кривую и плейсмент, если пространственная кривая плоская (после использования вызывать DeleteItem на двумерную кривую) \en Get a planar curve and placement, if the spatial curve is planar (after using the DeleteItem must be called on a three-dimensional curve) virtual bool GetPlaneCurve ( MbCurve *& curve2d, MbPlacement3D & place, bool saveParams, PlanarCheckParams params = PlanarCheckParams() ) const; - virtual MbCurve * GetMap( const MbMatrix3D & into, MbRect1D * pRegion = c3d_null, - VERSION version = Math::DefaultMathVersion(), bool * coincParams = c3d_null ) const; // \ru Дать плоскую проекцию кривой \en Get a planar projection of curve + virtual MbCurve * GetMap( const MbMatrix3D & into, MbRect1D * pRegion = nullptr, + VERSION version = Math::DefaultMathVersion(), bool * coincParams = nullptr ) const; // \ru Дать плоскую проекцию кривой \en Get a planar projection of curve // \ru Определить количество разбиений для прохода в операциях. \en Define the number of splittings for one passage in operations. virtual size_t GetCount() const; virtual MbNurbs3D * NurbsCurve( const MbCurveIntoNurbsInfo & ) const; diff --git a/C3d/Include/cur_cone_spiral.h b/C3d/Include/cur_cone_spiral.h index 61cd5da..b41d523 100644 --- a/C3d/Include/cur_cone_spiral.h +++ b/C3d/Include/cur_cone_spiral.h @@ -197,7 +197,7 @@ public: public: // \ru Общие функции математического объекта. \en The common functions of the mathematical object. virtual MbeSpaceType IsA() const; // \ru Получить тип. \en Get a type. - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Создать копию. \en Create a copy. + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Создать копию. \en Create a copy. virtual bool IsSame( const MbSpaceItem &, double accuracy = LENGTH_EPSILON ) const; virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта. \en Get properties of the object. @@ -223,18 +223,18 @@ public: virtual double DeviationStep( double t, double angle ) const; // \ru Вычисление шага по углу отклонения нормали. \en Calculation of parameter step by the deviation angle. virtual double MetricStep ( double t, double length ) const; // \ru Вычисление шага параметра по длине. \en Calculation of parameter step by the given length. - virtual MbCurve * GetMap( const MbMatrix3D &, MbRect1D * pRgn = c3d_null, - VERSION version = Math::DefaultMathVersion(), bool * coincParams = c3d_null ) const; + virtual MbCurve * GetMap( const MbMatrix3D &, MbRect1D * pRgn = nullptr, + VERSION version = Math::DefaultMathVersion(), bool * coincParams = nullptr ) const; virtual MbCurve3D * Trimmed( double t1, double t2, int sense ) const; // \ru Создание усеченной кривой. \en Creation of a trimmed curve. - virtual void Inverse( MbRegTransform * = c3d_null ); // \ru Изменить направление. \en Change the direction. + virtual void Inverse( MbRegTransform * = nullptr ); // \ru Изменить направление. \en Change the direction. virtual MbNurbs3D * NurbsCurve( const MbCurveIntoNurbsInfo & ) const; virtual double CalculateLength( double t1, double t2 ) const; // \ru Ближайшая проекция точки на спираль. \en The nearest point projection on the spiral. - virtual bool NearPointProjection( const MbCartPoint3D & p, double & t, bool ext, MbRect1D * tRange = c3d_null ) const; + virtual bool NearPointProjection( const MbCartPoint3D & p, double & t, bool ext, MbRect1D * tRange = nullptr ) const; // \ru Частные функции спирали. \en Special functions for spiral. virtual bool SetStep( double s ); // \ru Изменить шаг. \en Change the step. diff --git a/C3d/Include/cur_contour.h b/C3d/Include/cur_contour.h index 8d7d49f..80c5afe 100644 --- a/C3d/Include/cur_contour.h +++ b/C3d/Include/cur_contour.h @@ -102,13 +102,13 @@ public: virtual MbePlaneType IsA() const; // \ru Тип элемента \en A type of element virtual MbePlaneType Type() const; // \ru Тип элемента \en A type of element - virtual MbPlaneItem & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента \en Create a copy of the element. + virtual MbPlaneItem & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента \en Create a copy of the element. virtual bool IsSimilar ( const MbPlaneItem & ) const; // \ru Являются ли элементы подобными \en Whether the elements are similar. virtual bool SetEqual( const MbPlaneItem & ); // \ru Сделать элементы равными \en Make equal elements. virtual bool IsSame( const MbPlaneItem &, double accuracy = LENGTH_EPSILON ) const; // \ru Является ли кривая curve копией данной кривой ? \en Whether the curve "curve" is a copy of a given curve? - virtual void Transform( const MbMatrix &, MbRegTransform * ireg = c3d_null, const MbSurface * newSurface = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix. - virtual void Move( const MbVector &, MbRegTransform * = c3d_null, const MbSurface * newSurface = c3d_null ); // \ru Сдвиг \en Translation. - virtual void Rotate( const MbCartPoint &, const MbDirection & angle, MbRegTransform * = c3d_null, const MbSurface * newSurface = c3d_null ); // \ru Поворот \en Rotation. + virtual void Transform( const MbMatrix &, MbRegTransform * ireg = nullptr, const MbSurface * newSurface = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix. + virtual void Move( const MbVector &, MbRegTransform * = nullptr, const MbSurface * newSurface = nullptr ); // \ru Сдвиг \en Translation. + virtual void Rotate( const MbCartPoint &, const MbDirection & angle, MbRegTransform * = nullptr, const MbSurface * newSurface = nullptr ); // \ru Поворот \en Rotation. /** \brief \ru Построить эквидистантную кривую, смещённую на заданное расстояние. \en Construct the equidistant curve which is shifted by the given value. \~ @@ -128,8 +128,8 @@ public: You can use the OffsetContour function instead this function. \~ \param[in] rad - \ru Величина эквидистантного смещения. \en Equidistant offset. \~ - \return \ru Возвращает эквидистантный контур, если получилось его построить, иначе - c3d_null. - \en Returns the equidistant curve if it's possible to build it, otherwise - c3d_null. \~ + \return \ru Возвращает эквидистантный контур, если получилось его построить, иначе - nullptr. + \en Returns the equidistant curve if it's possible to build it, otherwise - nullptr. \~ */ virtual MbCurve * Offset( double rad ) const; // \ru Смещение контура. \en Shift of a contour @@ -300,7 +300,7 @@ public: virtual double PointProjection( const MbCartPoint & ) const; // \ru Проекция точки на кривую \en Point projection on the curve virtual bool NearPointProjection( const MbCartPoint &, double xEpsilon, double yEpsilon, - double & t, bool ext, MbRect1D * tRange = c3d_null ) const; // \ru Проекция точки на кривую или её продолжение в области поиска проекции \en Point projection on the curve or its extension in the projection search area + double & t, bool ext, MbRect1D * tRange = nullptr ) const; // \ru Проекция точки на кривую или её продолжение в области поиска проекции \en Point projection on the curve or its extension in the projection search area /** \brief \ru Параметрическое расстояние до ближайшей границы. \en Parametric distance to the nearest boundary. @@ -416,7 +416,7 @@ public: void SetSense( int sense ); // \ru Изменить направление обхода контура \en Change the traverse direction of the contour - virtual void Inverse( MbRegTransform * = c3d_null ); + virtual void Inverse( MbRegTransform * = nullptr ); // \ru Согласовать параметризацию сегментов, если до инвертации она была согласованной. \en Agree on segment parameterization, if it was consistent before inversion. bool NormalizeReparametrization(); virtual size_t GetCount() const; // \ru Количество разбиений для прохода в операциях \en The number of partitions for passage in the operations @@ -464,7 +464,7 @@ public: \param[in] epsilon - \ru Погрешность вычисления. \en The accuracy of the calculation. \~ */ - virtual bool IsContinuousDerivative( bool & contLength, bool & contDirect, c3d::DoubleVector * params = c3d_null, double epsilon = EPSILON ) const; + virtual bool IsContinuousDerivative( bool & contLength, bool & contDirect, c3d::DoubleVector * params = nullptr, double epsilon = EPSILON ) const; /** \brief \ru Устранить разрывы производных по длине в стыках сегментов. \en Eliminate the discontinuities of the derivatives of the length of the joints of the segments. @@ -477,9 +477,10 @@ public: */ virtual bool SetContinuousDerivativeLength( VERSION version, double epsilon = EPSILON ); - /// \ru Получить границы участков кривой, которые описываются одной аналитической функцией. - /// \en Get the boundaries of the curve sections that are described by one analytical function. \~ + /// \ru Получить границы участков кривой, которые описываются одной аналитической функцией. \en Get the boundaries of the curve sections that are described by one analytical function. \~ virtual void GetAnalyticalFunctionsBounds( std::vector & params ) const; + /// \ ru Определение точек излома контура. \en The determination of contour smoothness break points. + virtual void BreakPoints( std::vector & vBreaks, double precision = ANGLE_REGION ) const; /** \} */ /** \ru \name Функции работы с сегментами контура @@ -778,13 +779,13 @@ void MbContour::GetCornerParams( Params & params ) const double pLength = 0.0; const MbCurve * segment = GetSegment( 0 ); - if ( segment != c3d_null ) + if ( segment != nullptr ) pLength = segment->GetParamLength(); for ( size_t segInd = 1; segInd < segCount; ++segInd ) { params.push_back( pLength ); segment = GetSegment( segInd ); - if ( segment != c3d_null ) + if ( segment != nullptr ) pLength += segment->GetParamLength(); } } diff --git a/C3d/Include/cur_contour3d.h b/C3d/Include/cur_contour3d.h index a39486e..1abcaa6 100644 --- a/C3d/Include/cur_contour3d.h +++ b/C3d/Include/cur_contour3d.h @@ -92,13 +92,13 @@ public: virtual MbeSpaceType IsA() const; // \ru Тип элемента \en Type of element virtual MbeSpaceType Type() const; // \ru Групповой тип элемента \en Group element type - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента \en Create a copy of the element + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента \en Create a copy of the element virtual bool IsSame ( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const; // \ru Является ли объект копией \en Whether the object is a copy virtual bool SetEqual ( const MbSpaceItem & ); // \ru Сделать равным \en Make equal virtual bool IsSimilar( const MbSpaceItem & ) const; // \ru Являются ли объекты подобными \en Whether the objects are similar - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate about an axis + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate about an axis virtual double DistanceToPoint( const MbCartPoint3D & ) const; // \ru Расстояние до точки \en Distance to a point virtual void PrepareIntegralData( const bool forced ) const; // \ru Рассчитать временные (mutable) данные объекта. \en Calculate temporary (mutable) data of an object. @@ -172,7 +172,7 @@ public: virtual MbNurbs3D * NurbsCurve( const MbCurveIntoNurbsInfo & ) const; virtual MbCurve3D * Trimmed( double t1, double t2, int sense ) const; // \ru Создание усеченной кривой \en Creation of a trimmed curve // \ru Изменить направление \en Change direction - virtual void Inverse( MbRegTransform * iReg = c3d_null ); + virtual void Inverse( MbRegTransform * iReg = nullptr ); // \ru Согласовать параметризацию сегментов, если до инвертации она была согласованной. \en Agree on segment parameterization, if it was consistent before inversion. bool NormalizeReparametrization(); /// \ru Подобные ли кривые для объединения (слива). \en Whether the curves to union (joining) are similar. @@ -180,7 +180,7 @@ public: // \ru Все проекции точки на кривую \en All point projections on the curve // \ru Ближайшая проекция точки на кривую \en The nearest point projection to the curve - virtual bool NearPointProjection( const MbCartPoint3D &, double & t, bool ext, MbRect1D * tRange = c3d_null ) const; + virtual bool NearPointProjection( const MbCartPoint3D &, double & t, bool ext, MbRect1D * tRange = nullptr ) const; virtual double CalculateMetricLength() const; // \ru Посчитать метрическую длину \en Calculate the metric length virtual double CalculateLength( double t1, double t2 ) const; @@ -190,8 +190,8 @@ public: virtual void CalculateLocalGabarit( const MbMatrix3D &, MbCube & ) const; // \ru Рассчитать габарит относительно л.с.к. \en Calculate bounding box relative to the local coordinate system. virtual void CalculateGabarit( MbCube & ) const; // \ru Вычислить габарит кривой \en Calculate the bounding box of curve - virtual MbCurve * GetMap( const MbMatrix3D &, MbRect1D * pRgn = c3d_null, - VERSION version = Math::DefaultMathVersion(), bool * coincParams = c3d_null ) const; // \ru Дать плоскую проекцию кривой \en Get a planar projection of curve + virtual MbCurve * GetMap( const MbMatrix3D &, MbRect1D * pRgn = nullptr, + VERSION version = Math::DefaultMathVersion(), bool * coincParams = nullptr ) const; // \ru Дать плоскую проекцию кривой \en Get a planar projection of curve virtual MbCurve * GetProjection( const MbPlacement3D & place, VERSION version ) const; // \ru Дать проекцию ребра на плоскость. \en Get the edge projection onto plane. virtual size_t GetCount() const; @@ -231,7 +231,7 @@ public: \param[in] epsilon - \ru Погрешность вычисления. \en The accuracy of the calculation. \~ */ - virtual bool IsContinuousDerivative( bool & contLength, bool & contDirect, c3d::DoubleVector * params = c3d_null, double epsilon = EPSILON ) const; + virtual bool IsContinuousDerivative( bool & contLength, bool & contDirect, c3d::DoubleVector * params = nullptr, double epsilon = EPSILON ) const; /** \brief \ru Устранить разрывы производных по длине в стыках сегментов. \en Eliminate the discontinuities of the derivatives of the length of the joints of the segments. @@ -244,11 +244,12 @@ public: */ virtual bool SetContinuousDerivativeLength( VERSION version, double epsilon = EPSILON ); - /// \ru Получить границы участков кривой, которые описываются одной аналитической функцией. - /// \en Get the boundaries of the curve sections that are described by one analytical function. \~ + /// \ru Получить границы участков кривой, которые описываются одной аналитической функцией. \en Get the boundaries of the curve sections that are described by one analytical function. \~ virtual void GetAnalyticalFunctionsBounds( std::vector & params ) const; /// \ru Найти все особые точки функции кривизны кривой. \en Find all the special points of the curvature function of the curve. virtual void GetCurvatureSpecialPoints( std::vector & points ) const; + /// \ ru Определение точек излома контура. \en The determination of contour smoothness break points. + virtual void BreakPoints( std::vector & vBreaks, double precision = ANGLE_REGION ) const; /** \} */ /** \ru \name Функции работы с сегментами контура @@ -406,11 +407,11 @@ MbContour3D::MbContour3D( const CurvesVector & initSegments, bool sameCurves ) const size_t count = initSegments.size(); if ( count > 0 ) { - MbRegDuplicate * ireg = c3d_null; + MbRegDuplicate * ireg = nullptr; MbAutoRegDuplicate autoreg( ireg ); for ( size_t i = 0; i < count; ++i ) { const MbCurve3D * initSegment = initSegments[i]; - if ( initSegment != c3d_null ) { + if ( initSegment != nullptr ) { C3D_ASSERT( initSegment->GetSubstrate().Type() != st_Contour3D ); // \ru Использование контура не по назначению. \en Wrong contour use as contours container. //if ( initSegment->Type() == st_Contour3D ) { // \ru Присланный контур удаляет владелец. \en contour should be deleted by owner. // const MbContour3D * cntr = static_cast( initSegment ); @@ -418,7 +419,7 @@ MbContour3D::MbContour3D( const CurvesVector & initSegments, bool sameCurves ) // size_t cnt = contour->segments.size(); // for ( size_t j = 0; j < cnt; j++ ) { // MbCurve3D * seg = contour->segments[j]; - // if ( seg != c3d_null ) { + // if ( seg != nullptr ) { // MbCurve3D * segment = sameCurves ? seg : static_cast(&seg->Duplicate(ireg)); // segments.push_back( segment ); // segment->AddRef(); @@ -448,12 +449,12 @@ bool MbContour3D::Init( const CurvesVector & initSegments, bool sameCurves, bool if ( count > 0 ) { ::AddRefItems( initSegments ); DeleteSegments(); - MbRegDuplicate * ireg = c3d_null; + MbRegDuplicate * ireg = nullptr; MbAutoRegDuplicate autoreg( ireg ); segments.reserve( count ); for ( size_t i = 0; i < count; ++i ) { const MbCurve3D * initSegment = initSegments[i]; - if ( initSegment != c3d_null ) { + if ( initSegment != nullptr ) { C3D_ASSERT( initSegment->GetSubstrate().Type() != st_Contour3D ); // \ru Использование контура не по назначению. \en Wrong contour use as contours container. //if ( initSegment->Type() == st_Contour3D ) { // \ru Присланный контур удаляет владелец. \en contour should be deleted by owner. // const MbContour3D * cntr = static_cast( initSegment ); @@ -461,7 +462,7 @@ bool MbContour3D::Init( const CurvesVector & initSegments, bool sameCurves, bool // size_t cnt = contour->segments.size(); // for ( size_t j = 0; j < cnt; j++ ) { // MbCurve3D * seg = contour->segments[j]; - // if ( seg != c3d_null ) { + // if ( seg != nullptr ) { // MbCurve3D * segment = sameCurves ? seg : static_cast(&seg->Duplicate(ireg)); // segments.push_back( segment ); // segment->AddRef(); @@ -520,7 +521,7 @@ void MbContour3D::GetSegments( CurvesVector & curves ) const SPtr curve; for ( size_t k = 0; k < segmentsCnt; ++k ) { curve = const_cast(segments[k]); - if ( curve != c3d_null ) { + if ( curve != nullptr ) { curves.push_back( curve ); ::DetachItem( curve ); } diff --git a/C3d/Include/cur_contour_on_plane.h b/C3d/Include/cur_contour_on_plane.h index dfa9009..f0dfffd 100644 --- a/C3d/Include/cur_contour_on_plane.h +++ b/C3d/Include/cur_contour_on_plane.h @@ -63,7 +63,7 @@ public : // \ru Общие функции математического объекта. \en The common functions of the mathematical object. virtual MbeSpaceType IsA() const; // \ru Дать тип элемента. \en Get a type of the element. - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const ; // \ru Сделать копию элемента. \en Create a copy of the element. + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const ; // \ru Сделать копию элемента. \en Create a copy of the element. virtual MbContourOnSurface & CurvesDuplicate() const; // \ru Сделать копию со старой подложкой. \en Make a copy with old substrate. virtual bool IsSame( const MbSpaceItem &, double accuracy = LENGTH_EPSILON ) const; // \ru Определить, является ли копией данного объекта? \en Determine whether the object is copy of a given object. @@ -112,8 +112,8 @@ public : virtual bool IsStraight( bool ignoreParams = false ) const; // \ru Определить, является ли линия прямолинейной? \en Determine whether the line is straight. - virtual MbCurve * GetMap( const MbMatrix3D &, MbRect1D *pRgn = c3d_null, - VERSION version = Math::DefaultMathVersion(), bool * coincParams = c3d_null ) const; // \ru Дать плоскую проекцию кривой. \en Get a planar projection of curve. + virtual MbCurve * GetMap( const MbMatrix3D &, MbRect1D *pRgn = nullptr, + VERSION version = Math::DefaultMathVersion(), bool * coincParams = nullptr ) const; // \ru Дать плоскую проекцию кривой. \en Get a planar projection of curve. virtual void GetPointsByEvenLengthDelta( size_t n, std::vector & pnts ) const; // \ru Выдать n точек кривой с равными интервалами по длине дуги. \en Get n points of curve with equal intervals along the length of the arc. @@ -129,7 +129,7 @@ public : /// \ru Заменить локальную систему координат плоскости. \en Replace the local coordinate system of a plane. void SetPlacement( const MbPlacement3D & ); /// \ru Инвертировать нормаль плоскости. \en Invert the normal of plane. - void InvertNormal( MbRegTransform * = c3d_null ); + void InvertNormal( MbRegTransform * = nullptr ); private: void operator = ( const MbContourOnPlane & ); // \ru Не реализовано !!! \en Not implemented !!! diff --git a/C3d/Include/cur_contour_on_surface.h b/C3d/Include/cur_contour_on_surface.h index 20f35d5..1c28b59 100644 --- a/C3d/Include/cur_contour_on_surface.h +++ b/C3d/Include/cur_contour_on_surface.h @@ -58,8 +58,8 @@ typedef std::vector ConstContourOnSurfaceSPtrVector; class MATH_CLASS MbContourOnSurface : public MbCurve3D { protected : - MbSurface * surface; ///< \ru Указатель на базовую поверхность (всегда не c3d_null). \en The pointer to the base surface (this value is never c3d_null). - MbContour * contour; ///< \ru Указатель на 2D-контур в плоскости параметров поверхности (всегда не c3d_null). \en The pointer to 2D-contour in the plane of the surface parameters (this value is never c3d_null). + MbSurface * surface; ///< \ru Указатель на базовую поверхность (всегда не nullptr). \en The pointer to the base surface (this value is never nullptr). + MbContour * contour; ///< \ru Указатель на 2D-контур в плоскости параметров поверхности (всегда не nullptr). \en The pointer to 2D-contour in the plane of the surface parameters (this value is never nullptr). mutable double area; ///< \ru Площадь 2D-контура со знаком. \en The area of 2D-contour with sign. mutable MbCube cube; ///< \ru Габаритный куб. \en Bounding box. mutable double metricLength; ///< \ru Метрическая длина. \en The metric length. @@ -113,15 +113,15 @@ public : virtual MbeSpaceType IsA() const; // \ru Дать тип элемента. \en Get a type of the element. virtual MbeSpaceType Type() const; // \ru Дать тип элемента. \en Get a type of the element. - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента. \en Create a copy of the element. + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента. \en Create a copy of the element. /// \ru Сделать копию на той же поверхности. \en Create a copy on the same surface. virtual MbContourOnSurface & CurvesDuplicate() const; virtual bool IsSame ( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const; // \ru Определить, является ли копией данного объекта? \en Determine whether the object is copy of a given object. virtual bool SetEqual ( const MbSpaceItem & ); // \ru Сделать равным. \en Make equal. virtual bool IsSimilar( const MbSpaceItem & ) const; // \ru Определить, являются ли объекты подобными. \en Determine whether the objects are similar. - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвинуть вдоль вектора. \en Move along a vector. - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси. \en Rotate around an axis. + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвинуть вдоль вектора. \en Move along a vector. + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси. \en Rotate around an axis. virtual double DistanceToPoint( const MbCartPoint3D & ) const; // \ru Вычислить расстояние до точки. \en Calculate the distance to a point. virtual void AddYourGabaritTo( MbCube &r ) const; // \ru Добавить габарит в куб. \en Add bounding box into a cube. virtual void CalculateMesh( const MbStepData & stepData, const MbFormNote & note, MbMesh & mesh ) const; // \ru Построить полигональную копию mesh. \en Build polygonal copy mesh. @@ -154,7 +154,7 @@ public : MbCartPoint3D & pnt, MbVector3D & fir, MbVector3D * sec, MbVector3D * thir ) const; /// \ru Изменить ориентацию контура относительно поверхности. \en Change the contour orientation relative to a surface. - virtual void Inverse( MbRegTransform * iReg = c3d_null ); + virtual void Inverse( MbRegTransform * iReg = nullptr ); virtual MbNurbs3D * NurbsCurve( const MbCurveIntoNurbsInfo & ) const; // \ru Установить параметры NURBS. \en Set the NURBS parameters. @@ -190,23 +190,24 @@ public : // \ru Заполнить плейсмент, если кривая плоская. \en Fill the placement if curve is planar. virtual bool GetPlacement( MbPlacement3D & place, PlanarCheckParams params = PlanarCheckParams() ) const; - virtual bool NearPointProjection( const MbCartPoint3D &, double & t, bool ext, MbRect1D * tRange = c3d_null ) const; // \ru Вычислить ближайшую проекцию точки на кривую. \en Calculate the nearest projection of the point on the curve. + virtual bool NearPointProjection( const MbCartPoint3D &, double & t, bool ext, MbRect1D * tRange = nullptr ) const; // \ru Вычислить ближайшую проекцию точки на кривую. \en Calculate the nearest projection of the point on the curve. virtual bool IsStraight( bool ignoreParams = false ) const; // \ru Определить, является ли линия прямолинейной. \en Determine whether the line is straight. - virtual MbCurve * GetMap( const MbMatrix3D &, MbRect1D * pRgn = c3d_null, - VERSION version = Math::DefaultMathVersion(), bool * coincParams = c3d_null ) const; // \ru Дать плоскую проекцию кривой. \en Get a planar projection of curve. - /// \ru Получить границы участков кривой, которые описываются одной аналитической функцией. - /// \en Get the boundaries of the curve sections that are described by one analytical function. \~ - virtual void GetAnalyticalFunctionsBounds( std::vector & params ) const; - /// \ru Найти все особые точки функции кривизны кривой. - /// \en Find all the special points of the curvature function of the curve. - virtual void GetCurvatureSpecialPoints( std::vector & points ) const; - virtual bool IsContinuousDerivative( bool & contLength, bool & contDirect, c3d::DoubleVector * params = c3d_null, double epsilon = EPSILON ) const; // \ru Непрерывна ли первая производная? \en Have the first derivative the continuous? - // \ru Устранить разрывы первых производных по длине. \en Eliminate the discontinuities of the first derivative at length. - virtual bool SetContinuousDerivativeLength( VERSION version, double epsilon = EPSILON ); + virtual MbCurve * GetMap( const MbMatrix3D &, MbRect1D * pRgn = nullptr, + VERSION version = Math::DefaultMathVersion(), bool * coincParams = nullptr ) const; // \ru Дать плоскую проекцию кривой. \en Get a planar projection of curve. - // \ru Доступ к полям класса. \en Access to the fields of a class. + /// \ru Получить границы участков кривой, которые описываются одной аналитической функцией. \en Get the boundaries of the curve sections that are described by one analytical function. \~ + virtual void GetAnalyticalFunctionsBounds( std::vector & params ) const; + /// \ru Найти все особые точки функции кривизны кривой. \en Find all the special points of the curvature function of the curve. + virtual void GetCurvatureSpecialPoints( std::vector & points ) const; + virtual bool IsContinuousDerivative( bool & contLength, bool & contDirect, c3d::DoubleVector * params = nullptr, double epsilon = EPSILON ) const; // \ru Непрерывна ли первая производная? \en Have the first derivative the continuous? + /// \ru Устранить разрывы первых производных по длине. \en Eliminate the discontinuities of the first derivative at length. + virtual bool SetContinuousDerivativeLength( VERSION version, double epsilon = EPSILON ); + /// \ ru Определение точек излома контура. \en The determination of contour smoothness break points. + virtual void BreakPoints( std::vector & vBreaks, double precision = ANGLE_REGION ) const; + + /// \ru Доступ к полям класса. \en Access to the fields of a class. /// \ru Выдать базовую поверхность. \en Get the base surface. const MbSurface & GetSurface() const { return *surface; } diff --git a/C3d/Include/cur_contour_with_breaks.h b/C3d/Include/cur_contour_with_breaks.h index 173d886..9734b0c 100644 --- a/C3d/Include/cur_contour_with_breaks.h +++ b/C3d/Include/cur_contour_with_breaks.h @@ -84,10 +84,10 @@ public : \en \name Common functions of a geometric object. \{ */ virtual MbePlaneType IsA() const; // \ru Тип элемента. \en A type of element. - virtual void Transform( const MbMatrix & matr, MbRegTransform * ireg = c3d_null, const MbSurface * newSurface = c3d_null ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. - virtual void Move( const MbVector & to, MbRegTransform * = c3d_null, const MbSurface * newSurface = c3d_null ); // \ru Сдвиг. \en Move. - virtual void Rotate( const MbCartPoint & pnt, const MbDirection & angle, MbRegTransform * = c3d_null, const MbSurface * newSurface = c3d_null ); // \ru Поворот. \en Rotation. - virtual MbPlaneItem & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента. \en Create a copy of the element. + virtual void Transform( const MbMatrix & matr, MbRegTransform * ireg = nullptr, const MbSurface * newSurface = nullptr ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. + virtual void Move( const MbVector & to, MbRegTransform * = nullptr, const MbSurface * newSurface = nullptr ); // \ru Сдвиг. \en Move. + virtual void Rotate( const MbCartPoint & pnt, const MbDirection & angle, MbRegTransform * = nullptr, const MbSurface * newSurface = nullptr ); // \ru Поворот. \en Rotation. + virtual MbPlaneItem & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента. \en Create a copy of the element. /** \} */ /**\ru \name Функции доступа к данным: разрывы. \en \name Functions for access to data: breaks. @@ -160,11 +160,11 @@ public : \en Invisible part by the number of break. \~ \details \ru Невидимая часть по номеру разрыва.\n Номер проверяется на корректность. - В случае, если номер не меньше числа разрывов, функция вернет c3d_null.\n + В случае, если номер не меньше числа разрывов, функция вернет nullptr.\n После использования полученный контур нужно удалить. \en Invisible part by the number of break. \n A number Is checked for correctness. - If the number is not less than the number of breaks, the function returns c3d_null. \n + If the number is not less than the number of breaks, the function returns nullptr. \n The resulting contour is to be deleted after use. \~ \param[in] i - \ru Номер разрыва, должен быть меньше количества видимых частей. \en The number of break must be less than the number of visible parts. \~ diff --git a/C3d/Include/cur_cosinusoid.h b/C3d/Include/cur_cosinusoid.h index 5c745cd..5d13ca4 100644 --- a/C3d/Include/cur_cosinusoid.h +++ b/C3d/Include/cur_cosinusoid.h @@ -90,11 +90,11 @@ public: virtual MbePlaneType IsA() const; // \ru Тип элемента \en Type of element virtual bool SetEqual ( const MbPlaneItem & ); // \ru Сделать элементы равными \en Make the elements equal virtual bool IsBounded () const { return true; } // \ru Ограниченность кривой \en Bounded curve - virtual void Transform ( const MbMatrix & matr, MbRegTransform * ireg = c3d_null, const MbSurface * newSurface = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move ( const MbVector & to, MbRegTransform * = c3d_null, const MbSurface * newSurface = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate ( const MbCartPoint & pnt, const MbDirection & angle, MbRegTransform * = c3d_null, const MbSurface * newSurface = c3d_null ); // \ru Поворот \en Rotation + virtual void Transform ( const MbMatrix & matr, MbRegTransform * ireg = nullptr, const MbSurface * newSurface = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move ( const MbVector & to, MbRegTransform * = nullptr, const MbSurface * newSurface = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate ( const MbCartPoint & pnt, const MbDirection & angle, MbRegTransform * = nullptr, const MbSurface * newSurface = nullptr ); // \ru Поворот \en Rotation virtual bool IsSame ( const MbPlaneItem & other, double accuracy = LENGTH_EPSILON ) const; - virtual MbPlaneItem & Duplicate ( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента \en Create a copy of the element + virtual MbPlaneItem & Duplicate ( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента \en Create a copy of the element virtual void Refresh(); // \ru Сбросить все временные данные \en Reset all temporary data virtual void PrepareIntegralData( const bool forced ) const; // \ru Рассчитать временные (mutable) данные объекта. \en Calculate temporary (mutable) data of an object. @@ -124,7 +124,7 @@ public: virtual bool HasLength ( double & length ) const; virtual double GetMetricLength() const; // \ru Метрическая длина \en The metric length - virtual void Inverse( MbRegTransform * iReg = c3d_null ); // \ru Изменение направления кривой на противоположное \en Change to the opposite direction of a curve + virtual void Inverse( MbRegTransform * iReg = nullptr ); // \ru Изменение направления кривой на противоположное \en Change to the opposite direction of a curve virtual MbNurbs * NurbsCurve( const MbCurveIntoNurbsInfo & ) const; @@ -140,7 +140,7 @@ public: virtual double PointProjection( const MbCartPoint & pnt ) const; // \ru Проекция точки на кривую \en Point projection on the curve virtual bool NearPointProjection( const MbCartPoint & pnt, double xEpsilon, double yEpsilon, - double & t, bool ext, MbRect1D * tRange = c3d_null ) const; // \ru Проекция точки на кривую или её продолжение в области поиска проекции \en Point projection on the curve or its extension in the projection search area + double & t, bool ext, MbRect1D * tRange = nullptr ) const; // \ru Проекция точки на кривую или её продолжение в области поиска проекции \en Point projection on the curve or its extension in the projection search area virtual void GetProperties( MbProperties & properties ); // \ru Выдать свойства объекта \en Get properties of the object virtual void SetProperties( const MbProperties & properties ); // \ru Записать свойства объекта \en Set properties of the object @@ -173,10 +173,10 @@ public: void Init1( CosinusoidPar & par, MbCartPoint & p1, MbCartPoint & p2, double & len, double & angle ); void Init2( CosinusoidPar & par, const MbCartPoint & p1, MbCartPoint & p2, const double & len, double & angle ); void Init3( CosinusoidPar & par, const MbCartPoint & p1, MbCartPoint & p2, double & len, const double & angle, - const DiskreteLengthData * = c3d_null ); + const DiskreteLengthData * = nullptr ); void Init4( CosinusoidPar & par, MbCartPoint & p1, const MbCartPoint & p2, const double & len, double & angle ); void Init5( CosinusoidPar & par, MbCartPoint & p1, const MbCartPoint & p2, double & len, const double & angle, - const DiskreteLengthData * = c3d_null ); + const DiskreteLengthData * = nullptr ); void Init6( CosinusoidPar & par, const MbCartPoint & p1, MbCartPoint & p2, const double & len, const double & angle ); void Init7( CosinusoidPar & par, MbCartPoint & p1, const MbCartPoint & p2, const double & len, const double & angle ); void Init8( CosinusoidPar & par, MbCartPoint & p1, MbCartPoint & p2, double & len, double & angle, diff --git a/C3d/Include/cur_crooked_spiral.h b/C3d/Include/cur_crooked_spiral.h index e45da06..4a09bc0 100644 --- a/C3d/Include/cur_crooked_spiral.h +++ b/C3d/Include/cur_crooked_spiral.h @@ -57,7 +57,7 @@ class MATH_CLASS MbCrookedSpiral : public MbSpiral { typedef std::vector CurveParams; protected: - MbCurve * curve; ///< \ru Кривая, задающая ось спирали, (не может быть c3d_null). \en The curve which determines the axis of the spiral, (can not be c3d_null). + MbCurve * curve; ///< \ru Кривая, задающая ось спирали, (не может быть nullptr). \en The curve which determines the axis of the spiral, (can not be nullptr). double radius; ///< \ru Радиус спирали. \en A spiral radius. double wMin; ///< \ru Минимальное значение параметра curve. \en Minimal value of parameter "curve". double wMax; ///< \ru Максимальное значение параметра curve. \en Maximal value of parameter "curve". @@ -84,7 +84,7 @@ public : // \ru Общие функции математического объекта \en Common functions of the mathematical object virtual MbeSpaceType IsA() const; // \ru Тип элемента \en Type of element - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента \en Create a copy of the element + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента \en Create a copy of the element virtual bool IsSame( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const; virtual bool SetEqual( const MbSpaceItem & init ); // \ru Сделать равным \en Make equal @@ -108,7 +108,7 @@ public : virtual void Explore( double & t, bool ext, MbCartPoint3D & pnt, MbVector3D & fir, MbVector3D * sec, MbVector3D * thir ) const; - virtual void Inverse( MbRegTransform * iReg = c3d_null ); // \ru Изменить направление \en Change direction + virtual void Inverse( MbRegTransform * iReg = nullptr ); // \ru Изменить направление \en Change direction virtual MbCurve3D * Trimmed( double t1, double t2, int sense ) const; // \ru Создание усеченной кривой \en Creation of a trimmed curve virtual double CalculateLength( double t1, double t2 ) const; diff --git a/C3d/Include/cur_cubic_spline.h b/C3d/Include/cur_cubic_spline.h index 183e803..1d91ca9 100644 --- a/C3d/Include/cur_cubic_spline.h +++ b/C3d/Include/cur_cubic_spline.h @@ -195,10 +195,10 @@ public : virtual MbePlaneType IsA () const; // \ru Тип элемента \en Type of element virtual bool SetEqual ( const MbPlaneItem & ); // \ru Сделать элементы равными \en Make equal elements virtual bool IsSame ( const MbPlaneItem &, double accuracy = LENGTH_EPSILON ) const; // \ru Является ли кривая curve копией данной кривой \en Whether the curve "curve" is a copy of a given curve - virtual void Transform( const MbMatrix &, MbRegTransform * ireg = c3d_null, const MbSurface * newSurface = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move ( const MbVector &, MbRegTransform * = c3d_null, const MbSurface * newSurface = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate ( const MbCartPoint &, const MbDirection &, MbRegTransform * = c3d_null, const MbSurface * newSurface = c3d_null ); // \ru Поворот \en Rotation - virtual MbPlaneItem & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента \en Create a copy of the element + virtual void Transform( const MbMatrix &, MbRegTransform * ireg = nullptr, const MbSurface * newSurface = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move ( const MbVector &, MbRegTransform * = nullptr, const MbSurface * newSurface = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate ( const MbCartPoint &, const MbDirection &, MbRegTransform * = nullptr, const MbSurface * newSurface = nullptr ); // \ru Поворот \en Rotation + virtual MbPlaneItem & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента \en Create a copy of the element /** \} */ /** \ru \name Функции описания области определения кривой. @@ -246,7 +246,7 @@ public : \{ */ virtual void Rebuild (); // \ru Пересчитать Безье кривую \en Recalculate Bezier curve virtual void SetClosed( bool cls ); // \ru Установить признак замкнутости. \en Set attribute of closedness. - virtual void Inverse ( MbRegTransform * iReg = c3d_null ); // \ru Изменение направления кривой на противоположное \en Change to the opposite direction of a curve + virtual void Inverse ( MbRegTransform * iReg = nullptr ); // \ru Изменение направления кривой на противоположное \en Change to the opposite direction of a curve /** \brief \ru Построить усеченную кривую. \en Construct a trimmed curve. \~ diff --git a/C3d/Include/cur_cubic_spline3d.h b/C3d/Include/cur_cubic_spline3d.h index 6954681..04d0b58 100644 --- a/C3d/Include/cur_cubic_spline3d.h +++ b/C3d/Include/cur_cubic_spline3d.h @@ -247,13 +247,13 @@ public: void Init( const MbCubicSpline &, const MbPlacement3D & ); // \ru Общие функции математического объекта \en Common functions of the mathematical object - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента \en Create a copy of the element + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента \en Create a copy of the element virtual MbeSpaceType IsA() const; // \ru Тип элемента \en Type of element virtual bool IsSame ( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const; virtual bool SetEqual ( const MbSpaceItem & ); // \ru Сделать равным \en Make equal - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate about an axis + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate about an axis virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта \en Get properties of the object virtual void SetProperties( const MbProperties & ); // \ru Записать свойства объекта \en Set properties of the object @@ -277,14 +277,14 @@ public: virtual MbNurbs3D * NurbsCurve( const MbCurveIntoNurbsInfo & ) const; virtual MbCurve3D * NurbsCurve( const MbNurbsParameters & ) const; - virtual void Inverse ( MbRegTransform * iReg = c3d_null ); // \ru Изменить направление \en Change direction + virtual void Inverse ( MbRegTransform * iReg = nullptr ); // \ru Изменить направление \en Change direction virtual size_t GetCount() const; virtual void Rebuild (); // \ru Перестроить кривую \en Rebuild the curve virtual void SetClosed( bool cls ); // \ru Установить признак замкнутости. \en Set attribute of closedness. virtual bool IsDegenerate( double eps = METRIC_PRECISION ) const; - virtual MbCurve3D * TrimmBreak( double t1, double t2, int sense ) const; // \ru Создать усеченную кривую \en Create the trimmed curve - virtual MbCurve * GetMap( const MbMatrix3D &, MbRect1D * pRgn = c3d_null, - VERSION version = Math::DefaultMathVersion(), bool * coincParams = c3d_null ) const; + virtual MbCurve3D * Trimmed( double t1, double t2, int sense ) const; // \ru Создать усеченную кривую \en Create the trimmed curve + virtual MbCurve * GetMap( const MbMatrix3D &, MbRect1D * pRgn = nullptr, + VERSION version = Math::DefaultMathVersion(), bool * coincParams = nullptr ) const; virtual bool IsPlanar ( double accuracy = METRIC_EPSILON ) const; // \ru Является ли кривая плоской \en Whether a curve is planar virtual bool GetPlacement( MbPlacement3D & place, PlanarCheckParams params = PlanarCheckParams() ) const; // \ru Заполнить плейсемент, ести кривая плоская \en Fill the placement if curve is planar @@ -355,11 +355,13 @@ public: private: + // \ru Усечь кривую с разрывом \en Trim a curve with a break + MbCurve3D * TrimmedBreak( double t1, double t2, int sense ) const; // \ru Найти узел в положительном направлении \en Find a knot in the positive direction - void AddKnot( ptrdiff_t &, double &, ptrdiff_t &, double &, ptrdiff_t &, double & ) const; - void CheckSpline() const; // \ru Проверить корректность расчета сплайна \en Check correctness of the spline calculation + void AddKnot( ptrdiff_t &, double &, ptrdiff_t &, double &, ptrdiff_t &, double & ) const; + void CheckSpline() const; // \ru Проверить корректность расчета сплайна \en Check correctness of the spline calculation // \ru Объявление оператора присваивания без реализации, чтобы не было присваивания по умолчанию. \en The declaration of the assignment operator without implementation to prevent an assignment by default. - void operator = ( const MbCubicSpline3D & ); + void operator = ( const MbCubicSpline3D & ); DECLARE_PERSISTENT_CLASS_NEW_DEL( MbCubicSpline3D ) }; diff --git a/C3d/Include/cur_curve_spiral.h b/C3d/Include/cur_curve_spiral.h index 2c539f4..ec90f87 100644 --- a/C3d/Include/cur_curve_spiral.h +++ b/C3d/Include/cur_curve_spiral.h @@ -88,7 +88,7 @@ public: // \ru Общие функции математического объекта \en Common functions of the mathematical object virtual MbeSpaceType IsA() const; // \ru Тип элемента \en Type of element - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента \en Create a copy of the element + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента \en Create a copy of the element virtual bool IsSame( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const; virtual bool SetEqual( const MbSpaceItem & init ); // \ru Сделать равным \en Make equal @@ -112,7 +112,7 @@ public: virtual void Explore( double & t, bool ext, MbCartPoint3D & pnt, MbVector3D & fir, MbVector3D * sec, MbVector3D * thir ) const; - virtual void Inverse( MbRegTransform * iReg = c3d_null ); // \ru Изменить направление \en Change direction + virtual void Inverse( MbRegTransform * iReg = nullptr ); // \ru Изменить направление \en Change direction virtual MbCurve3D * Trimmed( double t1, double t2, int sense ) const; // \ru Создание усеченной кривой \en Creation of a trimmed curve diff --git a/C3d/Include/cur_hermit.h b/C3d/Include/cur_hermit.h index f99372f..59f2ec5 100644 --- a/C3d/Include/cur_hermit.h +++ b/C3d/Include/cur_hermit.h @@ -211,11 +211,11 @@ public : virtual MbePlaneType IsA() const; // \ru Тип элемента \en Type of element virtual bool SetEqual( const MbPlaneItem & ); // \ru Сделать элементы равными \en Make the elements equal - virtual void Transform( const MbMatrix & matr, MbRegTransform * ireg = c3d_null, const MbSurface * newSurface = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move( const MbVector & to, MbRegTransform * = c3d_null, const MbSurface * newSurface = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate( const MbCartPoint & pnt, const MbDirection & angle, MbRegTransform * = c3d_null, const MbSurface * newSurface = c3d_null ); // \ru Поворот \en Rotation + virtual void Transform( const MbMatrix & matr, MbRegTransform * ireg = nullptr, const MbSurface * newSurface = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move( const MbVector & to, MbRegTransform * = nullptr, const MbSurface * newSurface = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate( const MbCartPoint & pnt, const MbDirection & angle, MbRegTransform * = nullptr, const MbSurface * newSurface = nullptr ); // \ru Поворот \en Rotation virtual bool IsSame( const MbPlaneItem & other, double accuracy = LENGTH_EPSILON ) const; - virtual MbPlaneItem & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента \en Create a copy of the element + virtual MbPlaneItem & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента \en Create a copy of the element /** \} */ /** \ru \name Общие функции кривой @@ -246,7 +246,7 @@ public : virtual void Explore( double & t, bool ext, MbCartPoint & pnt, MbVector & fir, MbVector * sec, MbVector * thir ) const; - virtual void Inverse( MbRegTransform * iReg = c3d_null ); // \ru Изменить направление \en Change direction + virtual void Inverse( MbRegTransform * iReg = nullptr ); // \ru Изменить направление \en Change direction virtual double Step( double t, double sag ) const; // \ru Вычисление шага аппроксимации с учетом радиуса кривизны \en Calculation of approximation step with consideration of curvature radius virtual double DeviationStep( double t, double angle ) const; // \ru Вычисление шага аппроксимации по угловой толерантности \en Calculation of approximation step by angular tolerance virtual void IntersectHorizontal( double y, SArray & ) const; // \ru Пересечение кривой с горизонтальной прямой \en Intersection of a curve with a horizontal line @@ -254,7 +254,7 @@ public : virtual double PointProjection( const MbCartPoint & pnt ) const; // \ru Проекция точки на кривую \en Point projection on the curve virtual bool NearPointProjection( const MbCartPoint & pnt, double xEpsilon, double yEpsilon, - double & t, bool ext, MbRect1D * tRange = c3d_null ) const; // \ru Проекция точки на кривую или её продолжение в области поиска проекции \en Point projection on the curve or its extension in the projection search area + double & t, bool ext, MbRect1D * tRange = nullptr ) const; // \ru Проекция точки на кривую или её продолжение в области поиска проекции \en Point projection on the curve or its extension in the projection search area virtual double CalculateMetricLength() const; // \ru Посчитать метрическую длину разомкнутой \en Calculate the open metric length virtual bool GetWeightCentre( MbCartPoint & wc ) const; // \ru Посчитать центр тяжести кривой \en Calculate the gravity center of the curve virtual void CalculateGabarit( MbRect & r ) const; // \ru Определить габариты \en Calculate bounding box diff --git a/C3d/Include/cur_hermit3d.h b/C3d/Include/cur_hermit3d.h index cf7a5c5..8e5e1b2 100644 --- a/C3d/Include/cur_hermit3d.h +++ b/C3d/Include/cur_hermit3d.h @@ -211,12 +211,12 @@ public : // \ru Общие функции математического объекта \en Common functions of the mathematical object virtual MbeSpaceType IsA() const; // \ru Тип элемента \en Type of element - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента \en Create a copy of the element + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента \en Create a copy of the element virtual bool IsSame ( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const; virtual bool SetEqual ( const MbSpaceItem & ); // \ru Сделать равным \en Make equal - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать \en Transform. - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Поворот \en Rotation + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать \en Transform. + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Поворот \en Rotation virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта \en Get properties of the object virtual void SetProperties( const MbProperties & ); // \ru Записать свойства объекта \en Set properties of the object @@ -236,7 +236,7 @@ public : virtual void Explore( double & t, bool ext, MbCartPoint3D & pnt, MbVector3D & fir, MbVector3D * sec, MbVector3D * thir ) const; - virtual void Inverse( MbRegTransform * iReg = c3d_null ); // \ru Изменить направление \en Change direction + virtual void Inverse( MbRegTransform * iReg = nullptr ); // \ru Изменить направление \en Change direction virtual double Step ( double t, double sag ) const; // \ru Вычисление шага аппроксимации \en Calculation of approximation step virtual double DeviationStep( double t, double angle ) const; @@ -244,7 +244,6 @@ public : virtual MbCurve3D * NurbsCurve( const MbNurbsParameters & ) const; // \ru Построить NURBS-копию кривой \en Create a NURBS-copy of the curve virtual MbCurve3D * Trimmed( double t1, double t2, int sense ) const; // \ru Создание усеченной кривой \en Creation of a trimmed curve - virtual MbCurve3D * TrimmBreak( double t1, double t2, int sense ) const; // \ru Создание усеченной кривой \en Creation of a trimmed curve virtual bool IsPlanar ( double accuracy = METRIC_EPSILON ) const; // \ru Является ли кривая плоской \en Whether a curve is planar. virtual bool IsStraight( bool ignoreParams = false ) const; // \ru Признак прямолинейности кривой \en An attribute of curve straightness @@ -276,7 +275,7 @@ public : virtual bool CheckParam ( double & t, ptrdiff_t & i0, ptrdiff_t & i1, double & t0, double & t1 ) const; // \ru Загнать параметр получить локальный индексы и параметры \en Move parameter into domain, get local indices and parameters virtual double GetParam( ptrdiff_t i ) const; // \ru Выдать параметр для точки с номером \en Get parameter for point with index - virtual bool NearPointProjection ( const MbCartPoint3D &, double & t, bool ext, MbRect1D * tRange = c3d_null ) const; // \ru Ближайшая проекция точки на кривую \en The nearest point projection to the curve + virtual bool NearPointProjection ( const MbCartPoint3D &, double & t, bool ext, MbRect1D * tRange = nullptr ) const; // \ru Ближайшая проекция точки на кривую \en The nearest point projection to the curve virtual double CalculateMetricLength() const; // \ru Посчитать метрическую длину \en Calculate the metric length virtual void GetWeightCentre( MbCartPoint3D &wc ) const; // \ru Посчитать центр тяжести кривой \en Calculate the gravity center of the curve virtual void CalculateGabarit( MbCube & gab ) const; // \ru Вычислить габарит кривой \en Calculate the bounding box of curve @@ -284,8 +283,8 @@ public : VERSION version = Math::DefaultMathVersion() ) const; // \ru Сдвинуть параметр t на расстояние len по направлению \en Shift the parameter t by the distance 'len' in the direction // \ru Функции только 3D кривой \en Function for 3D-curve - virtual MbCurve * GetMap( const MbMatrix3D &, MbRect1D * pRgn = c3d_null, - VERSION version = Math::DefaultMathVersion(), bool * coincParams = c3d_null ) const; // \ru Дать плоскую проекцию кривой \en Get a planar projection of curve + virtual MbCurve * GetMap( const MbMatrix3D &, MbRect1D * pRgn = nullptr, + VERSION version = Math::DefaultMathVersion(), bool * coincParams = nullptr ) const; // \ru Дать плоскую проекцию кривой \en Get a planar projection of curve virtual size_t GetCount() const; // \ru Установить область изменения параметра. \en Set range of parameter. diff --git a/C3d/Include/cur_line.h b/C3d/Include/cur_line.h index b7e086b..ce386d4 100644 --- a/C3d/Include/cur_line.h +++ b/C3d/Include/cur_line.h @@ -71,11 +71,11 @@ public : virtual bool IsSimilar( const MbPlaneItem & ) const; // \ru Являются ли элементы подобными \en Whether the elements are similar virtual bool SetEqual ( const MbPlaneItem & ); // \ru Сделать элементы равными \en Make equal elements virtual bool IsSame ( const MbPlaneItem & other, double accuracy = LENGTH_EPSILON ) const; // \ru Является ли кривая curve копией данной кривой ? \en Whether the 'curve' curve is duplicate of current curve. - virtual void Transform( const MbMatrix &, MbRegTransform * ireg = c3d_null, const MbSurface * newSurface = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move ( const MbVector &, MbRegTransform * = c3d_null, const MbSurface * newSurface = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate( const MbCartPoint & pnt, const MbDirection & angle, MbRegTransform * = c3d_null, const MbSurface * newSurface = c3d_null ); // \ru Поворот \en Rotation + virtual void Transform( const MbMatrix &, MbRegTransform * ireg = nullptr, const MbSurface * newSurface = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move ( const MbVector &, MbRegTransform * = nullptr, const MbSurface * newSurface = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate( const MbCartPoint & pnt, const MbDirection & angle, MbRegTransform * = nullptr, const MbSurface * newSurface = nullptr ); // \ru Поворот \en Rotation - virtual MbPlaneItem & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента \en Create a copy of the element + virtual MbPlaneItem & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента \en Create a copy of the element virtual void AddYourGabaritTo ( MbRect & ) const; // \ru Добавь свой габарит в прямой прям-к \en Add bounding box into a straight box virtual void AddYourGabaritMtr( MbRect &, const MbMatrix & ) const; // \ru Добавь в прям-к свой габарит с учетом матрицы \en Add bounding rectangle into a box with consideration of the matrix @@ -149,7 +149,7 @@ public : // \ru Вычисление минимальной длины кривой между двумя точками на ней \en Calculation of minimal length of a curve between two points on it virtual double LengthBetween2Points( MbCartPoint & p1, MbCartPoint & p2, - MbCartPoint * pc = c3d_null ) const; + MbCartPoint * pc = nullptr ) const; virtual bool DistanceAlong( double & t, double len, int curveDir, double eps = Math::LengthEps, VERSION version = Math::DefaultMathVersion() ) const; // \ru Сдвинуть параметр t на расстояние len по направлению \en Shift the parameter t by the distance 'len' in the direction @@ -166,7 +166,7 @@ public : virtual MbeItemLocation PointRelative ( const MbCartPoint & p, double eps = Math::LengthEps ) const; virtual double PointProjection ( const MbCartPoint & ) const; // \ru Проекция точки на кривую \en Point projection on the curve virtual bool NearPointProjection( const MbCartPoint & pnt, double xEpsilon, double yEpsilon, - double & t, bool ext, MbRect1D * tRange = c3d_null ) const; // \ru Проекция точки на кривую или её продолжение в области поиска проекции \en Point projection on the curve or its extension in the projection search area + double & t, bool ext, MbRect1D * tRange = nullptr ) const; // \ru Проекция точки на кривую или её продолжение в области поиска проекции \en Point projection on the curve or its extension in the projection search area // \ru Вычисление всех перпендикуляров к кривой из данной точки \en Calculation of all perpendiculars to the curve from a given point virtual void PerpendicularPoint( const MbCartPoint & pnt, SArray & tFind ) const; @@ -186,7 +186,7 @@ public : virtual void IntersectHorizontal( double y, SArray & cross ) const; // \ru Пересечение с горизонтальной прямой \en Intersection with the horizontal line virtual void IntersectVertical ( double x, SArray & cross ) const; // \ru Пересечение с вертикальной прямой \en Intersection with the vertical line - virtual void Inverse( MbRegTransform * iReg = c3d_null ); // \ru Изменение направления кривой на противоположное \en Change to the opposite direction of a curve + virtual void Inverse( MbRegTransform * iReg = nullptr ); // \ru Изменение направления кривой на противоположное \en Change to the opposite direction of a curve virtual bool IsClosed() const; // \ru Проверка замкнутости \en Check for closedness virtual bool IsBounded() const; // \ru Определить, является ли кривая ограниченной. \en Define whether the curve is bounded. virtual bool IsStraight( bool ignoreParams = false ) const; // \ru Признак прямолинейности кривой \en An attribute of curve straightness diff --git a/C3d/Include/cur_line3d.h b/C3d/Include/cur_line3d.h index 6f0b635..4de55e4 100644 --- a/C3d/Include/cur_line3d.h +++ b/C3d/Include/cur_line3d.h @@ -56,12 +56,12 @@ public : // \ru Общие функции математического объекта \en Common functions of the mathematical object virtual MbeSpaceType IsA() const; // \ru Тип элемента \en Type of element - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента \en Create a copy of the element + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента \en Create a copy of the element virtual bool IsSame ( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const; virtual bool SetEqual ( const MbSpaceItem & ); // \ru Сделать равным \en Make equal - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать \en Transform - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate around an axis + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать \en Transform + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate around an axis virtual double DistanceToPoint( const MbCartPoint3D & ) const; // \ru Расстояние до точки \en Distance to a point virtual void AddYourGabaritTo( MbCube & ) const; // \ru Добавить габарит кривой в куб. \en Add a bounding box of a curve to a cube. @@ -98,7 +98,7 @@ public : virtual bool DistanceAlong( double & t, double len, int curveDir, double eps = Math::metricPrecision, VERSION version = Math::DefaultMathVersion() ) const; - virtual void Inverse( MbRegTransform * iReg = c3d_null ); // \ru Изменить направление \en Change direction + virtual void Inverse( MbRegTransform * iReg = nullptr ); // \ru Изменить направление \en Change direction virtual double GetMetricLength() const; // \ru Метрическая длина кривой \en Metric length of a curve virtual double Step ( double t, double sag ) const; // \ru Вычисление шага по стрелке прогиба. \en Calculation of parameter step by the sag. virtual double DeviationStep( double t, double angle ) const; // \ru Вычисление шага по углу отклонения нормали. \en Calculation of parameter step by the deviation angle. @@ -110,7 +110,7 @@ public : virtual void CalculateLocalGabarit( const MbMatrix3D & into, MbCube & ) const; // \ru Ближайшая проекция точки на кривую \en The nearest point projection to the curve - virtual bool NearPointProjection( const MbCartPoint3D &, double & t, bool ext, MbRect1D * tRange = c3d_null ) const; + virtual bool NearPointProjection( const MbCartPoint3D &, double & t, bool ext, MbRect1D * tRange = nullptr ) const; bool operator == ( const MbLine3D & with ) const; // \ru Проверка на равенство \en Check for equality bool operator != ( const MbLine3D & with ) const; // \ru Проверка на неравенство \en Check for inequality @@ -124,10 +124,10 @@ public : virtual double GetParamToUnit( double t ) const; // \ru Дать приращение параметра, соответствующее единичной длине в пространстве \en Get increment of parameter, corresponding to the unit length in space // \ru Дать плоскую проекцию кривой \en Get a planar projection of curve - virtual MbCurve * GetMap( const MbMatrix3D &, MbRect1D * pRgn = c3d_null, - VERSION version = Math::DefaultMathVersion(), bool * coincParams = c3d_null ) const; + virtual MbCurve * GetMap( const MbMatrix3D &, MbRect1D * pRgn = nullptr, + VERSION version = Math::DefaultMathVersion(), bool * coincParams = nullptr ) const; virtual MbCurve * GetMapPsp( const MbMatrix3D &, double zNear, - MbRect1D * pRgn = c3d_null ) const; + MbRect1D * pRgn = nullptr ) const; virtual void CalculatePolygon( const MbStepData & stepData, MbPolygon3D & ) const; // \ru pассчитать полигон \en Calculate a polygon virtual bool IsSimilarToCurve( const MbCurve3D & curve, double precision = METRIC_PRECISION ) const; // \ru Подобные ли кривые для объединения (слива) \en Whether the curves for union (joining) are similar diff --git a/C3d/Include/cur_line_segment.h b/C3d/Include/cur_line_segment.h index 4d67a2d..572e951 100644 --- a/C3d/Include/cur_line_segment.h +++ b/C3d/Include/cur_line_segment.h @@ -68,10 +68,10 @@ public : void Init1( const MbCartPoint &p1, const MbCartPoint &p2, double &len, double &angle ); void Init2( const MbCartPoint &p1, MbCartPoint &p2, const double &len, double &angle ); void Init3( const MbCartPoint &p1, MbCartPoint &p2, double &len, const double &angle, - const DiskreteLengthData * diskrData = c3d_null ); + const DiskreteLengthData * diskrData = nullptr ); void Init4( MbCartPoint &p1, const MbCartPoint &p2, const double &len, double &angle ); void Init5( MbCartPoint &p1, const MbCartPoint &p2, double &len, const double &angle, - const DiskreteLengthData * diskrData = c3d_null ); + const DiskreteLengthData * diskrData = nullptr ); void Init6( const MbCartPoint &p1, MbCartPoint &p2, const double &len, const double &angle ); void Init7( MbCartPoint &p1, const MbCartPoint &p2, const double &len, const double &angle ); void Init8( MbCartPoint &p1, MbCartPoint &p2, double &len, double &angle, @@ -86,10 +86,10 @@ public : virtual MbePlaneType IsA() const; // \ru Тип элемента \en Type of element virtual bool IsSame ( const MbPlaneItem & other, double accuracy = LENGTH_EPSILON ) const; // \ru Является ли кривая curve копией данной кривой ? \en Whether the 'curve' curve is duplicate of current curve. virtual bool SetEqual( const MbPlaneItem & ); // \ru Сделать элементы равными \en Make equal elements - virtual MbPlaneItem & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента \en Create a copy of the element - virtual void Transform( const MbMatrix &, MbRegTransform * ireg = c3d_null, const MbSurface * newSurface = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move( const MbVector &, MbRegTransform * = c3d_null, const MbSurface * newSurface = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate( const MbCartPoint & pnt, const MbDirection & angle, MbRegTransform * = c3d_null, const MbSurface * newSurface = c3d_null ); // \ru Поворот \en Rotation + virtual MbPlaneItem & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента \en Create a copy of the element + virtual void Transform( const MbMatrix &, MbRegTransform * ireg = nullptr, const MbSurface * newSurface = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move( const MbVector &, MbRegTransform * = nullptr, const MbSurface * newSurface = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate( const MbCartPoint & pnt, const MbDirection & angle, MbRegTransform * = nullptr, const MbSurface * newSurface = nullptr ); // \ru Поворот \en Rotation virtual void AddYourGabaritTo ( MbRect & ) const; // \ru Добавь свой габарит в прямой прям-к \en Add bounding box into a straight box virtual void CalculateGabarit ( MbRect & ) const; // \ru Определить габариты кривой \en Determine the bounding box of the curve virtual void CalculateLocalGabarit( const MbMatrix & into, MbRect & local ) const ; // \ru Добавь в прям-к свой габарит с учетом матрицы \en Add bounding box into a box with consideration of the matrix @@ -155,7 +155,7 @@ public : \en \name Common function of curve. \{ */ virtual double Curvature( double t ) const; // \ru Кривизна усеченной кривой \en Curvature of a trimmed curve - virtual void Inverse( MbRegTransform * iReg = c3d_null ); // \ru Изменить направление кривой \en Change direction of a curve + virtual void Inverse( MbRegTransform * iReg = nullptr ); // \ru Изменить направление кривой \en Change direction of a curve virtual MbCurve * Offset( double rad ) const; // \ru Смещение отрезка \en Shift of a line segment virtual MbCurve * Trimmed( double t1, double t2, int sense ) const; @@ -179,7 +179,7 @@ public : virtual MbeItemLocation PointRelative( const MbCartPoint & pnt, double eps = Math::LengthEps ) const; virtual double PointProjection( const MbCartPoint & pnt ) const; // \ru Проекция точки на отрезок \en Point projection on the line segment virtual bool NearPointProjection( const MbCartPoint & pnt, double xEpsilon, double yEpsilon, - double & t, bool ext, MbRect1D * tRange = c3d_null ) const; // \ru Проекция точки на кривую или её продолжение в области поиска проекции \en Point projection on the curve or its extension in the projection search area + double & t, bool ext, MbRect1D * tRange = nullptr ) const; // \ru Проекция точки на кривую или её продолжение в области поиска проекции \en Point projection on the curve or its extension in the projection search area virtual void PerpendicularPoint( const MbCartPoint & pnt, SArray & tFind ) const; // \ru Вычисление всех перпендикуляров к кривой из данной точки \en Calculation of all perpendiculars to the curve from a given point virtual void IntersectHorizontal( double y, SArray & cross ) const; // \ru Пересечение с горизонтальной прямой \en Intersection with the horizontal line virtual void IntersectVertical ( double x, SArray & cross ) const; // \ru Пересечение с вертикальной прямой \en Intersection with the vertical line @@ -188,7 +188,7 @@ public : virtual double GetMetricLength() const; // \ru Метрическая длина \en The metric length virtual double GetLengthEvaluation() const; // \ru Оценка метрической длины кривой \en Evaluation of the metric length of the curve // \ru Вычисление минимальной длины кривой между двумя точками на ней \en Calculation of minimal length of a curve between two points on it - virtual double LengthBetween2Points( MbCartPoint & p1, MbCartPoint & p2, MbCartPoint * pc = c3d_null ) const; + virtual double LengthBetween2Points( MbCartPoint & p1, MbCartPoint & p2, MbCartPoint * pc = nullptr ) const; virtual bool DistanceAlong( double & t, double len, int curveDir, double eps = Math::LengthEps, VERSION version = Math::DefaultMathVersion() ) const; @@ -232,6 +232,9 @@ public : bool IsHorizontal( double eps = Math::paramEpsilon ) const { return ::fabs(point1.y - point2.y) < eps; } // \ru Проверка горизонтальности \en Check for horizontality bool IsVertical ( double eps = Math::paramEpsilon ) const { return ::fabs(point1.x - point2.x) < eps; } // \ru Проверка вертикальности \en Check for verticality + // \ru Продлить кривую. \en Extend the curve. \~ + virtual MbResultType Extend( const MbCurveExtensionParameters & parameters, MbCurve *& resCurve ) const; + //private: const MbLineSegment & operator = ( const MbLineSegment & ); // \ru Реализовано \en Implemented @@ -302,6 +305,8 @@ inline MbDirection MbLineSegment::GetDirection() const { // \ru Проверка параллельности двух прямых \en Check for parallelism of two lines // --- inline bool MbLineSegment::IsParallel( const MbLineSegment & seg, double eps ) const { + if ( &seg == this ) + return true; MbDirection d0( point1, point2 ); MbDirection d1( seg.point1, seg.point2 ); return ( ::fabs( d0.ay * d1.ax - d0.ax * d1.ay ) < eps ); diff --git a/C3d/Include/cur_line_segment3d.h b/C3d/Include/cur_line_segment3d.h index 2797dc0..49d77ba 100644 --- a/C3d/Include/cur_line_segment3d.h +++ b/C3d/Include/cur_line_segment3d.h @@ -16,6 +16,7 @@ class MATH_CLASS MbLineSegment; class MATH_CLASS MbLine3D; +class MATH_CLASS MbCurveExtensionParameters; //------------------------------------------------------------------------------ @@ -64,12 +65,12 @@ public : // \ru Общие функции математического объекта \en Common functions of the mathematical object virtual MbeSpaceType IsA() const; // \ru Тип элемента \en Type of element - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента \en Create a copy of the element + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента \en Create a copy of the element virtual bool IsSame ( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const; virtual bool SetEqual ( const MbSpaceItem & ); // \ru Сделать равным \en Make equal - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate about an axis + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate about an axis virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта \en Get properties of the object virtual void SetProperties( const MbProperties & ); // \ru Записать свойства объекта \en Set properties of the object @@ -100,7 +101,7 @@ public : virtual MbCurve3D * NurbsCurve( const MbNurbsParameters & ) const; // \ru Построить Nurbs-копию кривой \en Construct NURBS copy of the curve virtual MbCurve3D * Trimmed( double t1, double t2, int sense ) const; - virtual void Inverse( MbRegTransform * iReg = c3d_null ); // \ru Изменить направление \en Change direction + virtual void Inverse( MbRegTransform * iReg = nullptr ); // \ru Изменить направление \en Change direction virtual double CalculateMetricLength() const; // \ru Метрическая длина кривой \en Metric length of a curve virtual double GetLengthEvaluation() const; virtual double CalculateLength( double t1, double t2 ) const; @@ -111,15 +112,15 @@ public : virtual void GetCentre ( MbCartPoint3D & wc ) const; // \ru Посчитать центр кривой \en Calculate a center of curve virtual void GetWeightCentre( MbCartPoint3D & wc ) const; // \ru Посчитать центр тяжести кривой \en Calculate the gravity center of the curve virtual double Curvature( double t ) const; // \ru Кривизна усеченной кривой \en Curvature of a trimmed curve - virtual bool NearPointProjection ( const MbCartPoint3D &, double & t, bool ext, MbRect1D * tRange = c3d_null ) const; // \ru Ближайшая проекция точки на кривую \en The nearest point projection to the curve + virtual bool NearPointProjection ( const MbCartPoint3D &, double & t, bool ext, MbRect1D * tRange = nullptr ) const; // \ru Ближайшая проекция точки на кривую \en The nearest point projection to the curve virtual double Step ( double t, double sag ) const; // \ru Вычисление шага по стрелке прогиба. \en Calculation of parameter step by the sag. virtual double DeviationStep( double t, double angle ) const; // \ru Вычисление шага по углу отклонения нормали. \en Calculation of parameter step by the deviation angle. virtual double MetricStep ( double t, double length ) const; // \ru Вычисление шага параметра по длине. \en Calculation of parameter step by the given length. - virtual MbCurve * GetMap( const MbMatrix3D &, MbRect1D * pRgn = c3d_null, - VERSION version = Math::DefaultMathVersion(), bool * coincParams = c3d_null ) const; // \ru Дать плоскую проекцию кривой. \en Get a planar projection of curve. - virtual MbCurve * GetMapPsp( const MbMatrix3D &, double zNear, MbRect1D * pRgn = c3d_null ) const; // \ru Дать перспективную плоскую проекцию кривой. \en Get a planar geometric projection of curve. + virtual MbCurve * GetMap( const MbMatrix3D &, MbRect1D * pRgn = nullptr, + VERSION version = Math::DefaultMathVersion(), bool * coincParams = nullptr ) const; // \ru Дать плоскую проекцию кривой. \en Get a planar projection of curve. + virtual MbCurve * GetMapPsp( const MbMatrix3D &, double zNear, MbRect1D * pRgn = nullptr ) const; // \ru Дать перспективную плоскую проекцию кривой. \en Get a planar geometric projection of curve. virtual bool IsStraight( bool ignoreParams = false ) const; // \ru Является ли линия прямолинейной \en Whether the line is straight virtual size_t GetCount () const; @@ -140,6 +141,9 @@ public : void SetPoint2( const MbCartPoint3D & p ) { point2 = p; } void SetLimitPoint( ptrdiff_t number, const MbCartPoint3D &pnt ); // \ru Заменить точку отрезка \en Replace the point of a line segment + // \ru Продлить кривую. \en Extend the curve. \~ + virtual MbResultType Extend( const MbCurveExtensionParameters & parameters, MbCurve3D *& resCurve ) const; + /// \ru Является ли объект смещением \en Whether the object is a shift virtual bool IsShift ( const MbSpaceItem &, MbVector3D &, bool & isSame, double accuracy = LENGTH_EPSILON ) const; diff --git a/C3d/Include/cur_nurbs.h b/C3d/Include/cur_nurbs.h index a969103..c8e6a9d 100644 --- a/C3d/Include/cur_nurbs.h +++ b/C3d/Include/cur_nurbs.h @@ -399,7 +399,7 @@ public : uppIndex = (ptrdiff_t)initPoints.size() - 1; pointList.assign( initPoints.begin(), initPoints.end() ); - if ( initWeights != c3d_null ) { + if ( initWeights != nullptr ) { if ( (ptrdiff_t)initWeights->size() == uppIndex + 1 ) weights.assign( initWeights->begin(), initWeights->end() ); else { @@ -677,12 +677,12 @@ public : \en \name Common functions of geometric object. \{ */ virtual MbePlaneType IsA() const; // \ru Тип элемента. \en A type of element. - virtual MbPlaneItem & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента \en Create a copy of the element + virtual MbPlaneItem & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента \en Create a copy of the element virtual bool IsSame( const MbPlaneItem & other, double accuracy = LENGTH_EPSILON ) const; // \ru Является ли кривая other копией данной кривой? \en Whether the curve is duplicate of current curve. virtual bool SetEqual( const MbPlaneItem & ); // \ru Сделать элементы равными. \en Make elements equal. - virtual void Transform( const MbMatrix & matr, MbRegTransform * ireg = c3d_null, const MbSurface * newSurface = c3d_null ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. - virtual void Move( const MbVector & to, MbRegTransform * = c3d_null, const MbSurface * newSurface = c3d_null ); // \ru Сдвиг. \en Translation. - virtual void Rotate( const MbCartPoint & pnt, const MbDirection & angle, MbRegTransform * = c3d_null, const MbSurface * newSurface = c3d_null ); // \ru Поворот. \en Rotation. + virtual void Transform( const MbMatrix & matr, MbRegTransform * ireg = nullptr, const MbSurface * newSurface = nullptr ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. + virtual void Move( const MbVector & to, MbRegTransform * = nullptr, const MbSurface * newSurface = nullptr ); // \ru Сдвиг. \en Translation. + virtual void Rotate( const MbCartPoint & pnt, const MbDirection & angle, MbRegTransform * = nullptr, const MbSurface * newSurface = nullptr ); // \ru Поворот. \en Rotation. virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта. \en Get properties of the object. virtual void SetProperties( const MbProperties & ); // \ru Записать свойства объекта. \en Set properties of the object. @@ -755,7 +755,7 @@ public : virtual MbCurve * Trimmed( double t1, double t2, int sense ) const; virtual void Refresh(); // \ru Сбросить все временные данные. \en Reset all temporary data. - virtual void Inverse( MbRegTransform * iReg = c3d_null ); // \ru Изменение направления кривой на противоположное. \en Set the opposite direction of curve. + virtual void Inverse( MbRegTransform * iReg = nullptr ); // \ru Изменение направления кривой на противоположное. \en Set the opposite direction of curve. // \ru Определить, является ли кривая репараметризованно такой же. \en Define whether a reparameterized curve is the same. virtual bool IsReparamSame( const MbCurve & curve, double & factor ) const; @@ -816,9 +816,9 @@ public : virtual double PointProjection( const MbCartPoint & pnt ) const; // \ru Найти проекцию точки на кривую. \en Find the point projection to the curve. virtual bool NearPointProjection( const MbCartPoint & pnt, double xEpsilon, double yEpsilon, - double & t, bool ext, MbRect1D * tRange = c3d_null ) const; + double & t, bool ext, MbRect1D * tRange = nullptr ) const; - virtual bool IsContinuousDerivative( bool & contLength, bool & contDirect, c3d::DoubleVector * params = c3d_null, double epsilon = EPSILON ) const; // \ru Непрерывна ли первая производная? \en Have the first derivative the continuous? + virtual bool IsContinuousDerivative( bool & contLength, bool & contDirect, c3d::DoubleVector * params = nullptr, double epsilon = EPSILON ) const; // \ru Непрерывна ли первая производная? \en Have the first derivative the continuous? // \ru Устранить разрывы первых производных по длине. \en Eliminate the discontinuities of the first derivative at length. virtual bool SetContinuousDerivativeLength( VERSION version, double epsilon = EPSILON ); @@ -938,7 +938,7 @@ public : void AddCurves( NurbsCurves & curves ) { for ( size_t i = 0, icount = curves.size(); i < icount; ++i ) { - if ( curves[i] != c3d_null ) + if ( curves[i] != nullptr ) AddCurve( *curves[i] ); } } @@ -1017,7 +1017,7 @@ private: // \ru Системные методы. \en System methods. // \ru Расчет весовых функций и их первых производных. \en Calculation of weight functions and its first derivatives. ptrdiff_t WeightFunctions( double & x, CcArray & ) const; // \ru Вычисление шага аппроксимации в обе стороны. \en Calculation of approximation step in both directions. - double StepD( double & t, double sag, bool checkAngle = false, double angle = 0.0, MbNurbsAuxiliaryData * cache = c3d_null ) const; + double StepD( double & t, double sag, bool checkAngle = false, double angle = 0.0, MbNurbsAuxiliaryData * cache = nullptr ) const; // \ru Вычисление шага аппроксимации сплайна второго порядка. \en Calculation of approximation step of second order spline. double PolylineStep( double t, bool half, MbNurbsAuxiliaryData * cache ) const; // \ru Уточнить проекцию \en Specify projection. @@ -1052,12 +1052,12 @@ MbNurbs::MbNurbs( size_t initDegree, bool initClosed, const PointsVector & initP closed = initClosed; degree = initDegree; // Степень В-сплайна. - if ( initWeights != c3d_null ) + if ( initWeights != nullptr ) weights.assign( initWeights->begin(), initWeights->end() ); else weights.assign( initPoints.size(), 1.0 ); - if ( initKnots != c3d_null ) { + if ( initKnots != nullptr ) { knots.assign( initKnots->begin(), initKnots->end() ); uppKnotsIndex = (ptrdiff_t)knots.size() - 1; } diff --git a/C3d/Include/cur_nurbs3d.h b/C3d/Include/cur_nurbs3d.h index 25925f0..a546930 100644 --- a/C3d/Include/cur_nurbs3d.h +++ b/C3d/Include/cur_nurbs3d.h @@ -127,7 +127,7 @@ protected: */ MbNurbs3D( size_t deg, bool cls, const SArray & points, - const SArray * weights = c3d_null, const SArray * knots = c3d_null ); + const SArray * weights = nullptr, const SArray * knots = nullptr ); MbNurbs3D( const MbNurbs3D & ); public : virtual ~MbNurbs3D(); @@ -171,7 +171,7 @@ public : \en Returns pointer to the created object or null pointer in case of failure. \~ */ static MbNurbs3D * Create( size_t degree, const SArray & points, bool closed, - const SArray * weights = c3d_null ); + const SArray * weights = nullptr ); /** \brief \ru Создать сплайн. \en Create spline. \~ \details \ru Создать сплайн и установить параметры сплайна.\n @@ -238,7 +238,7 @@ public : \en Returns pointer to the created object or null pointer in case of failure. \~ */ static MbNurbs3D * CreateThrough( size_t degree, bool cls, const SArray & points, - const SArray & params, SArray * aKnots = c3d_null ); + const SArray & params, SArray * aKnots = nullptr ); /** \brief \ru Создать сплайн. \en Create spline. \~ \details \ru Сплайн, проходящий через заданные точки при заданных параметрах.\n @@ -259,7 +259,7 @@ public : \en Returns pointer to the created object or null pointer in case of failure. \~ */ static MbNurbs3D * CreateThrough( size_t degree, bool cls, const c3d::SpacePointsVector & points, - const c3d::DoubleVector & params, c3d::DoubleVector * aKnots = c3d_null ); + const c3d::DoubleVector & params, c3d::DoubleVector * aKnots = nullptr ); /** \brief \ru Заполнить NURBS по данным parasolid. \en Fill NURBS by parasolid data. \~ \details \ru Заполнить NURBS по данным parasolid.\n @@ -315,7 +315,7 @@ public: \en Closedness attribute. \~ */ bool Init( size_t degree, const SArray & points, bool closed, - const SArray * weights = c3d_null ); + const SArray * weights = nullptr ); /** \brief \ru Инициализация. \en Initialization. \~ \details \ru Установить параметры сплайна.\n @@ -452,7 +452,7 @@ public: bool cls, const SArray & points, const SArray & params, - SArray * aKnots = c3d_null ); + SArray * aKnots = nullptr ); /** \brief \ru Инициализация. \en Initialization. \~ \details \ru Сплайн, проходящий через заданные точки при заданных параметрах.\n @@ -474,7 +474,7 @@ public: bool cls, const c3d::SpacePointsVector & points, const c3d::DoubleVector & params, - c3d::DoubleVector * knots = c3d_null ); + c3d::DoubleVector * knots = nullptr ); /// \ru Установить тип формы. \en Set the type of shape. void SetFormType( MbeNurbsCurveForm f ) { form = f; } @@ -482,12 +482,12 @@ public: // \ru Общие функции математического объекта. \en The common functions of the mathematical object. virtual MbeSpaceType IsA() const; // \ru Тип элемента. \en A type of element. - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const ; // \ru Сделать копию элемента. \en Create a copy of the element. + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const ; // \ru Сделать копию элемента. \en Create a copy of the element. virtual bool IsSame ( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const; // \ru Является ли кривая копией данной кривой? \en Whether the curve is a duplicate of the current curve. virtual bool SetEqual ( const MbSpaceItem & ); // \ru Сделать равным. \en Make equal. - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг. \en Move. - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси. \en Rotate around an axis. + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг. \en Move. + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси. \en Rotate around an axis. virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта. \en Get properties of the object. virtual void SetProperties( const MbProperties & ); // \ru Записать свойства объекта. \en Set properties of the object. @@ -519,17 +519,17 @@ public: virtual MbNurbs3D * NurbsCurve( const MbCurveIntoNurbsInfo & ) const; virtual MbCurve3D * NurbsCurve( const MbNurbsParameters & ) const; // \ru Построить NURBS копию кривой. \en Construct a NURBS copy of a curve. - virtual MbCurve3D * TrimmBreak( double t1, double t2, int sense ) const; + virtual MbCurve3D * Trimmed( double t1, double t2, int sense ) const; virtual double GetRadius() const; // \ru Дать физический радиус объекта или ноль, если это невозможно. \en Get the physical radius of the object or null if it impossible. virtual bool GetCircleAxis ( MbAxis3D & ) const; // \ru Дать ось кривой \en Get the axis of the curve // \ru Дать плоскую кривую и плейсмент, если пространственная кривая плоская (после использования вызывать DeleteItem на двумерную кривую). \en Get a planar curve and placement, if the spatial curve is planar (after using the DeleteItem must be called for a two-dimensional curve) virtual bool GetPlaneCurve( MbCurve *& curve2d, MbPlacement3D & place, bool saveParams, PlanarCheckParams params = PlanarCheckParams() ) const; // \ru Ближайшая проекция точки на кривую. \en The nearest projection of a point onto the curve. - virtual bool NearPointProjection( const MbCartPoint3D &, double & t, bool ext, MbRect1D * tRange = c3d_null ) const; + virtual bool NearPointProjection( const MbCartPoint3D &, double & t, bool ext, MbRect1D * tRange = nullptr ) const; virtual void Refresh(); // \ru Сбросить все временные данные. \en Reset all temporary data. - virtual void Inverse( MbRegTransform * iReg = c3d_null ); // \ru Изменить направление. \en Change the direction. + virtual void Inverse( MbRegTransform * iReg = nullptr ); // \ru Изменить направление. \en Change the direction. // \ru Определить, является ли кривая репараметризованно такой же. \en Determine whether a reparameterized curve is the same. virtual bool IsReparamSame( const MbCurve3D & curve, double & factor ) const; @@ -537,7 +537,6 @@ public: virtual bool IsDegenerate ( double eps = METRIC_PRECISION ) const; // \ru Проверка вырожденности кривой. \en Check the curve degeneracy. void SetDegenerate(); // \ru Стать вырожденным. \en Became degenerate. - virtual MbCurve3D * Trimmed( double t1, double t2, int sense ) const; // \ru Создание усеченной кривой. \en Creation of a trimmed curve. /// \ru Усечение кривой. \en Trim the curve. MbNurbs3D * Trimm( double t1, double t2, int sense ) const; @@ -570,7 +569,7 @@ public: virtual double GetParam( ptrdiff_t i ) const; // \ru Выдать параметр для точки с заданным номером. \en Get parameter for a point with the given index. virtual void ResetTCalc() const; // \ru Сбросить текущее значение параметра \en Reset the current value of the parameter - virtual bool IsContinuousDerivative( bool & contLength, bool & contDirect, c3d::DoubleVector * params = c3d_null, double epsilon = EPSILON ) const; // \ru Непрерывна ли первая производная? \en Have the first derivative the continuous? + virtual bool IsContinuousDerivative( bool & contLength, bool & contDirect, c3d::DoubleVector * params = nullptr, double epsilon = EPSILON ) const; // \ru Непрерывна ли первая производная? \en Have the first derivative the continuous? // \ru Устранить разрывы первых производных по длине. \en Eliminate the discontinuities of the first derivative at length. virtual bool SetContinuousDerivativeLength( VERSION version, double epsilon = EPSILON ); @@ -672,8 +671,8 @@ public: // \ru Функции только 3D кривой. \en Functions of 3D curve only. - virtual MbCurve * GetMap( const MbMatrix3D &, MbRect1D * pRgn = c3d_null, - VERSION version = Math::DefaultMathVersion(), bool * coincParams = c3d_null ) const; // \ru Дать плоскую проекцию кривой. \en Get a planar projection of a curve. + virtual MbCurve * GetMap( const MbMatrix3D &, MbRect1D * pRgn = nullptr, + VERSION version = Math::DefaultMathVersion(), bool * coincParams = nullptr ) const; // \ru Дать плоскую проекцию кривой. \en Get a planar projection of a curve. virtual size_t GetCount() const; // \ru Количество разбиений для прохода в операциях с поверхностями. \en Count of subdivisions for pass in operations with surfaces. @@ -877,7 +876,7 @@ private: // \ru Расчет весовых функций и их первых производных. \en Calculation of weight functions and their first derivatives. ptrdiff_t WeightFunctions ( double & x, CcArray & m ) const; /// \ru Вычисление шага аппроксимации. \en Calculation of a step of approximation. - double StepD( double t, double sag, bool checkAngle, double angle = Math::lowRenderAng, MbNurbs3DAuxiliaryData * cache = c3d_null ) const; + double StepD( double t, double sag, bool checkAngle, double angle = Math::lowRenderAng, MbNurbs3DAuxiliaryData * cache = nullptr ) const; // \ru Вычисление шага аппроксимации сплайна второго порядка. \en Calculation of approximation step of second order spline. double PolylineStep( double t, bool half, MbNurbs3DAuxiliaryData * cache ) const; // \ru Уточнить проекцию \en Specify projection. diff --git a/C3d/Include/cur_nurbs_vector.h b/C3d/Include/cur_nurbs_vector.h index fb15fd8..84f10e0 100644 --- a/C3d/Include/cur_nurbs_vector.h +++ b/C3d/Include/cur_nurbs_vector.h @@ -29,7 +29,7 @@ public: double * w; public: - MbNURBSVector2D() : x( c3d_null ), y( c3d_null ), w( c3d_null ) {} + MbNURBSVector2D() : x( nullptr ), y( nullptr ), w( nullptr ) {} ~MbNURBSVector2D(); // \ru освободить память \en free memory public: @@ -51,7 +51,7 @@ private: // // --- inline void MbNURBSVector2D::Init( ptrdiff_t i, const MbCartPoint &ip, double iw ) { - if ( w != c3d_null ) { + if ( w != nullptr ) { x[i] = ( ip.x * iw ); y[i] = ( ip.y * iw ); w[i] = iw; @@ -69,7 +69,7 @@ inline void MbNURBSVector2D::Init( ptrdiff_t i, const MbCartPoint &ip, double iw inline void MbNURBSVector2D::SetZero( ptrdiff_t i ) { x[i] = 0.0; y[i] = 0.0; - if ( w != c3d_null ) + if ( w != nullptr ) w[i] = 0.0; } @@ -80,7 +80,7 @@ inline void MbNURBSVector2D::SetZero( ptrdiff_t i ) { inline void MbNURBSVector2D::Set( ptrdiff_t i, const MbNURBSVector2D &p, ptrdiff_t ip ) { x[i] = p.x[ip]; y[i] = p.y[ip]; - if ( w != c3d_null ) + if ( w != nullptr ) w[i] = p.w[ip]; } @@ -95,7 +95,7 @@ inline void MbNURBSVector2D::Dec( ptrdiff_t i, { x[i] = ( (p2.x[ip2] - p1.x[ip1]) * kk ); y[i] = ( (p2.y[ip2] - p1.y[ip1]) * kk ); - if ( w != c3d_null ) + if ( w != nullptr ) w[i] = ( (p2.w[ip2] - p1.w[ip1]) * kk ); } @@ -107,7 +107,7 @@ inline void MbNURBSVector2D::Set( ptrdiff_t i, const MbNURBSVector2D & p, ptrdif { x[i] = ( p.x[ip] * kk ); y[i] = ( p.y[ip] * kk ); - if ( w != c3d_null ) + if ( w != nullptr ) w[i] = ( p.w[ip] * kk ); } diff --git a/C3d/Include/cur_nurbs_vector3d.h b/C3d/Include/cur_nurbs_vector3d.h index 2a2c85f..cbc1ca0 100644 --- a/C3d/Include/cur_nurbs_vector3d.h +++ b/C3d/Include/cur_nurbs_vector3d.h @@ -212,7 +212,7 @@ inline void MbNURBSVector::Set( ptrdiff_t i, const MbNURBSVector & p, ptrdiff_t inline void MbNURBSVector::Set( ptrdiff_t i, const DoubleTriple * t, double * ww, ptrdiff_t ip ) { _vec[i].Init( t[ip].x , t[ip].y , t[ip].z ); - if ( useWeights && ww != c3d_null ) + if ( useWeights && ww != nullptr ) w(i) = ww[ip]; } diff --git a/C3d/Include/cur_offset_curve.h b/C3d/Include/cur_offset_curve.h index 7ef7470..690a2e6 100644 --- a/C3d/Include/cur_offset_curve.h +++ b/C3d/Include/cur_offset_curve.h @@ -40,7 +40,7 @@ class MbRegTransform; // --- class MATH_CLASS MbOffsetCurve : public MbCurve { protected : - MbCurve * basisCurve; ///< \ru Базовая кривая (всегда не c3d_null) \en Base curve (always not c3d_null). + MbCurve * basisCurve; ///< \ru Базовая кривая (всегда не nullptr) \en Base curve (always not nullptr). double tmin; ///< \ru Начальный параметр basisCurve. \en Start parameter of basisCurve. double tmax; ///< \ru Конечный параметр basisCurve. \en End parameter of basisCurve. bool closed; ///< \ru Замкнутость basisCurve. \en Closedness of basisCurve. @@ -102,10 +102,10 @@ public : virtual MbePlaneType IsA() const; // \ru Тип элемента \en Type of element virtual bool IsSimilar ( const MbPlaneItem & ) const; // \ru Являются ли элементы подобными \en Whether the elements are similar virtual bool SetEqual( const MbPlaneItem & ); // \ru Сделать элементы равными \en Make equal elements - virtual MbPlaneItem & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента \en Create a copy of the element - virtual void Transform( const MbMatrix & matr, MbRegTransform * ireg = c3d_null, const MbSurface * newSurface = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move( const MbVector & to, MbRegTransform * = c3d_null, const MbSurface * newSurface = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate( const MbCartPoint & pnt, const MbDirection & angle, MbRegTransform * = c3d_null, const MbSurface * newSurface = c3d_null ); // \ru Поворот \en Rotation + virtual MbPlaneItem & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента \en Create a copy of the element + virtual void Transform( const MbMatrix & matr, MbRegTransform * ireg = nullptr, const MbSurface * newSurface = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move( const MbVector & to, MbRegTransform * = nullptr, const MbSurface * newSurface = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate( const MbCartPoint & pnt, const MbDirection & angle, MbRegTransform * = nullptr, const MbSurface * newSurface = nullptr ); // \ru Поворот \en Rotation virtual bool IsSame( const MbPlaneItem & other, double accuracy = LENGTH_EPSILON ) const; // \ru Является ли кривая curve копией данной кривой ? \en Whether the 'curve' curve is duplicate of current curve. virtual void AddYourGabaritTo( MbRect & ) const; // \ru Добавь свой габарит в прямой прям-к \en Add bounding box into a straight box @@ -192,7 +192,7 @@ public : \{ */ virtual bool IsStraight( bool ignoreParams = false ) const; // \ru Является ли линия прямолинейной \en Whether the line is straight virtual MbCurve * Offset( double rad ) const; // \ru Смещение смещенной кривой \en Offset of the offset curve - virtual void Inverse( MbRegTransform * iReg = c3d_null ); // \ru Изменение направления кривой на противоположное \en Change to the opposite direction of a curve + virtual void Inverse( MbRegTransform * iReg = nullptr ); // \ru Изменение направления кривой на противоположное \en Change to the opposite direction of a curve virtual void Refresh(); // \ru Сбросить все временные данные \en Reset all temporary data virtual void PrepareIntegralData( const bool forced ) const; // \ru Рассчитать временные (mutable) данные объекта. \en Calculate temporary (mutable) data of an object. @@ -237,7 +237,7 @@ public : virtual void GetBasisPoints( MbControlData & ) const; // \ru Выдать контрольные точки объекта. \en Get control points of object. virtual void SetBasisPoints( const MbControlData & ); // \ru Изменить объект по контрольным точкам. \en Change the object by control points. - virtual bool IsContinuousDerivative( bool & contLength, bool & contDirect, c3d::DoubleVector * params = c3d_null, double epsilon = EPSILON ) const; // \ru Непрерывна ли первая производная? \en Have the first derivative the continuous? + virtual bool IsContinuousDerivative( bool & contLength, bool & contDirect, c3d::DoubleVector * params = nullptr, double epsilon = EPSILON ) const; // \ru Непрерывна ли первая производная? \en Have the first derivative the continuous? // \ru Устранить разрывы первых производных по длине. \en Eliminate the discontinuities of the first derivative at length. virtual bool SetContinuousDerivativeLength( VERSION version, double epsilon = EPSILON ); diff --git a/C3d/Include/cur_offset_curve3d.h b/C3d/Include/cur_offset_curve3d.h index 0a7938e..18a36a3 100644 --- a/C3d/Include/cur_offset_curve3d.h +++ b/C3d/Include/cur_offset_curve3d.h @@ -130,7 +130,7 @@ public: // \ru Общие функции математического объекта \en Common functions of the mathematical object virtual MbeSpaceType IsA() const; // \ru Тип элемента \en Type of element - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента \en Create a copy of the element + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента \en Create a copy of the element virtual bool IsSame ( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const; virtual bool SetEqual ( const MbSpaceItem & ); // \ru Сделать равным \en Make equal virtual bool IsSimilar( const MbSpaceItem & ) const; // \ru Являются ли объекты подобными \en Whether the objects are similar @@ -174,7 +174,7 @@ public: virtual const MbCurve3D & GetBasisCurve() const; virtual MbCurve3D & SetBasisCurve(); //virtual MbCurve3D * Trimmed( double t1, double t2, int sense ) const; // \ru Создание усеченной кривой \en Creation of a trimmed curve - virtual void Inverse( MbRegTransform * iReg = c3d_null ); // \ru Изменить направление \en Change direction + virtual void Inverse( MbRegTransform * iReg = nullptr ); // \ru Изменить направление \en Change direction virtual size_t GetCount() const; virtual void ChangeCarrier( const MbSpaceItem & item, MbSpaceItem & init ); // \ru Изменение носителя \en Changing of carrier @@ -183,7 +183,7 @@ public: virtual bool GetPlacement( MbPlacement3D & place, PlanarCheckParams params = PlanarCheckParams() ) const; // \ru Заполнить плейсемент, ести кривая плоская \en Fill the placement if curve is planar - virtual bool IsContinuousDerivative( bool & contLength, bool & contDirect, c3d::DoubleVector * params = c3d_null, double epsilon = EPSILON ) const; // \ru Непрерывна ли первая производная? \en Have the first derivative the continuous? + virtual bool IsContinuousDerivative( bool & contLength, bool & contDirect, c3d::DoubleVector * params = nullptr, double epsilon = EPSILON ) const; // \ru Непрерывна ли первая производная? \en Have the first derivative the continuous? // \ru Устранить разрывы первых производных по длине. \en Eliminate the discontinuities of the first derivative at length. virtual bool SetContinuousDerivativeLength( VERSION version, double epsilon = EPSILON ); diff --git a/C3d/Include/cur_plane_curve.h b/C3d/Include/cur_plane_curve.h index 8e72100..ee034f6 100644 --- a/C3d/Include/cur_plane_curve.h +++ b/C3d/Include/cur_plane_curve.h @@ -37,7 +37,7 @@ class MATH_CLASS MbContour; class MATH_CLASS MbPlaneCurve : public MbCurve3D { protected : MbPlacement3D position; ///< \ru Локальная система координат, в плоскости XY которой расположена кривая. \en The local coordinate system in XY plane of which the curve is located. - MbCurve * curve; ///< \ru Двумерная кривая (не может быть c3d_null). \en A two-dimensional uv-curve (can not be c3d_null). + MbCurve * curve; ///< \ru Двумерная кривая (не может быть nullptr). \en A two-dimensional uv-curve (can not be nullptr). mutable MbCube cube; ///< \ru Габаритный куб. \en Bounding box. @@ -58,13 +58,13 @@ public : // \ru Общие функции математического объекта \en Common functions of the mathematical object virtual MbeSpaceType IsA() const; // \ru Тип элемента \en Type of element - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const ; // \ru Сделать копию элемента \en Create a copy of the element + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const ; // \ru Сделать копию элемента \en Create a copy of the element virtual bool IsSame ( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const; // \ru Является ли объект копией \en Whether the object is a copy virtual bool SetEqual ( const MbSpaceItem & ); // \ru Сделать равным \en Make equal virtual bool IsSimilar( const MbSpaceItem & ) const; // \ru Являются ли объекты подобными \en Whether the objects are similar - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать \en Transform. - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate about an axis + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать \en Transform. + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate about an axis virtual double DistanceToPoint( const MbCartPoint3D & ) const; // \ru Расстояние до точки \en Distance to a point virtual void PrepareIntegralData( const bool forced ) const; // \ru Рассчитать временные (mutable) данные объекта. \en Calculate temporary (mutable) data of an object. @@ -104,8 +104,8 @@ public : virtual MbCurve3D * Trimmed( double t1, double t2, int sense ) const; // \ru Создание усеченной кривой \en Creation of a trimmed curve - virtual void Inverse( MbRegTransform * iReg = c3d_null ); // \ru Изменить направление \en Change direction - virtual bool NearPointProjection( const MbCartPoint3D &, double & t, bool ext, MbRect1D * tRange = c3d_null ) const; // \ru Ближайшая проекция точки на кривую \en The nearest point projection to the curve + virtual void Inverse( MbRegTransform * iReg = nullptr ); // \ru Изменить направление \en Change direction + virtual bool NearPointProjection( const MbCartPoint3D &, double & t, bool ext, MbRect1D * tRange = nullptr ) const; // \ru Ближайшая проекция точки на кривую \en The nearest point projection to the curve virtual double Curvature( double ) const; // \ru Кривизна кривой \en Curvature of the curve virtual double Step ( double t, double sag ) const; // \ru Вычисление шага по стрелке прогиба. \en Calculation of parameter step by the sag. virtual double DeviationStep( double t, double angle ) const; // \ru Вычисление шага по углу отклонения нормали. \en Calculation of parameter step by the deviation angle. @@ -127,10 +127,10 @@ public : // \ru Ближайшая точка кривой к плейсменту \en The nearest point of a curve by the placement virtual double DistanceToPlace( const MbPlacement3D & place, double & t0, double & angle ) const; - virtual MbCurve * GetMap( const MbMatrix3D &, MbRect1D * pRgn = c3d_null, - VERSION version = Math::DefaultMathVersion(), bool * coincParams = c3d_null ) const; // \ru Дать плоскую проекцию кривой \en Get a planar projection of curve + virtual MbCurve * GetMap( const MbMatrix3D &, MbRect1D * pRgn = nullptr, + VERSION version = Math::DefaultMathVersion(), bool * coincParams = nullptr ) const; // \ru Дать плоскую проекцию кривой \en Get a planar projection of curve virtual MbCurve * GetMapPsp( const MbMatrix3D &, double zNear, - MbRect1D * pRgn = c3d_null ) const; + MbRect1D * pRgn = nullptr ) const; virtual double GetRadius() const; // \ru Дать физический радиус объекта или ноль, если это невозможно. \en Get the physical radius of the object or null if it impossible. virtual bool GetCircleAxis ( MbAxis3D & ) const; // \ru Дать ось кривой \en Get the curve axis @@ -167,9 +167,11 @@ public : virtual bool IsShift( const MbSpaceItem &, MbVector3D &, bool & isSame, double accuracy = LENGTH_EPSILON ) const; virtual bool IsSimilarToCurve( const MbCurve3D & curve, double precision = METRIC_PRECISION ) const; // \ru Подобные ли кривые для объединения (слива) \en Whether the curves are similar for merge (joining) - virtual bool IsContinuousDerivative( bool & contLength, bool & contDirect, c3d::DoubleVector * params = c3d_null, double epsilon = EPSILON ) const; // \ru Непрерывна ли первая производная? \en Have the first derivative the continuous? + virtual bool IsContinuousDerivative( bool & contLength, bool & contDirect, c3d::DoubleVector * params = nullptr, double epsilon = EPSILON ) const; // \ru Непрерывна ли первая производная? \en Have the first derivative the continuous? // \ru Устранить разрывы первых производных по длине. \en Eliminate the discontinuities of the first derivative at length. virtual bool SetContinuousDerivativeLength( VERSION version, double epsilon = EPSILON ); + /// \ ru Определение точек излома кривой. \en The determination of curve smoothness break points. + virtual void BreakPoints( std::vector & vBreaks, double precision = ANGLE_REGION ) const; private: void operator = ( const MbPlaneCurve & ); // \ru Не реализовано. \en Not implemented. diff --git a/C3d/Include/cur_point_curve.h b/C3d/Include/cur_point_curve.h index 44908b9..88a52aa 100644 --- a/C3d/Include/cur_point_curve.h +++ b/C3d/Include/cur_point_curve.h @@ -65,10 +65,10 @@ public : virtual MbePlaneType IsA() const; // \ru Тип элемента \en Type of element virtual bool SetEqual( const MbPlaneItem & ); // \ru Сделать элементы равными \en Make equal elements - virtual MbPlaneItem & Duplicate( MbRegDuplicate * = c3d_null ) const; - virtual void Move ( const MbVector &, MbRegTransform * = c3d_null, const MbSurface * newSurface = c3d_null ); - virtual void Rotate( const MbCartPoint & pnt, const MbDirection & angle, MbRegTransform * = c3d_null, const MbSurface * newSurface = c3d_null ); // \ru Поворот \en Rotation - virtual void Transform( const MbMatrix &, MbRegTransform * ireg = c3d_null, const MbSurface * newSurface = c3d_null ); + virtual MbPlaneItem & Duplicate( MbRegDuplicate * = nullptr ) const; + virtual void Move ( const MbVector &, MbRegTransform * = nullptr, const MbSurface * newSurface = nullptr ); + virtual void Rotate( const MbCartPoint & pnt, const MbDirection & angle, MbRegTransform * = nullptr, const MbSurface * newSurface = nullptr ); // \ru Поворот \en Rotation + virtual void Transform( const MbMatrix &, MbRegTransform * ireg = nullptr, const MbSurface * newSurface = nullptr ); virtual void AddYourGabaritTo ( MbRect & ) const; // \ru Добавь свой габарит в прямой прям-к \en Add bounding box into a straight box virtual void CalculateLocalGabarit( const MbMatrix & into, MbRect & local ) const; // \ru Добавь в прям-к свой габарит с учетом матрицы \en Add bounding box into a box with consideration of the matrix virtual double DistanceToPoint( const MbCartPoint & to ) const; // \ru Расстояние до точки \en Distance to a point @@ -131,7 +131,7 @@ public : \en \name Common function of curve \{ */ virtual double Curvature( double t ) const; // \ru Кривизна усеченной кривой \en Curvature of a trimmed curve - virtual void Inverse( MbRegTransform * iReg = c3d_null ); // \ru Изменить направление кривой \en Change direction of a curve + virtual void Inverse( MbRegTransform * iReg = nullptr ); // \ru Изменить направление кривой \en Change direction of a curve virtual bool IsDegenerate( double eps = Math::LengthEps ) const; // \ru Проверка вырожденности \en Check for degeneracy virtual bool HasLength( double & length ) const; @@ -154,7 +154,7 @@ public : virtual MbeItemLocation PointRelative( const MbCartPoint & pnt, double eps = Math::LengthEps ) const; virtual double PointProjection( const MbCartPoint & pnt ) const; // \ru Проекция точки на отрезок \en Point projection on the line segment virtual bool NearPointProjection( const MbCartPoint & pnt, double xEpsilon, double yEpsilon, - double & t, bool ext, MbRect1D * tRange = c3d_null ) const; // \ru Проекция точки на кривую или её продолжение в области поиска проекции \en Point projection on the curve or its extension in the projection search area + double & t, bool ext, MbRect1D * tRange = nullptr ) const; // \ru Проекция точки на кривую или её продолжение в области поиска проекции \en Point projection on the curve or its extension in the projection search area virtual void IntersectHorizontal( double y, SArray & cross ) const; // \ru Пересечение с горизонтальной прямой \en Intersection with the horizontal line virtual void IntersectVertical ( double x, SArray & cross ) const; // \ru Пересечение с вертикальной прямой \en Intersection with the vertical line diff --git a/C3d/Include/cur_polycurve.h b/C3d/Include/cur_polycurve.h index 079524b..45e3e4b 100644 --- a/C3d/Include/cur_polycurve.h +++ b/C3d/Include/cur_polycurve.h @@ -54,10 +54,10 @@ public : virtual MbePlaneType Type() const; // \ru Тип элемента \en Type of element virtual bool SetEqual( const MbPlaneItem & ) = 0; // \ru Сделать элементы равными \en Make the elements equal virtual bool IsSame( const MbPlaneItem & other, double accuracy = LENGTH_EPSILON ) const = 0; // \ru Является ли кривая curve копией данной кривой ? \en Whether curve 'curve' is a duplicate of the current curve. - virtual void Transform( const MbMatrix & matr, MbRegTransform * ireg = c3d_null, const MbSurface * newSurface = c3d_null ) = 0; // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move( const MbVector & to, MbRegTransform * = c3d_null, const MbSurface * newSurface = c3d_null ) = 0; // \ru Сдвиг \en Translation - virtual void Rotate( const MbCartPoint & pnt, const MbDirection & angle, MbRegTransform * = c3d_null, const MbSurface * newSurface = c3d_null ) = 0; // \ru Поворот \en Rotation - virtual MbPlaneItem & Duplicate( MbRegDuplicate * = c3d_null ) const = 0; // \ru Сделать копию элемента \en Create a copy of the element + virtual void Transform( const MbMatrix & matr, MbRegTransform * ireg = nullptr, const MbSurface * newSurface = nullptr ) = 0; // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move( const MbVector & to, MbRegTransform * = nullptr, const MbSurface * newSurface = nullptr ) = 0; // \ru Сдвиг \en Translation + virtual void Rotate( const MbCartPoint & pnt, const MbDirection & angle, MbRegTransform * = nullptr, const MbSurface * newSurface = nullptr ) = 0; // \ru Поворот \en Rotation + virtual MbPlaneItem & Duplicate( MbRegDuplicate * = nullptr ) const = 0; // \ru Сделать копию элемента \en Create a copy of the element virtual void AddYourGabaritTo( MbRect & r ) const; // \ru Добавь свой габарит в прямой прям-к \en Add your own gabarit into the given bounding rectangle virtual void Refresh(); // \ru Сбросить все временные данные \en Reset all temporary data virtual void PrepareIntegralData( const bool forced ) const; // \ru Рассчитать временные (mutable) данные объекта. \en Calculate temporary (mutable) data of an object. @@ -94,7 +94,7 @@ public : virtual bool IsStraight( bool ignoreParams = false ) const; // \ru Признак прямолинейности кривой \en An attribute of curve straightness. virtual bool HasLength( double & length ) const; - virtual void Inverse( MbRegTransform * iReg = c3d_null ) = 0; // \ru Изменение направления кривой на противоположное \en Change curve direction to the opposite one + virtual void Inverse( MbRegTransform * iReg = nullptr ) = 0; // \ru Изменение направления кривой на противоположное \en Change curve direction to the opposite one virtual MbeState Deformation( const MbRect &, const MbMatrix & ); // \ru Деформация \en Deformation virtual bool IsInRectForDeform( const MbRect & r ) const; // \ru Виден ли объект в заданном прямоугольнике для деформации \en Whether the object is visible in the given rectangle for deformation diff --git a/C3d/Include/cur_polycurve3d.h b/C3d/Include/cur_polycurve3d.h index 99d259a..f71c056 100644 --- a/C3d/Include/cur_polycurve3d.h +++ b/C3d/Include/cur_polycurve3d.h @@ -47,12 +47,12 @@ public : virtual MbeSpaceType IsA() const = 0; // \ru Тип элемента \en Type of element virtual MbeSpaceType Type() const; // \ru Тип элемента \en Type of element - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const = 0; // \ru Сделать копию элемента \en Create a copy of the element + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const = 0; // \ru Сделать копию элемента \en Create a copy of the element virtual bool IsSame ( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const = 0; virtual bool SetEqual ( const MbSpaceItem & ) = 0; // \ru Сделать равным \en Make equal - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ) = 0; // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ) = 0; // \ru Сдвиг \en Translation - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ) = 0; // \ru Повернуть вокруг оси \en Rotate about an axis + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ) = 0; // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ) = 0; // \ru Сдвиг \en Translation + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ) = 0; // \ru Повернуть вокруг оси \en Rotate about an axis virtual void AddYourGabaritTo( MbCube & ) const; // \ru Добавь свой габарит в куб \en Add your own bounding box into the cube virtual void PrepareIntegralData( const bool forced ) const; // \ru Рассчитать временные (mutable) данные объекта. \en Calculate temporary (mutable) data of an object. @@ -77,12 +77,10 @@ public : virtual MbNurbs3D * NurbsCurve( const MbCurveIntoNurbsInfo & ) const = 0; - virtual MbCurve3D * TrimmBreak( double t1, double t2, int sense ) const = 0; // \ru Создание усеченной кривой \en Create a trimmed curve - virtual double GetTMax() const = 0; // \ru Вернуть максимальное значение параметра \en Get the maximum value of parameter virtual double GetTMin() const = 0; // \ru Вернуть минимальное значение параметра \en Get the minimum value of parameter virtual bool IsClosed() const; // \ru Замкнутость кривой \en A curve closedness - virtual void Inverse( MbRegTransform * iReg = c3d_null ) = 0; // \ru Изменить направление \en Change direction + virtual void Inverse( MbRegTransform * iReg = nullptr ) = 0; // \ru Изменить направление \en Change direction virtual double GetMetricLength() const; // \ru Выдать метрическую длину ограниченной кривой \en Get metric length of bounded curve virtual double GetLengthEvaluation() const; // \ru Оценка метрической длины кривой \en Estimation of metric length of the curve diff --git a/C3d/Include/cur_polyline.h b/C3d/Include/cur_polyline.h index 9087c8c..6731f76 100644 --- a/C3d/Include/cur_polyline.h +++ b/C3d/Include/cur_polyline.h @@ -51,7 +51,7 @@ public : MbPolyline( const MbCartPoint & p1, const MbCartPoint & p2 ) : MbPolyCurve() , segmentsCount( 1 ) - , searchTree( c3d_null ) + , searchTree( nullptr ) { pointList.reserve( 2 ); pointList.push_back( p1 ); @@ -60,11 +60,11 @@ public : closed = false; } // \ru Конструктор по набору точек и признаку замкнутости. \en Constructor by points and closedness state. - template - MbPolyline( const Points & initList, bool cls ) + template + MbPolyline( const PointsVector & initList, bool cls ) : MbPolyCurve() , segmentsCount( UNDEFINED_INT_T ) - , searchTree( c3d_null ) + , searchTree( nullptr ) { Init( initList, cls ); } @@ -86,11 +86,11 @@ public : virtual MbePlaneType IsA() const; // \ru Тип элемента \en Type of element virtual bool SetEqual( const MbPlaneItem & ); // \ru Сделать элементы равными \en Make the elements equal - virtual bool IsSame( const MbPlaneItem & other, double accuracy = LENGTH_EPSILON ) const; // \ru Является ли кривая curve копией данной кривой ? \en Whether curve 'curve' is a duplicate of the current curve. - virtual void Transform( const MbMatrix & matr, MbRegTransform * ireg = c3d_null, const MbSurface * newSurface = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move( const MbVector & to, MbRegTransform * = c3d_null, const MbSurface * newSurface = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate( const MbCartPoint & pnt, const MbDirection & angle, MbRegTransform * = c3d_null, const MbSurface * newSurface = c3d_null ); // \ru Поворот \en Rotation - virtual MbPlaneItem & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента \en Create a copy of the element + virtual bool IsSame( const MbPlaneItem &, double accuracy = LENGTH_EPSILON ) const; // \ru Является ли кривая curve копией данной кривой ? \en Whether curve 'curve' is a duplicate of the current curve. + virtual void Transform( const MbMatrix &, MbRegTransform * = nullptr, const MbSurface * newSurface = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move( const MbVector &, MbRegTransform * = nullptr, const MbSurface * newSurface = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate( const MbCartPoint &, const MbDirection & angle, MbRegTransform * = nullptr, const MbSurface * newSurface = nullptr ); // \ru Поворот \en Rotation + virtual MbPlaneItem & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента \en Create a copy of the element virtual void Refresh(); // \ru Сбросить все временные данные \en Reset all temporary data /** \} */ @@ -145,8 +145,8 @@ public : /// \ru Инициализация по другой ломаной. \en Initialization by another polyline. void Init( const MbPolyline & ); /// \ru Инициализация по точкам и признаку замкнутости. \en Initialization by points and an attribute of closedness. - template - bool Init( const Points & initList, bool cls ) + template + bool Init( const PointsVector & initList, bool cls ) { if ( initList.size() > 1 ) { pointList.clear(); @@ -189,7 +189,7 @@ public : virtual bool IsStraight( bool ignoreParams = false ) const; // \ru Признак прямолинейности кривой \en An attribute of curve straightness. - virtual void Inverse( MbRegTransform * iReg = c3d_null ); // \ru Изменение направления кривой на противоположное \en Change curve direction to the opposite one + virtual void Inverse( MbRegTransform * iReg = nullptr ); // \ru Изменение направления кривой на противоположное \en Change curve direction to the opposite one virtual double CalculateMetricLength() const; // \ru Посчитать метрическую длину \en Calculate the metric length virtual double GetLengthEvaluation() const; // \ru Оценка метрической длины кривой \en Estimation of metric length of the curve @@ -253,7 +253,7 @@ public : virtual bool IsDegenerate( double eps = Math::LengthEps ) const; // \ru Проверка вырожденности кривой \en Check for curve degeneracy virtual bool IsSmoothConnected( double angleEps ) const; // \ru Являются ли стыки контура\кривой гладкими? \en Whether the joints of a contour\curve are smooth. - virtual bool IsContinuousDerivative( bool & contLength, bool & contDirect, c3d::DoubleVector * params = c3d_null, double epsilon = EPSILON ) const; // \ru Непрерывна ли первая производная? \en Have the first derivative the continuous? + virtual bool IsContinuousDerivative( bool & contLength, bool & contDirect, c3d::DoubleVector * params = nullptr, double epsilon = EPSILON ) const; // \ru Непрерывна ли первая производная? \en Have the first derivative the continuous? // \ru Устранить разрывы первых производных по длине. \en Eliminate the discontinuities of the first derivative at length. virtual bool SetContinuousDerivativeLength( VERSION version, double epsilon = EPSILON ); @@ -265,7 +265,7 @@ public : \en \name Functions of polyline \{ */ - void Trimm( SArray & point, double t1, double t2 ) const; + void Trimm( SArray & point, double t1, double t2, double eps = Math::LengthEps ) const; // \ru Выдать среднюю точку сегмента полилинии \en Get mid-point of a segment of a polyline bool GetSegmentMiddlePoint( const MbCartPoint & from, MbCartPoint & midPoint ) const; @@ -283,8 +283,12 @@ public : // \ru Построить точки и параметры для гладкого сплайна. \en Create points and parameters for a smooth spline. bool GetSplinePoints( SArray & points, SArray & arParams ) const; MbCubicSpline * CubicSpline() const; // \ru Построить гладкий сплайн из ломаной. \en Create a smooth spline from a polyline. + ptrdiff_t GetSegmentsCount() const { return segmentsCount; } + double Step ( double t, double sag, ThreeStates dir ) const; ///< \ru Шаг параметра с учетом радиуса кривизны. \en Step of parameter with consideration of curvature. + double DeviationStep( double t, double angle, ThreeStates dir ) const; ///< \ru Шаг параметра по заданному углу отклонения касательной. \en Step of parameter by a given angle of deviation of tangent. + /** \brief \ru Определить точки пересечения с отрезком. \en Determine points of intersection with a line segment. \~ \details \ru Определить точки пересечения ломаной и отрезка. \n diff --git a/C3d/Include/cur_polyline3d.h b/C3d/Include/cur_polyline3d.h index 3e26839..fe3a5bc 100644 --- a/C3d/Include/cur_polyline3d.h +++ b/C3d/Include/cur_polyline3d.h @@ -77,8 +77,9 @@ public : /// \ru Инициализация по другой плоской ломаной. \en Initialization by another planar polyline. void Init( const MbPolyline &, const MbPlacement3D & ); /// \ru Инициализация по точкам и признаку замкнутости. \en Initialization by points and an attribute of closedness. - template - bool Init( const Points & initList, bool cls ) { + template + bool Init( const PointsVector & initList, bool cls ) + { if ( initList.size() > 1 ) { pointList = initList; uppIndex = (ptrdiff_t)pointList.size() - 1; @@ -90,6 +91,7 @@ public : } segmentsCount = ( uppIndex > 0 ) ? ( uppIndex + !!closed ) : 0; Refresh(); + return true; } return false; } @@ -99,24 +101,24 @@ public : // \ru Общие функции математического объекта \en Common functions of the mathematical object virtual MbeSpaceType IsA() const; // \ru Тип элемента \en Type of element - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const ; // \ru Сделать копию элемента \en Create a copy of the element - virtual bool IsSame ( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const; - virtual bool SetEqual ( const MbSpaceItem & ); // \ru Сделать равным \en Make equal - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать \en Transform - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate about an axis - virtual double DistanceToPoint( const MbCartPoint3D & ) const;// \ru Расстояние до точки \en Distance to a point + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const ; // \ru Сделать копию элемента. \en Create a copy of the element. + virtual bool IsSame ( const MbSpaceItem &, double accuracy = LENGTH_EPSILON ) const; + virtual bool SetEqual ( const MbSpaceItem & ); // \ru Сделать равным. \en Make equal. + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать. \en Transform. + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг. \en Translation. + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси. \en Rotate about an axis. + virtual double DistanceToPoint( const MbCartPoint3D & ) const;// \ru Расстояние до точки. \en Distance to a point. - virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта \en Get properties of the object - virtual void SetProperties( const MbProperties & ); // \ru Записать свойства объекта \en Set properties of the object + virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта. \en Get properties of the object. + virtual void SetProperties( const MbProperties & ); // \ru Записать свойства объекта. \en Set properties of the object. // \ru Общие функции полилинии \en Common functions of polyline // \ru Функции кривой для работы в области определения параметрической кривой \en Functions of curve for working at parametric curve domain - virtual void PointOn ( double & t, MbCartPoint3D & ) const;// \ru Точка на кривой \en Point on the curve - virtual void FirstDer ( double & t, MbVector3D & ) const; // \ru Первая производная \en The first derivative - virtual void SecondDer( double & t, MbVector3D & ) const; // \ru Вторая производная \en The second derivative - virtual void ThirdDer ( double & t, MbVector3D & ) const; // \ru Третья производная \en The third derivative + virtual void PointOn ( double & t, MbCartPoint3D & ) const;// \ru Точка на кривой. \en Point on the curve. + virtual void FirstDer ( double & t, MbVector3D & ) const; // \ru Первая производная. \en The first derivative. + virtual void SecondDer( double & t, MbVector3D & ) const; // \ru Вторая производная. \en The second derivative. + virtual void ThirdDer ( double & t, MbVector3D & ) const; // \ru Третья производная. \en The third derivative. // \ru Вычислить значения точки и производных для заданного параметра. \en Calculate point and derivatives of object for given parameter. \~ virtual void Explore( double & t, bool ext, MbCartPoint3D & pnt, MbVector3D & fir, MbVector3D * sec, MbVector3D * thir ) const; @@ -125,63 +127,67 @@ public : virtual MbNurbs3D * NurbsCurve( const MbCurveIntoNurbsInfo & ) const; virtual MbCurve3D * NurbsCurve( const MbNurbsParameters & ) const; - virtual MbCurve3D * TrimmBreak( double t1, double t2, int sense ) const; - void Trimm( SArray & points, double t1, double t2 ) const; + virtual MbCurve3D * Trimmed( double t1, double t2, int sense ) const; + void Trimm( SArray & points, double t1, double t2, double eps = METRIC_EPSILON ) const; - virtual double GetTMin() const; // \ru Вернуть минимальное значение параметра \en Get the minimum value of the parameter - virtual double GetTMax() const; // \ru Вернуть максимальное значение параметра \en Get the maximum value of parameter - virtual void Inverse( MbRegTransform * iReg = c3d_null ); // \ru Изменить направление \en Change direction + virtual double GetTMin() const; // \ru Вернуть минимальное значение параметра. \en Get the minimum value of the parameter. + virtual double GetTMax() const; // \ru Вернуть максимальное значение параметра. \en Get the maximum value of parameter. + virtual void Inverse( MbRegTransform * iReg = nullptr ); // \ru Изменить направление \en Change direction virtual double Step ( double t, double sag ) const; // \ru Шаг параметра с учетом радиуса кривизны \en Step of parameter with consideration of curvature virtual double DeviationStep( double t, double angle ) const; // \ru Шаг параметра по заданному углу отклонения касательной \en Step of parameter by a given angle of deviation of tangent virtual bool IsStraight( bool ignoreParams = false ) const; // \ru Признак прямолинейности кривой \en An attribute of curve straightness. - virtual void CalculateGabarit( MbCube & ) const; // \ru Определить габариты кривой \en Determine the bounding box of a curve - virtual void CalculateLocalGabarit( const MbMatrix3D &, MbCube & ) const; // \ru Рассчитать габарит относительно л.с.к. \en Calculate bounding box relative to the local coordinate system + virtual void CalculateGabarit( MbCube & ) const; // \ru Определить габариты кривой. \en Determine the bounding box of a curve. + virtual void CalculateLocalGabarit( const MbMatrix3D &, MbCube & ) const; // \ru Рассчитать габарит относительно л.с.к. \en Calculate bounding box relative to the local coordinate system. - virtual double CalculateMetricLength() const; // \ru Посчитать метрическую длину \en Calculate the metric length - virtual void GetCentre ( MbCartPoint3D & wc ) const; // \ru Посчитать центр кривой \en Calculate the center of a curve - virtual void GetWeightCentre( MbCartPoint3D & wc ) const; // \ru Посчитать центр тяжести кривой \en Calculate the gravity center of the curve - // \ru Дать плоскую кривую и плейсмент, если пространственная кривая плоская (после использования вызывать DeleteItem на двумерную кривую) \en Get the planar curve and placement if the spatial curve is planar (call DeleteItem for two-dimensional curve after using) + virtual double CalculateMetricLength() const; // \ru Посчитать метрическую длину. \en Calculate the metric length. + virtual void GetCentre ( MbCartPoint3D & wc ) const; // \ru Посчитать центр кривой. \en Calculate the center of a curve. + virtual void GetWeightCentre( MbCartPoint3D & wc ) const; // \ru Посчитать центр тяжести кривой. \en Calculate the gravity center of the curve. + // \ru Дать плоскую кривую и плейсмент, если пространственная кривая плоская (после использования вызывать DeleteItem на двумерную кривую). \en Get the planar curve and placement if the spatial curve is planar (call DeleteItem for two-dimensional curve after using). virtual bool GetPlaneCurve( MbCurve *& curve2d, MbPlacement3D & place, bool saveParams, PlanarCheckParams params = PlanarCheckParams() ) const; // \ru Общие функции полигональной кривой \en Common functions of polygonal curve virtual void Rebuild(); // \ru Перестроить кривую \en Rebuild curve - virtual void GetRuleInterval( ptrdiff_t index, double & t1, double & t2 ) const; // \ru Выдать интервал влияния точки кривой \en Get the interval of point influence + virtual void GetRuleInterval( ptrdiff_t index, double & t1, double & t2 ) const; // \ru Выдать интервал влияния точки кривой. \en Get the interval of point influence. // \ru Функции только 3D кривой \en Functions of 3D curve only - virtual bool NearPointProjection( const MbCartPoint3D &, double & t, bool ext, MbRect1D * tRange = c3d_null ) const; // \ru Ближайшая проекция точки на кривую \en The nearest point projection to the curve + virtual bool NearPointProjection( const MbCartPoint3D &, double & t, bool ext, MbRect1D * tRange = nullptr ) const; // \ru Ближайшая проекция точки на кривую. \en The nearest point projection to the curve. virtual void InsertPoint( ptrdiff_t index, const MbCartPoint3D & ); // \ru Добавить точку \en Add a point virtual void InsertPoint( double t, const MbCartPoint3D &, double ); // \ru Добавить точку \en Add a point - virtual bool CheckParam ( double & t, ptrdiff_t & i0, ptrdiff_t & i1, double & t0, double & t1 ) const; // \ru Установить параметр \en Set parameter - virtual double GetParam( ptrdiff_t i ) const; // \ru Выдать параметр для точки с номером \en Get parameter for a point with index + virtual bool CheckParam ( double & t, ptrdiff_t & i0, ptrdiff_t & i1, double & t0, double & t1 ) const; // \ru Установить параметр. \en Set parameter. + virtual double GetParam( ptrdiff_t i ) const; // \ru Выдать параметр для точки с номером. \en Get parameter for a point with index. void CheckParameter( double & ) const; ///< \ru Проверка параметра. \en Check parameter. - //virtual bool GoThroughPoint( double t, MbCartPoint3D & p ); // \ru Пройти через точку \en Pass through point + //virtual bool GoThroughPoint( double t, MbCartPoint3D & p ); // \ru Пройти через точку. \en Pass through point. - virtual MbCurve * GetMap( const MbMatrix3D &, MbRect1D * pRgn = c3d_null, - VERSION version = Math::DefaultMathVersion(), bool * coincParams = c3d_null ) const; // \ru Дать плоскую проекцию кривой. \en Get a planar projection of a curve. - virtual MbCurve * GetMapPsp( const MbMatrix3D &, double zNear, MbRect1D * pRgn = c3d_null ) const; // \ru Дать перспективную плоскую проекцию кривой. \en Get a planar geometric projection of a curve. + virtual MbCurve * GetMap( const MbMatrix3D &, MbRect1D * pRgn = nullptr, + VERSION version = Math::DefaultMathVersion(), bool * coincParams = nullptr ) const; // \ru Дать плоскую проекцию кривой. \en Get a planar projection of a curve. + virtual MbCurve * GetMapPsp( const MbMatrix3D &, double zNear, MbRect1D * pRgn = nullptr ) const; // \ru Дать перспективную плоскую проекцию кривой. \en Get a planar geometric projection of a curve. virtual size_t GetCount() const; virtual bool IsSmoothConnected( double angleEps ) const; // \ru Являются ли стыки контура\кривой гладкими? \en Whether the joints of a contour\curve are smooth. - virtual bool IsContinuousDerivative( bool & contLength, bool & contDirect, c3d::DoubleVector * params = c3d_null, double epsilon = EPSILON ) const; // \ru Непрерывна ли первая производная? \en Have the first derivative the continuous? + virtual bool IsContinuousDerivative( bool & contLength, bool & contDirect, c3d::DoubleVector * params = nullptr, double epsilon = EPSILON ) const; // \ru Непрерывна ли первая производная? \en Have the first derivative the continuous? // \ru Устранить разрывы первых производных по длине. \en Eliminate the discontinuities of the first derivative at length. virtual bool SetContinuousDerivativeLength( VERSION version, double epsilon = EPSILON ); +public: + ptrdiff_t GetSegmentsCount() const { return segmentsCount; } + + double Step ( double t, double sag, ThreeStates dir ) const; ///< \ru Шаг параметра с учетом радиуса кривизны. \en Step of parameter with consideration of curvature. + double DeviationStep( double t, double angle, ThreeStates dir ) const; ///< \ru Шаг параметра по заданному углу отклонения касательной. \en Step of parameter by a given angle of deviation of tangent. + bool UnClamped( bool ); void DeleteEqPoints( double absEps ); // \ru Удалить одинаковые точки \en Remove equal points void AddAt( const MbCartPoint3D & spsP, ptrdiff_t i ); - ptrdiff_t GetSegmentsCount() const { return segmentsCount; } - private: void operator = ( const MbPolyline3D & ); // \ru Не реализовано. \en Not implemented. - DECLARE_PERSISTENT_CLASS_NEW_DEL( MbPolyline3D ) +DECLARE_PERSISTENT_CLASS_NEW_DEL( MbPolyline3D ) }; IMPL_PERSISTENT_OPS( MbPolyline3D ) diff --git a/C3d/Include/cur_projection_curve.h b/C3d/Include/cur_projection_curve.h index afba50a..2f54303 100644 --- a/C3d/Include/cur_projection_curve.h +++ b/C3d/Include/cur_projection_curve.h @@ -43,9 +43,9 @@ class MbCurveIntoNurbsInfo; // --- class MATH_CLASS MbProjCurve : public MbCurve { private : - MbCurve3D * spaceCurve; ///< \ru Пространственная кривая (всегда не c3d_null). \en Spatial curve (always not c3d_null). - MbSurface * surface; ///< \ru Поверхность (всегда не c3d_null). \en Surface (always not c3d_null). - MbCurve * curve; ///< \ru Проекция пространственной кривой на поверхность (служит начальным приближением), всегда не c3d_null. \en Projection of a spatial curve onto a surface (is used as initial approximation), always not c3d_null. + MbCurve3D * spaceCurve; ///< \ru Пространственная кривая (всегда не nullptr). \en Spatial curve (always not nullptr). + MbSurface * surface; ///< \ru Поверхность (всегда не nullptr). \en Surface (always not nullptr). + MbCurve * curve; ///< \ru Проекция пространственной кривой на поверхность (служит начальным приближением), всегда не nullptr. \en Projection of a spatial curve onto a surface (is used as initial approximation), always not nullptr. MbMatrix3D * into; ///< \ru Матрица пересчета в систему координат плоскости. Для случая плоской поверхности surface. Вычисляется заново при изменении поверхности. \en A matrix of transformation to the plane coordinate system. In case of planar surface 'surface'. Recalculated at surface change. bool belong; ///< \ru Проецируемая кривая лежит на поверхности. \en Projecting curve lies on the surface. @@ -117,7 +117,7 @@ public : MbProjCurve( const MbCurve3D & sCurve, bool sameSpaceCurve, const MbSurface & surface, const MbCurve & pCurve, bool samePlaneCurve, - MbRegDuplicate * iReg = c3d_null ); + MbRegDuplicate * iReg = nullptr ); private: MbProjCurve( const MbProjCurve &, MbRegDuplicate * ireg ); @@ -136,13 +136,13 @@ public : virtual bool IsSimilar ( const MbPlaneItem & ) const; // \ru Являются ли элементы подобными \en Whether the elements are similar virtual bool SetEqual ( const MbPlaneItem & ); // \ru Сделать элементы равными \en Make the elements equal virtual bool IsSame( const MbPlaneItem & other, double accuracy = LENGTH_EPSILON ) const; // \ru Является ли кривая curve копией данной кривой ? \en Whether curve 'curve' is a duplicate of the current curve. - virtual void Transform( const MbMatrix &, MbRegTransform * ireg = c3d_null, const MbSurface * newSurface = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Transform( const MbMatrix3D &, MbRegTransform * ireg = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move ( const MbVector3D & to, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate ( const MbAxis3D & axis, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate about an axis - virtual void Move ( const MbVector &, MbRegTransform * = c3d_null, const MbSurface * newSurface = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate( const MbCartPoint & pnt, const MbDirection & angle, MbRegTransform * = c3d_null, const MbSurface * newSurface = c3d_null ); // \ru Поворот \en Rotation - virtual MbPlaneItem & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента \en Create a copy of the element + virtual void Transform( const MbMatrix &, MbRegTransform * ireg = nullptr, const MbSurface * newSurface = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Transform( const MbMatrix3D &, MbRegTransform * ireg = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move ( const MbVector3D & to, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate ( const MbAxis3D & axis, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate about an axis + virtual void Move ( const MbVector &, MbRegTransform * = nullptr, const MbSurface * newSurface = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate( const MbCartPoint & pnt, const MbDirection & angle, MbRegTransform * = nullptr, const MbSurface * newSurface = nullptr ); // \ru Поворот \en Rotation + virtual MbPlaneItem & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента \en Create a copy of the element virtual void Refresh(); // \ru Сбросить все временные данные \en Reset all temporary data virtual void PrepareIntegralData( const bool forced ) const; // \ru Рассчитать временные (mutable) данные объекта. \en Calculate temporary (mutable) data of an object. @@ -204,7 +204,7 @@ public : \{ */ virtual double PointProjection( const MbCartPoint & pnt ) const; // \ru Проекция точки на кривую. \en Point projection on the curve. virtual bool NearPointProjection( const MbCartPoint & pnt, double xEpsilon, double yEpsilon, - double & t, bool ext, MbRect1D * tRange = c3d_null ) const; // \ru Проекция точки на кривую или её продолжение в области поиска проекции. \en Projection of a point onto the curve or its extension in the projection region. + double & t, bool ext, MbRect1D * tRange = nullptr ) const; // \ru Проекция точки на кривую или её продолжение в области поиска проекции. \en Projection of a point onto the curve or its extension in the projection region. virtual bool HasLength( double & ) const; // \ru Метрическая длина кривой. \en Metric length of a curve. virtual double GetMetricLength() const; // \ru Метрическая длина кривой. \en Metric length of a curve. @@ -216,7 +216,7 @@ public : virtual bool GetMiddlePoint( MbCartPoint & ) const; // \ru Вычислить среднюю точку кривой. \en Calculate mid-point of curve. - virtual void Inverse( MbRegTransform * iReg = c3d_null ); // \ru Изменение направления кривой на противоположное \en Change curve direction to the opposite one + virtual void Inverse( MbRegTransform * iReg = nullptr ); // \ru Изменение направления кривой на противоположное \en Change curve direction to the opposite one virtual MbNurbs * NurbsCurve( const MbCurveIntoNurbsInfo & ) const; @@ -242,12 +242,12 @@ public : bool IsBelong() const { return belong; } ///< \ru Лежит ли проецируемая кривая на поверхности. \en Whether the projecting curve lies on the surface. - bool InvertNormal( MbRegTransform * = c3d_null ); ///< \ru Инвертировать нормаль, если поверхность - плоскость. \en Invert normal if the surface is a plane. + bool InvertNormal( MbRegTransform * = nullptr ); ///< \ru Инвертировать нормаль, если поверхность - плоскость. \en Invert normal if the surface is a plane. bool ChangeCarrierBorne( const MbSurface & item, MbSurface & init, const MbMatrix & matr ); ///< \ru Изменение носителя. \en Change a carrier. /// \ru Получить 2d сплайн с данной относительной точностью аппроксимирующий данную кривую. \en Get 2d spline which approximates given curve with a given relative tolerance. - MbCurve * CreateSpline( double relEps, MbRect1D * pRgn = c3d_null ) const; + MbCurve * CreateSpline( double relEps, MbRect1D * pRgn = nullptr ) const; /// \ru Создать кривую путём сращивания части данной кривой с частью другой кривой. \en Create a curve by joining a part of this curve with a part of other curve. MbProjCurve * AddCurve( const MbProjCurve &, double accuracy, VERSION version = Math::DefaultMathVersion() ) const; diff --git a/C3d/Include/cur_reparam_curve.h b/C3d/Include/cur_reparam_curve.h index eebdb6a..f6f52d4 100644 --- a/C3d/Include/cur_reparam_curve.h +++ b/C3d/Include/cur_reparam_curve.h @@ -45,6 +45,7 @@ class MATH_CLASS MbReparamCurve : public MbCurve { rt_Quadratic, ///< \ru Квадратичная репараметризация. \en Quadratic reparametrization. rt_ScaledEndDers, ///< \ru Репараметризация с заданными масштабами производной на концах. \en Reparametrization with a given scale of the derivative at the ends. rt_Proportional, ///< \ru Пропорциональная длине кривой репараметризация. \en The poportional to the length of the curve parametrization. + rt_User ///< \ru Функция, заданная пользователем. \en User defined function. }; protected : @@ -59,8 +60,6 @@ public : MbReparamCurve( const MbCurve &, const double t1, const double t2, const double begFirstDerValue ); /// \ru Конструктор по кривой и производным параметра на ее концах. \en Constructor for the curve and derivatives of the parameter at its ends MbReparamCurve( double dt1, double dt2, const MbCurve & curve ); - /// \ru Конструктор кривой с пропорциональной параметризацией. \en The constructor with the poportional to the length parametrization. - MbReparamCurve( double t1, double t2, MbCurve & curve, bool proportional ); protected: MbReparamCurve( const MbReparamCurve &, MbRegDuplicate * ); private : @@ -79,6 +78,12 @@ public : void InitScaledEnds( double scaleDer1, double scaleDer2 ); /// \ru Установить параметрическую область кривой пропорциональную метрической длине кривой. \en Set the parametric area of the curve proportional to the metric length of the curve. bool InitProportional( double t1, double t2 ); + /// \ru Установить пользовательскую функцию репараметризации. \en Set users reparameterization function. + bool InitByUsersFunction( MbFunction & repFunc ); + /// \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 ); /** \ru \name Общие функции геометрического объекта. \en \name Common functions of a geometric object. @@ -87,18 +92,19 @@ public : virtual MbePlaneType IsA() const; // \ru Тип элемента \en Type of element virtual bool IsSimilar( const MbPlaneItem & ) const; // \ru Являются ли элементы подобными \en Whether the elements are similar virtual bool SetEqual ( const MbPlaneItem & ); // \ru Сделать элементы равными \en Make the elements equal - virtual void Transform( const MbMatrix &, MbRegTransform * = c3d_null, const MbSurface * newSurface = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move( const MbVector &, MbRegTransform * = c3d_null, const MbSurface * newSurface = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate( const MbCartPoint &, const MbDirection & angle, MbRegTransform * = c3d_null, const MbSurface * newSurface = c3d_null ); // \ru Поворот \en Rotation + virtual void Transform( const MbMatrix &, MbRegTransform * = nullptr, const MbSurface * newSurface = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move( const MbVector &, MbRegTransform * = nullptr, const MbSurface * newSurface = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate( const MbCartPoint &, const MbDirection & angle, MbRegTransform * = nullptr, const MbSurface * newSurface = nullptr ); // \ru Поворот \en Rotation virtual bool IsSame( const MbPlaneItem &, double accuracy = LENGTH_EPSILON ) const; virtual MbCurve * Offset( double rad ) const; // \ru Смещение усеченной кривой \en Shift of a trimmed curve - virtual MbPlaneItem & Duplicate( MbRegDuplicate * = c3d_null ) const; + virtual MbPlaneItem & Duplicate( MbRegDuplicate * = nullptr ) const; virtual MbCurve * Trimmed( double t1, double t2, int sense ) const; virtual MbContour * NurbsContour() const; // \ru Построить контур \en Create a contour virtual void AddYourGabaritTo( MbRect & ) const; // \ru Добавь свой габарит в прямой прям-к \en Add your own gabarit into the given bounding rectangle virtual void CalculateGabarit( MbRect & ) const; // \ru Определить габариты кривой \en Determine the bounding box of a curve virtual bool IsVisibleInRect( const MbRect &, bool exact = false ) const; // \ru Виден ли объект в заданном прямоугольнике \en Whether the object is visible in the given rectangle using MbCurve::IsVisibleInRect; + const MbFunction * GetFunction() const { return repFunction; } // \ru Получить функцию. \en Get function /** \} */ /** \ru \name Функции описания области определения кривой. @@ -160,7 +166,7 @@ public : /** \ru \name Общие функции кривой \en \name Common functions of curve \{ */ - virtual void Inverse( MbRegTransform * iReg = c3d_null ); // \ru Изменение направления кривой на противоположное \en Change curve direction to the opposite one + virtual void Inverse( MbRegTransform * iReg = nullptr ); // \ru Изменение направления кривой на противоположное \en Change curve direction to the opposite one virtual double DistanceToPoint( const MbCartPoint & toP ) const; // \ru Расстояние до точки \en Distance to a point virtual bool DistanceToPointIfLess( const MbCartPoint & toP, double & d ) const; // \ru Расстояние до точки, если оно меньше d \en Distance to a point if it is less than 'd' virtual MbeState Deformation( const MbRect &, const MbMatrix & ); // \ru Деформация \en Deformation @@ -195,7 +201,7 @@ public : virtual double PointProjection( const MbCartPoint & ) const; // \ru Проекция точки на кривую \en Point projection on the curve virtual bool NearPointProjection( const MbCartPoint & pnt, double xEpsilon, double yEpsilon, - double & t, bool ext, MbRect1D * tRange = c3d_null ) const; // \ru Проекция точки на кривую или её продолжение в области поиска проекции \en Projection of a point onto the curve or its extension in the projection region + double & t, bool ext, MbRect1D * tRange = nullptr ) const; // \ru Проекция точки на кривую или её продолжение в области поиска проекции \en Projection of a point onto the curve or its extension in the projection region // \ru Вычисление всех перпендикуляров к кривой из данной точки \en Calculation of all the perpendiculars to the curve from a given point virtual void PerpendicularPoint( const MbCartPoint & pnt, SArray & tFind ) const; virtual bool SmallestPerpendicular( const MbCartPoint & pnt, double & tProj ) const; // \ru Нахождение ближайшего перпендикуляра к кривой из данной точки \en Calculation of the closest perpendicular to the curve from the given point @@ -209,7 +215,7 @@ public : virtual bool GetMiddlePoint( MbCartPoint & ) const; // \ru Выдать среднюю точку кривой \en Get mid-point of a curve virtual bool GoThroughPoint( MbCartPoint & p0 ); // \ru Вычисление минимальной длины кривой между двумя точками на ней \en Calculate the minimal curve length between two points on it - virtual double LengthBetween2Points( MbCartPoint & p1, MbCartPoint & p2, MbCartPoint * pc = c3d_null ) const; + virtual double LengthBetween2Points( MbCartPoint & p1, MbCartPoint & p2, MbCartPoint * pc = nullptr ) const; virtual bool GetSpecificPoint( const MbCartPoint & from, double & dmax, MbCartPoint & pnt ) const; // \ru Выдать характерную точку кривой если она ближе чем dmax \en Get control point of curve if it is closer than 'dmax' virtual bool GetWeightCentre( MbCartPoint & c ) const; // \ru Выдать центр тяжести кривой \en Get the center of gravity of the curve virtual bool GetCentre( MbCartPoint & c ) const; // \ru Выдать центр кривой \en Get center of curve @@ -234,7 +240,7 @@ public : virtual const MbCurve & GetBasisCurve() const; virtual MbCurve & SetBasisCurve(); - bool SetBasisCurve( const MbCurve &, const MbRect1D * tRange = c3d_null ); ///< \ru Заменить плоскую кривую \en Replace the planar curve + bool SetBasisCurve( const MbCurve &, const MbRect1D * tRange = nullptr ); ///< \ru Заменить плоскую кривую \en Replace the planar curve double Tmin() const; ///< \ru Начальный параметр. \en Start parameter. double Tmax() const; ///< \ru Конечный параметр. \en End parameter. double Dt() const; ///< \ru Производная параметра кривой basisCurve по параметру. \en Derivative of parameter of 'basisCurve' curve by parameter. @@ -256,12 +262,13 @@ public : virtual void GetBasisPoints( MbControlData & ) const; // \ru Выдать контрольные точки объекта. \en Get control points of object. virtual void SetBasisPoints( const MbControlData & ); // \ru Изменить объект по контрольным точкам. \en Change the object by control points. - virtual bool IsContinuousDerivative( bool & contLength, bool & contDirect, c3d::DoubleVector * params = c3d_null, double epsilon = EPSILON ) const; // \ru Непрерывна ли первая производная? \en Have the first derivative the continuous? + virtual bool IsContinuousDerivative( bool & contLength, bool & contDirect, c3d::DoubleVector * params = nullptr, double epsilon = EPSILON ) const; // \ru Непрерывна ли первая производная? \en Have the first derivative the continuous? // \ru Устранить разрывы первых производных по длине. \en Eliminate the discontinuities of the first derivative at length. virtual bool SetContinuousDerivativeLength( VERSION version, double epsilon = EPSILON ); bool IsProportional() const { return (reparamType == rt_Proportional); } ///< \ru Является ли репараметризация пропорциональной? \en Is the re-parametrization proportional? bool IsLinear() const { return (reparamType == rt_Linear); } // \ru Является ли репараметризация линейной? \en Is the re-parametrization linear? + bool SetLimitParam( double newTMin, double newTMax ); // \ru Установить область изменения параметра \en Set range of parameter /** \} */ diff --git a/C3d/Include/cur_reparam_curve3d.h b/C3d/Include/cur_reparam_curve3d.h index e4f02d9..5e35ab4 100644 --- a/C3d/Include/cur_reparam_curve3d.h +++ b/C3d/Include/cur_reparam_curve3d.h @@ -45,6 +45,7 @@ class MATH_CLASS MbReparamCurve3D : public MbCurve3D { rt_Quadratic, ///< \ru Квадратичная репараметризация. \en Quadratic reparametrization. rt_ScaledEndDers, ///< \ru Репараметризация с заданными масштабами производной на концах. \en Reparametrization with a given scale of the derivative at the ends. rt_Proportional, ///< \ru Пропорциональная длине кривой репараметризация. \en The poportional to the length of the curve parametrization. + rt_User ///< \ru Функция, заданная пользователем. \en User defined function. }; protected: @@ -58,8 +59,6 @@ public : MbReparamCurve3D( const MbCurve3D &, double t1, double t2, double begFirstDerValue ); /// \ru Конструктор по кривой и производным параметра на ее концах. \en Constructor for the curve and derivatives of the parameter at its ends MbReparamCurve3D( double dt1, double dt2, const MbCurve3D & curve ); - /// \ru Конструктор кривой с пропорциональной параметризацией. \en The constructor with the poportional to the length parametrization. - MbReparamCurve3D( double t1, double t2, MbCurve3D & curve, bool proportional ); protected: MbReparamCurve3D( const MbReparamCurve3D &, MbRegDuplicate * ); private : @@ -78,17 +77,23 @@ public : void InitScaledEnds( double scaleDer1, double scaleDer2 ); /// \ru Установить параметрическую область кривой пропорциональную метрической длине кривой. \en Set the parametric area of the curve proportional to the metric length of the curve. bool InitProportional( double t1, double t2 ); + /// \ru Установить пользовательскую функцию репараметризации. \en Set users reparameterization function. + bool InitByUsersFunction( MbFunction & repFunc ); + /// \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 ); // \ru Общие функции математического объекта \en Common functions of the mathematical object virtual MbeSpaceType IsA() const; // \ru Тип элемента \en Type of element - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента \en Create a copy of the element + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента \en Create a copy of the element virtual bool IsSame ( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const; // \ru Является ли объект копией \en Whether the object is a copy virtual bool SetEqual ( const MbSpaceItem & ); // \ru Сделать равным \en Make equal virtual bool IsSimilar( const MbSpaceItem & ) const; // \ru Являются ли объекты подобными \en Whether the objects are similar - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate about an axis + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate about an axis virtual double DistanceToPoint( const MbCartPoint3D & ) const; // \ru Расстояние до точки \en Distance to a point virtual void PrepareIntegralData( const bool forced ) const; // \ru Рассчитать временные (mutable) данные объекта. \en Calculate temporary (mutable) data of an object. @@ -129,7 +134,7 @@ public : virtual MbCurve3D & SetBasisCurve(); virtual MbCurve3D * Trimmed( double t1, double t2, int sense ) const; // \ru Создание усеченной кривой \en Create a trimmed curve - virtual void Inverse( MbRegTransform * iReg = c3d_null ); // \ru Изменить направление \en Change direction + virtual void Inverse( MbRegTransform * iReg = nullptr ); // \ru Изменить направление \en Change direction virtual double GetMetricLength() const; // \ru Метрическая длина кривой \en Metric length of a curve virtual double CalculateMetricLength() const; // \ru Метрическая длина кривой \en Metric length of a curve @@ -155,7 +160,7 @@ public : virtual void GetPointsByEvenLengthDelta( size_t n, std::vector & pnts ) const; // \ru Выдать n точек кривой с равными интервалами по длине дуги \en Get n points of curve equally spaced by the arc length // \ru Ближайшая проекция точки на кривую \en The nearest projection of a point onto the curve - virtual bool NearPointProjection( const MbCartPoint3D &, double & t, bool ext, MbRect1D * tRange = c3d_null ) const; + virtual bool NearPointProjection( const MbCartPoint3D &, double & t, bool ext, MbRect1D * tRange = nullptr ) const; // \ru Определение точек касания изоклины \en Determination of tangent points of isocline virtual void GetIsoclinal( const MbVector3D & nor, SArray & tIso ) const; /// \ru Найти все особые точки функции кривизны кривой. @@ -167,8 +172,8 @@ public : // \ru Касание кривой через точку с заданной производной \en Tangent of curve through point with the given derivative //virtual bool GoThroughPointWithDerive( double t, MbCartPoint3D & p0, MbVector3D & v0 ); - virtual MbCurve * GetMap( const MbMatrix3D &, MbRect1D * pRgn = c3d_null, - VERSION version = Math::DefaultMathVersion(), bool * coincParams = c3d_null ) const; // \ru Дать плоскую проекцию кривой \en Get a planar projection of a curve + virtual MbCurve * GetMap( const MbMatrix3D &, MbRect1D * pRgn = nullptr, + VERSION version = Math::DefaultMathVersion(), bool * coincParams = nullptr ) const; // \ru Дать плоскую проекцию кривой \en Get a planar projection of a curve virtual size_t GetCount() const; virtual void ChangeCarrier( const MbSpaceItem & item, MbSpaceItem & init ); // \ru Изменение носителя \en Change a carrier @@ -205,12 +210,13 @@ public : virtual bool IsShift( const MbSpaceItem &, MbVector3D &, bool & isSame, double accuracy = LENGTH_EPSILON ) const; virtual bool IsSimilarToCurve( const MbCurve3D & curve, double precision = METRIC_PRECISION ) const; // \ru Подобные ли кривые для объединения (слива) \en Whether the curves for union (joining) are similar - virtual bool IsContinuousDerivative( bool & contLength, bool & contDirect, c3d::DoubleVector * params = c3d_null, double epsilon = EPSILON ) const; // \ru Непрерывна ли первая производная? \en Have the first derivative the continuous? + virtual bool IsContinuousDerivative( bool & contLength, bool & contDirect, c3d::DoubleVector * params = nullptr, double epsilon = EPSILON ) const; // \ru Непрерывна ли первая производная? \en Have the first derivative the continuous? // \ru Устранить разрывы первых производных по длине. \en Eliminate the discontinuities of the first derivative at length. virtual bool SetContinuousDerivativeLength( VERSION version, double epsilon = EPSILON ); bool IsProportional() const { return (reparamType == rt_Proportional); } ///< \ru Является ли репараметризация пропорциональной? \en Is the re-parametrization proportional? bool IsLinear() const { return (reparamType == rt_Linear); } // \ru Является ли репараметризация линейной? \en Is the re-parametrization linear? + bool SetLimitParam( double newTMin, double newTMax ); // \ru Установить область изменения параметра \en Set range of parameter private: void operator = ( const MbReparamCurve3D & ); // \ru Не реализовано. \en Not implemented. diff --git a/C3d/Include/cur_silhouette_curve.h b/C3d/Include/cur_silhouette_curve.h index ee87c17..bc93e28 100644 --- a/C3d/Include/cur_silhouette_curve.h +++ b/C3d/Include/cur_silhouette_curve.h @@ -77,7 +77,7 @@ public : const MbMatrix3D & m, bool p ); /// \ru Конструктор по поверхности, двумерной кривой, типу кривой, вектору взгляда и флагу перспективы. \en Constructor by surface, two-dimensional curve, type of curve, vector of view and flag of perspective. MbSilhouetteCurve( const MbSurface & surf, const MbCurve & crv, MbeCurveBuildType _species, - const MbVector3D & e, bool p, const MbAxis3D * axis = c3d_null ); + const MbVector3D & e, bool p, const MbAxis3D * axis = nullptr ); protected: /// \ru Конструктор копирования. \en Copy-constructor. MbSilhouetteCurve( const MbSilhouetteCurve &, MbRegDuplicate * ); @@ -92,13 +92,13 @@ public: // \ru Общие функции геометрического объекта. \en Common functions of a geometric object. virtual MbeSpaceType IsA() const; // \ru Дать тип элемента. \en Get element type. - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента. \en Create a copy of the element. + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента. \en Create a copy of the element. virtual bool IsSame ( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const; // \ru Определить, являются ли объекты одинаковыми. \en Determine whether objects are equal. virtual bool SetEqual ( const MbSpaceItem & ); // \ru Сделать равным. \en Make equal. virtual bool IsSimilar( const MbSpaceItem & ) const; // \ru Определить, являются ли объекты подобными. \en Determine whether the objects are similar. - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвинуть вдоль вектора. \en Move along a vector. - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси. \en Rotate about an axis. + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвинуть вдоль вектора. \en Move along a vector. + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси. \en Rotate about an axis. virtual void Refresh(); // \ru Сбросить все временные данные. \en Reset all temporary data. virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта. \en Get properties of the object. virtual void SetProperties( const MbProperties & ); // \ru Записать свойства объекта. \en Set properties of the object. @@ -136,8 +136,8 @@ public: // \ru Создать усеченную кривую. \en Create a trimmed curve virtual MbCurve3D * Trimmed( double t1, double t2, int sense ) const; // \ru Дать плоскую проекцию кривой(локальная система координат, шаг, параметрическая область). \en Get the planar projection of a curve (local coordinate system, step, parametric region). - virtual MbCurve * GetMap( const MbMatrix3D &, MbRect1D * pRgn = c3d_null, - VERSION version = Math::DefaultMathVersion(), bool * coincParams = c3d_null ) const; + virtual MbCurve * GetMap( const MbMatrix3D &, MbRect1D * pRgn = nullptr, + VERSION version = Math::DefaultMathVersion(), bool * coincParams = nullptr ) const; virtual double GetMetricLength() const; // \ru Метрическая длина кривой \en Metric length of a curve virtual double GetLengthEvaluation() const; // \ru Оценить метрическую длину кривой. \en Estimate the metric length of a curve. @@ -145,16 +145,16 @@ public: virtual double GetParamToUnit() const; // \ru Дать приращение параметра, осреднённо соответствующее единичной длине в пространстве. \en Get parameter increment which averagingly corresponds to the unit length in space. virtual double GetParamToUnit( double t ) const; // \ru Дать приращение параметра, соответствующее единичной длине в пространстве. \en Get parameter increment which corresponds to the unit length in space. - virtual void Inverse( MbRegTransform * iReg = c3d_null ); // \ru Изменить направление. \en Change the direction. + virtual void Inverse( MbRegTransform * iReg = nullptr ); // \ru Изменить направление. \en Change the direction. virtual MbeCurveBuildType GetBuildType() const; // \ru Дать тип кривой. \en Get type of curve. virtual bool InsertPoint( double & t ); // \ru Вставить точку и выдать её параметр. \en Insert point and get its parameter. virtual bool IsSimilarToCurve( const MbCurve3D & curve, double precision = METRIC_PRECISION ) const; // \ru Определить, подобные ли кривые для объединения (слива). \en Determine whether the curves for union (joining) are similar. /// \ru Определить, существует ли точное пространственное представление линии очерка. \en Determine whether the exact spatial representation of isocline curve exists. - bool IsExactSpaceCurve() const { return (approxExact && approxCurve != c3d_null); } + bool IsExactSpaceCurve() const { return (approxExact && approxCurve != nullptr); } /// \ru Получить указатель на кривую точного пространственное представление линии очерка. (Может и не быть). \en Get a pointer to the curve of exact spatial representation of isocline curve. (Can be absent). - const MbCurve3D * GetExactSpaceCurve() const { return approxExact ? approxCurve : c3d_null; } + const MbCurve3D * GetExactSpaceCurve() const { return approxExact ? approxCurve : nullptr; } /// \ru Дать пространственную копию линии очерка. \en Construct a new spatial copy of isocline curve. const MbCurve3D * GetApproxCurve() const { return approxCurve; } diff --git a/C3d/Include/cur_spiral.h b/C3d/Include/cur_spiral.h index e605fa4..b51de19 100644 --- a/C3d/Include/cur_spiral.h +++ b/C3d/Include/cur_spiral.h @@ -95,12 +95,12 @@ public : virtual MbeSpaceType IsA() const = 0; // \ru Тип элемента \en Type of element virtual MbeSpaceType Type() const; // \ru Тип элемента \en Type of element - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const = 0; // \ru Сделать копию элемента \en Create a copy of the element + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const = 0; // \ru Сделать копию элемента \en Create a copy of the element virtual bool IsSame( const MbSpaceItem &, double accuracy = LENGTH_EPSILON ) const; virtual bool SetEqual( const MbSpaceItem & ); // \ru Сделать равным \en Make equal - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate about an axis + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate about an axis virtual void AddYourGabaritTo( MbCube & ) const; // \ru Добавь свой габарит в куб \en Add your own bounding box into the cube virtual void PrepareIntegralData( const bool forced ) const; // \ru Рассчитать временные (mutable) данные объекта. \en Calculate temporary (mutable) data of an object. @@ -125,7 +125,7 @@ public : virtual void Explore( double & t, bool ext, MbCartPoint3D & pnt, MbVector3D & fir, MbVector3D * sec, MbVector3D * thir ) const = 0; - virtual void Inverse( MbRegTransform * iReg = c3d_null ) = 0; // \ru Изменить направление \en Change direction + virtual void Inverse( MbRegTransform * iReg = nullptr ) = 0; // \ru Изменить направление \en Change direction virtual double GetMetricLength() const; // \ru Выдать метрическую длину ограниченной кривой \en Get metric length of bounded curve virtual double GetLengthEvaluation() const; // \ru Оценка метрической длины кривой \en Estimation of metric length of the curve diff --git a/C3d/Include/cur_surface_curve.h b/C3d/Include/cur_surface_curve.h index 20df725..e56007b 100644 --- a/C3d/Include/cur_surface_curve.h +++ b/C3d/Include/cur_surface_curve.h @@ -61,12 +61,12 @@ class MbCurveIntoNurbsInfo; // --- class MATH_CLASS MbSurfaceCurve : public MbCurve3D { protected : - MbCurve * curve; ///< \ru Плоская кривая в uv-пространстве (всегда не c3d_null). \en Planar curve in uv-space (always not c3d_null). - MbSurface * surface; ///< \ru Указатель на поверхность (всегда не c3d_null). \en Pointer to the surface (always not c3d_null). + MbCurve * curve; ///< \ru Плоская кривая в uv-пространстве (всегда не nullptr). \en Planar curve in uv-space (always not nullptr). + MbSurface * surface; ///< \ru Указатель на поверхность (всегда не nullptr). \en Pointer to the surface (always not nullptr). bool closed; ///< \ru Флаг замкнутости поверхностной кривой. \en An attribute of closedness of surface of curve. #ifdef C3D_SIGNAL_ENABLED - MbObjectChangeSignal _signal; ///< \ru Сигнал об изменениях в кривой. \en Signal about the curve changes. + MbObjectChangeSignalOne _signal; ///< \ru Сигнал об изменениях в кривой. \en Signal about the curve changes. #endif /** \brief \ru Вспомогательные данные. @@ -109,7 +109,7 @@ protected : public : /// \ru Конструктор кривой на поверхности. \en Constructor of curve on surface. - MbSurfaceCurve( const MbSurface &, const MbCurve &, bool sameCurve, MbRegDuplicate * iReg = c3d_null ); + MbSurfaceCurve( const MbSurface &, const MbCurve &, bool sameCurve, MbRegDuplicate * iReg = nullptr ); /// \ru Конструктор отрезка прямой на поверхности. \en Constructor of a line segment on surface. MbSurfaceCurve( const MbSurface &, const MbCartPoint & p0, const MbCartPoint & p1, MbePlaneType type = pt_Curve ); /// \ru Конструктор граничной кривой поверхности. \en Constructor of boundary curve of surface. @@ -135,15 +135,15 @@ public: virtual MbeSpaceType IsA() const; // \ru Дать тип элемента. \en Get element type. virtual MbeSpaceType Type() const; // \ru Дать тип элемента. \en Get element type. - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента. \en Create a copy of the element. + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента. \en Create a copy of the element. /// \ru Копия кривой с той же поверхностью. \en Copy of curve with the same surface. MbSurfaceCurve & CurvesDuplicate() const; virtual bool IsSame ( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const; // \ru Определить, являются ли объекты одинаковыми. \en Determine whether objects are equal. virtual bool SetEqual ( const MbSpaceItem & ); // \ru Сделать равным. \en Make equal. virtual bool IsSimilar( const MbSpaceItem & ) const; // \ru Определить, являются ли объекты подобными. \en Determine whether the objects are similar. - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвинуть вдоль вектора. \en Move along a vector. - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси. \en Rotate about an axis. + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвинуть вдоль вектора. \en Move along a vector. + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси. \en Rotate about an axis. virtual void AddYourGabaritTo( MbCube & ) const; // \ru Добавить свой габарит в куб. \en Add your own bounding box into a cube. virtual void Refresh(); // \ru Сбросить все временные данные. \en Reset all temporary data. virtual void PrepareIntegralData( const bool forced ) const; // \ru Рассчитать временные (mutable) данные объекта. \en Calculate temporary (mutable) data of an object. @@ -184,16 +184,16 @@ public: virtual MbCurve3D * Trimmed( double t1, double t2, int sense ) const; // \ru Создать усеченную кривую. \en Create a trimmed curve // \ru Вычислить ближайшую проекцию точки на кривую. \en Calculate the nearest projection of a point onto the curve. - virtual bool NearPointProjection( const MbCartPoint3D &, double & t, bool ext, MbRect1D * tRange = c3d_null ) const; - virtual void Inverse( MbRegTransform * iReg = c3d_null ); // \ru Изменить направление. \en Change the direction. + virtual bool NearPointProjection( const MbCartPoint3D &, double & t, bool ext, MbRect1D * tRange = nullptr ) const; + virtual void Inverse( MbRegTransform * iReg = nullptr ); // \ru Изменить направление. \en Change the direction. virtual double Step ( double t, double sag ) const; // \ru Вычисление шага по стрелке прогиба. \en Calculation of parameter step by the sag. virtual double DeviationStep( double t, double angle ) const; // \ru Вычисление шага по углу отклонения нормали. \en Calculation of parameter step by the deviation angle. void SetTesselation( const MbContourOnSurface & contour, size_t indSegment ); // \ru Установить разбиение из контура. \en Set tessellation from contour. virtual double MetricStep ( double t, double length ) const; // \ru Вычисление шага параметра по длине. \en Calculation of parameter step by the given length. - virtual MbCurve * GetMap( const MbMatrix3D &, MbRect1D * pRgn = c3d_null, - VERSION version = Math::DefaultMathVersion(), bool * coincParams = c3d_null ) const; // \ru Дать плоскую проекцию кривой. \en Get a planar projection of a curve. + virtual MbCurve * GetMap( const MbMatrix3D &, MbRect1D * pRgn = nullptr, + VERSION version = Math::DefaultMathVersion(), bool * coincParams = nullptr ) const; // \ru Дать плоскую проекцию кривой. \en Get a planar projection of a curve. /// \ru Вычислить плоскую проекцию кривой в частных случаях. \en Calculate planar projection of a curve in special cases. MbCurve * GetParticularMap( const MbMatrix3D & into, MbRect1D * pRgn, VERSION version ) const; @@ -246,9 +246,11 @@ public: /// \en Get the boundaries of the curve sections that are described by one analytical function. \~ virtual void GetAnalyticalFunctionsBounds( std::vector & params ) const; - virtual bool IsContinuousDerivative( bool & contLength, bool & contDirect, c3d::DoubleVector * params = c3d_null, double epsilon = EPSILON ) const; // \ru Непрерывна ли первая производная? \en Have the first derivative the continuous? + virtual bool IsContinuousDerivative( bool & contLength, bool & contDirect, c3d::DoubleVector * params = nullptr, double epsilon = EPSILON ) const; // \ru Непрерывна ли первая производная? \en Have the first derivative the continuous? // \ru Устранить разрывы первых производных по длине. \en Eliminate the discontinuities of the first derivative at length. virtual bool SetContinuousDerivativeLength( VERSION version, double epsilon = EPSILON ); + /// \ ru Определение точек излома кривой. \en The determination of curve smoothness break points. + virtual void BreakPoints( std::vector & vBreaks, double precision = ANGLE_REGION ) const; /** \} */ diff --git a/C3d/Include/cur_surface_intersection.h b/C3d/Include/cur_surface_intersection.h index 3804dc0..b39b312 100644 --- a/C3d/Include/cur_surface_intersection.h +++ b/C3d/Include/cur_surface_intersection.h @@ -16,6 +16,7 @@ #include #include #include +#include class MATH_CLASS MbMatrix; @@ -124,15 +125,14 @@ private : // --- struct SpaceCurveAuxiliaryData : public AuxiliaryData { - MbCurve3D * spaceCurve; ///< \ru Пространственная аппроксимационная кривая. \en The spatial approximating curve. \~ - SpaceCurveAuxiliaryData() : spaceCurve( c3d_null ) {} - SpaceCurveAuxiliaryData( const SpaceCurveAuxiliaryData & c ) : spaceCurve( c3d_null ) { - if ( c.spaceCurve != c3d_null ) { + SPtr spaceCurve; ///< \ru Пространственная аппроксимационная кривая. \en The spatial approximating curve. \~ + SpaceCurveAuxiliaryData() : spaceCurve( nullptr ) {} + SpaceCurveAuxiliaryData( const SpaceCurveAuxiliaryData & c ) : spaceCurve( nullptr ) { + if ( c.spaceCurve != nullptr ) { spaceCurve = static_cast( &c.spaceCurve->Duplicate() ); - spaceCurve->AddRef(); } } - ~SpaceCurveAuxiliaryData() { ::ReleaseItem( spaceCurve ); } + ~SpaceCurveAuxiliaryData() {} }; mutable CacheManager spaceCurveCache; ///< \ru Кэш пространственной аппроксимационной кривой. \en Cache of a spatial approximating curve. \~ @@ -205,7 +205,7 @@ public : MbSurfaceIntersectionCurve( const MbSurface & surf1, const MbCurve & curve1, const MbSurface & surf2, const MbCurve & curve2, MbeCurveBuildType buildType, bool sameOne, bool sameTwo, - MbRegDuplicate * iReg = c3d_null ); + MbRegDuplicate * iReg = nullptr ); /** \brief \ru Конструктор по поверхностям и двумерным точкам. \en Constructor by surfaces and two-dimensional points. \~ \details \ru Конструктор кривой пересечения по поверхностям и двумерным точкам. \n @@ -309,15 +309,15 @@ public: \{ */ virtual MbeSpaceType IsA() const; // \ru Дать тип элемента. \en Get element type. - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента. \en Create a copy of the element. + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента. \en Create a copy of the element. /// \ru Сделать копию кривой на тех же поверхностях. \en Create a copy of a curve on the same surfaces. MbSurfaceIntersectionCurve & CurvesDuplicate() const { return *new MbSurfaceIntersectionCurve( this ); } virtual bool IsSame ( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const; // \ru Определить, равны ли объекты. \en Determine whether the objects are equal. virtual bool SetEqual ( const MbSpaceItem & ); // \ru Сделать равным. \en Make equal. virtual bool IsSimilar( const MbSpaceItem & ) const; // \ru Определить, являются ли объекты подобными. \en Determine whether the objects are similar. - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвинуть вдоль вектора. \en Move along a vector. - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси. \en Rotate about an axis. + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвинуть вдоль вектора. \en Move along a vector. + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси. \en Rotate about an axis. virtual void AddYourGabaritTo( MbCube & r ) const; // \ru Добавить свой габарит в куб. \en Add your own bounding box into a cube. virtual void CalculateMesh( const MbStepData & stepData, const MbFormNote & note, MbMesh & mesh ) const; // \ru Построить полигональную копию mesh. \en Build polygonal copy mesh. virtual void Refresh(); // \ru Сбросить все временные данные. \en Reset all temporary data. @@ -358,7 +358,7 @@ public: // \ru Функции приближённого быстрого вычисления точки и производных на кривой. \en Functions of approximate fast calculation of point and derivatives on the curve. virtual void FastApproxExplore( double & t, MbCartPoint3D & pnt, MbVector3D & fir, MbVector3D * sec ) const; - virtual void Inverse( MbRegTransform * iReg = c3d_null ); // \ru Изменить направление. \en Change the direction. + virtual void Inverse( MbRegTransform * iReg = nullptr ); // \ru Изменить направление. \en Change the direction. // \ru Функции движения по кривой. \en Functions of moving along the curve. // \ru Вычислить шаг параметра по величине прогиба кривой. \en Calculate step of parameter by value of sag of curve. @@ -405,8 +405,8 @@ public: virtual void CalculatePolygon( const MbStepData & stepData, MbPolygon3D &polygon ) const; // \ru Рассчитать полигон. \en Calculate a polygon. // \ru Построить плоскую проекцию некоторой части пространственной кривой. \en Construct a planar projection of a piece of a space curve. - virtual MbCurve * GetMap( const MbMatrix3D & into, MbRect1D * pRegion = c3d_null, - VERSION version = Math::DefaultMathVersion(), bool * coincParams = c3d_null ) const; + virtual MbCurve * GetMap( const MbMatrix3D & into, MbRect1D * pRegion = nullptr, + VERSION version = Math::DefaultMathVersion(), bool * coincParams = nullptr ) const; // \ru Дать проекцию ребра на плоскость. \en Get the edge projection onto plane. virtual MbCurve * GetProjection( const MbPlacement3D & place, VERSION version ) const; @@ -769,12 +769,11 @@ inline bool MbSurfaceIntersectionCurve::CopyReadyMutable( const MbSurfaceInterse changed = true; } MbCurve3D * sspaceCurve = s.spaceCurveCache()->spaceCurve; - if ( sspaceCurve != c3d_null && spaceCurveCache.LongTerm()->spaceCurve == c3d_null ) { + if ( sspaceCurve != nullptr && spaceCurveCache.LongTerm()->spaceCurve == nullptr ) { { ScopedLock cacheLock( spaceCurveCache.GetLock() ); spaceCurveCache.LongTerm()->spaceCurve = (MbCurve3D *)&sspaceCurve->Duplicate(); } - spaceCurveCache.LongTerm()->spaceCurve->AddRef(); spaceCurveCache.Reset(); changed = true; } diff --git a/C3d/Include/cur_trimmed_curve.h b/C3d/Include/cur_trimmed_curve.h index c9921b2..73be073 100644 --- a/C3d/Include/cur_trimmed_curve.h +++ b/C3d/Include/cur_trimmed_curve.h @@ -42,7 +42,7 @@ class MbRegTransform; class MATH_CLASS MbTrimmedCurve : public MbCurve { // \ru Усечение может быть на продолжении кривой (внесенные изменения помечены как E13865) \en Trimming can be on curve extension (made changes are marked as E13865) protected : - MbCurve * basisCurve; ///< \ru Базовая кривая (не может быть c3d_null). \en Base curve (can't be c3d_null). + MbCurve * basisCurve; ///< \ru Базовая кривая (не может быть nullptr). \en Base curve (can't be nullptr). double trim1; ///< \ru Параметры начальной точки \en Parameters of start point double trim2; ///< \ru Параметры конечной точки \en Parameters of end point int sense; ///< \ru Флаг совпадения направления с направлением базовой кривой (sense==0 не допускается) \en Flag of coincidence of the direction with the direction of the base curve (sense==0 isn't allowed) @@ -75,10 +75,10 @@ public : virtual bool IsSimilar( const MbPlaneItem & ) const; // \ru Являются ли элементы подобными \en Whether the elements are similar virtual bool SetEqual ( const MbPlaneItem & ); // \ru Сделать элементы равными \en Make the elements equal virtual bool IsSame ( const MbPlaneItem & other, double accuracy = LENGTH_EPSILON ) const; // \ru Является ли кривая curve копией данной кривой ? \en Whether curve 'curve' is a duplicate of the current curve. - virtual void Transform( const MbMatrix &, MbRegTransform * ireg = c3d_null, const MbSurface * newSurface = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move ( const MbVector &, MbRegTransform * = c3d_null, const MbSurface * newSurface = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate ( const MbCartPoint & pnt, const MbDirection & angle, MbRegTransform * = c3d_null, const MbSurface * newSurface = c3d_null ); // \ru Поворот \en Rotation - virtual MbPlaneItem & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента \en Create a copy of the element + virtual void Transform( const MbMatrix &, MbRegTransform * ireg = nullptr, const MbSurface * newSurface = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move ( const MbVector &, MbRegTransform * = nullptr, const MbSurface * newSurface = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate ( const MbCartPoint & pnt, const MbDirection & angle, MbRegTransform * = nullptr, const MbSurface * newSurface = nullptr ); // \ru Поворот \en Rotation + virtual MbPlaneItem & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента \en Create a copy of the element virtual void AddYourGabaritTo( MbRect & ) const; // \ru Добавь свой габарит в прямой прям-к \en Add your own gabarit into the given bounding rectangle virtual void CalculateGabarit( MbRect & ) const; // \ru Определить габаритный прямоугольник кривой. \en Detect the bounding box of a curve. virtual bool IsInRectForDeform( const MbRect & r ) const; // \ru Виден ли объект в заданном прямоугольнике для деформации \en Whether the object is visible in the given rectangle for deformation @@ -189,7 +189,7 @@ public : void SetTrim1( double t ) { trim1 = t; InitParam( trim1, trim2, sense ); } void SetTrim2( double t ) { trim2 = t; InitParam( trim1, trim2, sense ); } - virtual void Inverse( MbRegTransform * iReg = c3d_null ); // \ru Изменить направление кривой \en Change direction of a curve + virtual void Inverse( MbRegTransform * iReg = nullptr ); // \ru Изменить направление кривой \en Change direction of a curve virtual bool GetAxisPoint( MbCartPoint & p ) const; // \ru Точка для построения оси \en Point for the axis construction virtual bool IsSimilarToCurve( const MbCurve & curve, double precision = PARAM_PRECISION ) const; // \ru Подобные ли кривые для объединения (слива) \en Whether the curves for union (joining) are similar virtual double GetRadius() const; // \ru Дать физический радиус объекта или ноль, если это невозможно. \en Get the physical radius of the object or null if it impossible. diff --git a/C3d/Include/cur_trimmed_curve3d.h b/C3d/Include/cur_trimmed_curve3d.h index 651c99a..e575b14 100644 --- a/C3d/Include/cur_trimmed_curve3d.h +++ b/C3d/Include/cur_trimmed_curve3d.h @@ -59,13 +59,13 @@ public : // \ru Общие функции математического объекта \en Common functions of the mathematical object virtual MbeSpaceType IsA() const; // \ru Тип элемента \en Type of element - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента \en Create a copy of the element + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента \en Create a copy of the element virtual bool IsSame ( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const; // \ru Является ли объект копией \en Whether the object is a copy virtual bool SetEqual ( const MbSpaceItem & ); // \ru Сделать равным \en Make equal virtual bool IsSimilar( const MbSpaceItem & ) const; // \ru Являются ли объекты подобными \en Whether the objects are similar - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate about an axis + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate about an axis virtual void Refresh(); // \ru Сбросить все временные данные \en Reset all temporary data virtual void PrepareIntegralData( const bool forced ) const; // \ru Рассчитать временные (mutable) данные объекта. \en Calculate temporary (mutable) data of an object. @@ -104,15 +104,15 @@ public : virtual MbCurve3D & SetBasisCurve(); virtual MbCurve3D * Trimmed( double t1, double t2, int sense ) const; // \ru Создание усеченной кривой \en Create a trimmed curve - virtual void Inverse( MbRegTransform * iReg = c3d_null ); // \ru Изменить направление \en Change direction + virtual void Inverse( MbRegTransform * iReg = nullptr ); // \ru Изменить направление \en Change direction virtual double Curvature ( double ) const; // \ru Кривизна усеченной кривой \en Curvature of a trimmed curve virtual double Step ( double t, double sag ) const; // \ru Вычисление шага по стрелке прогиба. \en Calculation of parameter step by the sag. virtual double DeviationStep( double t, double angle ) const; // \ru Вычисление шага по углу отклонения нормали. \en Calculation of parameter step by the deviation angle. virtual double MetricStep ( double t, double length ) const; // \ru Вычисление шага параметра по длине. \en Calculation of parameter step by the given length. virtual bool IsDegenerate( double eps = METRIC_PRECISION ) const; // \ru Проверка вырожденности кривой \en Check for curve degeneracy - virtual MbCurve * GetMap( const MbMatrix3D &, MbRect1D * pRgn = c3d_null, - VERSION version = Math::DefaultMathVersion(), bool * coincParams = c3d_null ) const; // \ru Дать плоскую проекцию кривой \en Get a planar projection of a curve + virtual MbCurve * GetMap( const MbMatrix3D &, MbRect1D * pRgn = nullptr, + VERSION version = Math::DefaultMathVersion(), bool * coincParams = nullptr ) const; // \ru Дать плоскую проекцию кривой \en Get a planar projection of a curve virtual size_t GetCount() const; virtual void ChangeCarrier( const MbSpaceItem & item, MbSpaceItem & init ); // \ru Изменение носителя \en Change a carrier virtual bool IsPlanar ( double accuracy = METRIC_EPSILON ) const; // \ru Является ли кривая плоской \en Whether the curve is planar @@ -137,7 +137,7 @@ public : bool IsBaseParamOn( double t ) const; // \ru Находится ли параметр базовой кривой в диапазоне усеченной кривой \en Whether the parameter of base curve is in range of a trimmed curve // \ru Ближайшая проекция точки на кривую. \en The nearest projection of a point onto the curve. - virtual bool NearPointProjection( const MbCartPoint3D &, double & t, bool ext, MbRect1D * tRange = c3d_null ) const; // \ru Ближайшая проекция точки на кривую \en The nearest projection of a point onto the curve + virtual bool NearPointProjection( const MbCartPoint3D &, double & t, bool ext, MbRect1D * tRange = nullptr ) const; // \ru Ближайшая проекция точки на кривую \en The nearest projection of a point onto the curve /// \ru Найти все особые точки функции кривизны кривой. /// \en Find all the special points of the curvature function of the curve. virtual void GetCurvatureSpecialPoints( std::vector & points ) const; diff --git a/C3d/Include/curve.h b/C3d/Include/curve.h index a14dd52..cd6d7ea 100644 --- a/C3d/Include/curve.h +++ b/C3d/Include/curve.h @@ -33,6 +33,7 @@ class MATH_CLASS MbLine; class MATH_CLASS MbContour; class MATH_CLASS MbPolygon; class MATH_CLASS MbCrossPoint; +class MATH_CLASS MbCurveExtensionParameters; class MbCurveIntoNurbsInfo; struct MbNurbsParameters; @@ -98,10 +99,10 @@ public : virtual MbePlaneType IsA() const = 0; // \ru Тип элемента. \en A type of element. virtual MbePlaneType Type() const; // \ru Групповой тип элемента. \en Group element type. virtual MbePlaneType Family() const; // \ru Семейство объекта. \en Family of object. - virtual MbPlaneItem & Duplicate( MbRegDuplicate * = c3d_null ) const = 0; // \ru Создать копию. \en Create a copy. - virtual void Transform( const MbMatrix &, MbRegTransform * ireg = c3d_null, const MbSurface * newSurface = c3d_null ) = 0; // \ru Преобразовать согласно матрице. \en Transform according to the matrix. - virtual void Move ( const MbVector &, MbRegTransform * = c3d_null, const MbSurface * newSurface = c3d_null ) = 0; // \ru Сдвинуть вдоль вектора. \en Move along a vector. - virtual void Rotate( const MbCartPoint & pnt, const MbDirection & angle, MbRegTransform * = c3d_null, const MbSurface * newSurface = c3d_null ) = 0; // \ru Поворот вокруг точки на угол. \en Rotation at angle around a point. + virtual MbPlaneItem & Duplicate( MbRegDuplicate * = nullptr ) const = 0; // \ru Создать копию. \en Create a copy. + virtual void Transform( const MbMatrix &, MbRegTransform * ireg = nullptr, const MbSurface * newSurface = nullptr ) = 0; // \ru Преобразовать согласно матрице. \en Transform according to the matrix. + virtual void Move ( const MbVector &, MbRegTransform * = nullptr, const MbSurface * newSurface = nullptr ) = 0; // \ru Сдвинуть вдоль вектора. \en Move along a vector. + virtual void Rotate( const MbCartPoint & pnt, const MbDirection & angle, MbRegTransform * = nullptr, const MbSurface * newSurface = nullptr ) = 0; // \ru Поворот вокруг точки на угол. \en Rotation at angle around a point. virtual bool SetEqual( const MbPlaneItem & ) = 0; // \ru Сделать объект равным данному. \en Make an object equal to a given one. virtual bool IsSame( const MbPlaneItem & other, double accuracy = LENGTH_EPSILON ) const = 0; // \ru Является ли кривая curve копией данной кривой? \en Is a curve a copy of a given curve? virtual void Refresh(); // \ru Сбросить все временные данные. \en Reset all temporary data. @@ -337,9 +338,9 @@ public : \param[out] fir - \ru Производная. \en Derivative with respect to t. \~ \param[out] sec - \ru Вторая производная по t, если не ноль. - \en Second derivative with respect to t, if not c3d_null. \~ + \en Second derivative with respect to t, if not nullptr. \~ \param[out] thir - \ru Третья производная по t, если не ноль. - \en Third derivative with respect to t, if not c3d_null. \~ + \en Third derivative with respect to t, if not nullptr. \~ \ingroup Curves_3D */ virtual void Explore( double & t, bool ext, @@ -478,7 +479,7 @@ public : /// \ru Сбросить текущее значение параметра. \en Reset the current value of parameter. virtual void ResetTCalc() const; /// \ru Изменить направления кривой на противоположное. \en Set the opposite direction of curve. - virtual void Inverse( MbRegTransform * iReg = c3d_null ) = 0; + virtual void Inverse( MbRegTransform * iReg = nullptr ) = 0; /// \ru Построить эквидистантную кривую, смещённую на заданное расстояние. \en Construct the equidistant curve which is shifted by the given value. virtual MbCurve * Offset( double rad ) const; @@ -551,10 +552,10 @@ public : \en A constructed NURBS-curve. \~ \param[in] nInfo - \ru Параметры преобразования кривой в NURBS. \en Parameters of conversion of a curve to NURBS. \~ - \result \ru Построенная NURBS кривая или c3d_null при неуспешном построении. - \en The constructed NURBS curve or c3d_null in a case of failure. \~ + \result \ru Построенная NURBS кривая или nullptr при неуспешном построении. + \en The constructed NURBS curve or nullptr in a case of failure. \~ */ - MbNurbs * NurbsCurve( const MbCurveIntoNurbsInfo * nInfo = c3d_null ) const; + MbNurbs * NurbsCurve( const MbCurveIntoNurbsInfo * nInfo = nullptr ) const; /** \brief \ru Построить NURBS копию кривой. \en Construct a NURBS copy of a curve. \~ @@ -576,8 +577,8 @@ public : 'sense' > 0 - direction coincide. \~ \param[in] nInfo - \ru Параметры преобразования кривой в NURBS. \en Parameters of conversion of a curve to NURBS. \~ - \result \ru Построенная NURBS кривая или c3d_null при неуспешном построении. - \en The constructed NURBS curve or c3d_null in a case of failure. \~ + \result \ru Построенная NURBS кривая или nullptr при неуспешном построении. + \en The constructed NURBS curve or nullptr in a case of failure. \~ */ virtual MbNurbs * NurbsCurve( const MbCurveIntoNurbsInfo & nInfo ) const = 0; @@ -591,8 +592,8 @@ public : If the flag of accurate approximation is not set in parameters then NURBS without multiple knots is constructed. \~ \param[in] tParameters - \ru Параметры построения NURBS копии кривой. \en Parameters for the construction of a NURBS copy of the curve. \~ - \result \ru Построенная NURBS кривая или c3d_null при неуспешном построении. - \en The constructed NURBS curve or c3d_null in a case of failure. \~ + \result \ru Построенная NURBS кривая или nullptr при неуспешном построении. + \en The constructed NURBS curve or nullptr in a case of failure. \~ */ virtual MbCurve * NurbsCurve( const MbNurbsParameters & tParameters ) const; @@ -709,10 +710,10 @@ public : \en End parameter of trimming. \~ \param[in, out] part2 - \ru Может заполниться результатом усечения, если не смогли изменить саму кривую. В этом случае возвращаемый результат dp_Degenerated. - Иначе = c3d_null. + Иначе = nullptr. \en This may be filled by a result of trimming if the curve was not changed. In this case the returned value is dp_Degenerated. - Otherwise c3d_null is returned. \~ + Otherwise nullptr is returned. \~ \result \ru Состояние кривой после модификации:\n dp_Degenerated - кривая выродилась, может быть три варианта: кривая не была изменена, так как в результате преобразования она бы выродилась, @@ -804,7 +805,7 @@ public : \en True - if there is found a projection which satisfies to all input conditions. \~ */ virtual bool NearPointProjection( const MbCartPoint & pnt, double xEpsilon, double yEpsilon, - double & t, bool ext, MbRect1D * tRange = c3d_null ) const; + double & t, bool ext, MbRect1D * tRange = nullptr ) const; /** \brief \ru Вычислить проекцию точки на кривую. \en Calculate the point projection to the curve. \~ @@ -1052,7 +1053,7 @@ public : \en A length of a curve between points. \~ */ virtual double LengthBetween2Points( MbCartPoint & p1, MbCartPoint & p2, - MbCartPoint * pc = c3d_null ) const; + MbCartPoint * pc = nullptr ) const; /// \ru Вычислить центр тяжести кривой. \en Calculate the center of gravity of a curve. virtual bool GetWeightCentre ( MbCartPoint & ) const; @@ -1245,6 +1246,8 @@ public : \en Curve parameters in which the analytical function changes. \~ */ virtual void GetAnalyticalFunctionsBounds( std::vector & params ) const; + /// \ ru Определение точек излома кривой. \en The determination of curve smoothness break points. + virtual void BreakPoints( std::vector & vBreaks, double precision = ANGLE_REGION ) const; /// \ru Создать собственное свойство. \en Create a custom property. virtual MbProperty& CreateProperty( MbePrompt name ) const; @@ -1269,7 +1272,7 @@ public : \param[in] epsilon - \ru Погрешность вычисления. \en The accuracy of the calculation. \~ */ - virtual bool IsContinuousDerivative( bool & contLength, bool & contDirect, c3d::DoubleVector * params = c3d_null, double epsilon = EPSILON ) const; + virtual bool IsContinuousDerivative( bool & contLength, bool & contDirect, c3d::DoubleVector * params = nullptr, double epsilon = EPSILON ) const; /** \brief \ru Устранить разрывы первых производных по длине. \en Eliminate the discontinuities of the first derivative at length. @@ -1340,6 +1343,23 @@ public : size_t size() const { return 1; } ///< \ru Количество объектов при трактовке объекта как вектора объектов. \en Number of objects if object is interpreted as vector of objects. const MbCurve * operator [] ( size_t ) const { return this; } ///< \ru Оператор доступа. \en An access operator. +//------------------------------------------------------------------------------ + /** \brief \ru Продлить кривую. + \en Extend the curve. \~ + \details \ru Продлить кривую в соответствии с заданными параметрами. \n + \en Extend the curve according to the given parameters. \~ \n + \param[in] parameters - \ru Параметры продления. + \en Parameters of extension. \~ + \param[out] resCurve - \ru Продленная кривая или нулевой указатель, если продление невозможно. + \en The extended curve or nullptr if extension is impossible. \~ + \return \ru Возвращает статус ошибки или rt_Success, если все хорошо. + \en Returns error status or rt_Success if all is OK. + \warning \ru В разработке. + \en Under development. \~ + */ +// --- + virtual MbResultType Extend( const MbCurveExtensionParameters & parameters, MbCurve *& resCurve ) const; + private: // \ru Объявление оператора присваивания без реализации, чтобы не было присваивания по умолчанию \en Declaration without implementation of the assignment operator to prevent an assignment by default void operator = ( const MbCurve & ); diff --git a/C3d/Include/curve3d.h b/C3d/Include/curve3d.h index 7a8023f..baec58d 100644 --- a/C3d/Include/curve3d.h +++ b/C3d/Include/curve3d.h @@ -34,6 +34,7 @@ class MATH_CLASS MbSurface; class MATH_CLASS MbPolygon3D; class MATH_CLASS MbNurbs3D; class MATH_CLASS MbPlacement3D; +class MATH_CLASS MbCurveExtensionParameters; class MbCurveIntoNurbsInfo; struct MbNurbsParameters; @@ -107,14 +108,14 @@ public : virtual MbeSpaceType IsA() const = 0; // \ru Тип элемента. \en A type of element. virtual MbeSpaceType Type() const; // \ru Групповой тип элемента. \en Group element type. virtual MbeSpaceType Family() const; // \ru Семейство объекта. \en Family of object. - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const = 0; // \ru Сделать копию элемента. \en Create a copy of the element. + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const = 0; // \ru Сделать копию элемента. \en Create a copy of the element. /// \ru Сделать копию с измененным направлением. \en Create a copy with changed direction. virtual MbCurve3D & InverseDuplicate() const; virtual bool IsSame ( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const = 0; // \ru Являются ли объекты равными. \en Determine whether objects are equal. virtual bool SetEqual ( const MbSpaceItem & ) = 0; // \ru Сделать равным. \en Make equal. - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ) = 0; // \ru Преобразовать объект согласно матрице. \en Transform an object according to the matrix. - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ) = 0; // \ru Сдвинуть объект вдоль вектора. \en Move an object along a vector. - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ) = 0; // \ru Повернуть вокруг оси. \en Rotate around an axis. + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ) = 0; // \ru Преобразовать объект согласно матрице. \en Transform an object according to the matrix. + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ) = 0; // \ru Сдвинуть объект вдоль вектора. \en Move an object along a vector. + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ) = 0; // \ru Повернуть вокруг оси. \en Rotate around an axis. virtual double DistanceToPoint( const MbCartPoint3D & ) const; // \ru Вычислить расстояние до точки. \en Calculate the distance to a point. virtual void AddYourGabaritTo( MbCube & ) const; // \ru Добавить габарит кривой в куб. \en Add a bounding box of a curve to a cube. /// \ru Перевести все временные (mutable) данные объекта в неопределённое (исходное) состояние. \en Translate all the time (mutable) data objects in an inconsistent (initial) state. @@ -266,9 +267,9 @@ public : \param[out] fir - \ru Производная. \en Derivative with respect to t. \~ \param[out] sec - \ru Вторая производная по t, если не ноль. - \en Second derivative with respect to t, if not c3d_null. \~ + \en Second derivative with respect to t, if not nullptr. \~ \param[out] thir - \ru Третья производная по t, если не ноль. - \en Third derivative with respect to t, if not c3d_null. \~ + \en Third derivative with respect to t, if not nullptr. \~ \ingroup Curves_3D */ virtual void Explore( double & t, bool ext, @@ -277,9 +278,9 @@ public : /** \brief \ru Вычислить точку и производные на кривой. \en Calculate point and derivatives on the curve. \~ \details \ru Функция перегружена у MbSurfaceIntersectionCurve и MbSilhouetteCurve для приближённого быстрого вычисления точки и производных. - В остальных поверхностях эквивалентна функции Explore(t,false,pnt,fir,sec,c3d_null). + В остальных поверхностях эквивалентна функции Explore(t,false,pnt,fir,sec,nullptr). \en The function is overloaded in MbSurfaceIntersectionCurve and MbSilhouetteCurve for the fast approximated calculation of a point and derivatives. - In other surfaces it is equivalent to the function Explore(t,false,pnt,fir,sec,c3d_null). \~ + In other surfaces it is equivalent to the function Explore(t,false,pnt,fir,sec,nullptr). \~ \param[in] t - \ru Параметр. \en Parameter. \~ \param[out] pnt - \ru Вычисленная точка. @@ -287,7 +288,7 @@ public : \param[out] fir - \ru Производная. \en Derivative with respect to t. \~ \param[out] sec - \ru Вторая производная по t, если не ноль. - \en Second derivative with respect to t, if not c3d_null. \~ + \en Second derivative with respect to t, if not nullptr. \~ \ingroup Curves_3D */ virtual void FastApproxExplore( double & t, MbCartPoint3D & pnt, MbVector3D & fir, MbVector3D * sec ) const; @@ -372,7 +373,7 @@ public : /// \ru Сбросить текущее значение параметра. \en Reset the current value of parameter. virtual void ResetTCalc() const; /// \ru Изменить направление кривой. \en Change direction of a curve. - virtual void Inverse( MbRegTransform * iReg = c3d_null ) = 0; + virtual void Inverse( MbRegTransform * iReg = nullptr ) = 0; /// \ru Вернуть базовую кривую, если есть, или себя \en Returns the base curve if exists or itself virtual const MbCurve3D & GetBasisCurve() const; /// \ru Вернуть базовую кривую, если есть, или себя \en Returns the base curve if exists or itself @@ -392,10 +393,10 @@ public : The number of knots for NURBS is defined depending on the curve. \~ \param[in] nInfo - \ru Параметры преобразования кривой в NURBS. \en Parameters of conversion of a curve to NURBS. \~ - \result \ru Построенная NURBS кривая или c3d_null при неуспешном построении. - \en The constructed NURBS curve or c3d_null in a case of failure. \~ + \result \ru Построенная NURBS кривая или nullptr при неуспешном построении. + \en The constructed NURBS curve or nullptr in a case of failure. \~ */ - MbNurbs3D * NurbsCurve( const MbCurveIntoNurbsInfo * nInfo = c3d_null ) const; + MbNurbs3D * NurbsCurve( const MbCurveIntoNurbsInfo * nInfo = nullptr ) const; /** \brief \ru Построить NURBS копию кривой. \en Construct a NURBS copy of a curve. \~ @@ -415,8 +416,8 @@ public : 'sense' > 0 - direction coincide. \~ \param[in] nInfo - \ru Параметры преобразования кривой в NURBS. \en Parameters of conversion of a curve to NURBS. \~ - \result \ru Построенная NURBS кривая или c3d_null при неуспешном построении. - \en The constructed NURBS curve or c3d_null in a case of failure. \~ + \result \ru Построенная NURBS кривая или nullptr при неуспешном построении. + \en The constructed NURBS curve or nullptr in a case of failure. \~ */ virtual MbNurbs3D * NurbsCurve( const MbCurveIntoNurbsInfo & nInfo ) const; @@ -430,8 +431,8 @@ public : If the flag of accurate approximation is not set in parameters then NURBS without multiple knots is constructed. \~ \param[in] tParameters - \ru Параметры построения NURBS копии кривой. \en Parameters for the construction of a NURBS copy of the curve. \~ - \result \ru Построенная NURBS кривая или c3d_null при неуспешном построении. - \en The constructed NURBS curve or c3d_null in a case of failure. \~ + \result \ru Построенная NURBS кривая или nullptr при неуспешном построении. + \en The constructed NURBS curve or nullptr in a case of failure. \~ \ingroup Curves_3D */ virtual MbCurve3D * NurbsCurve( const MbNurbsParameters & tParameters ) const; @@ -444,8 +445,8 @@ public : \en Parameters for the construction of a NURBS copy of the curve. \~ \param[in] epsilon - \ru Точность аппроксимации. \en The tolerance of approximation. \~ - \result \ru Построенная NURBS кривая или c3d_null при неуспешном построении. - \en The constructed NURBS curve or c3d_null in a case of failure. \~ + \result \ru Построенная NURBS кривая или nullptr при неуспешном построении. + \en The constructed NURBS curve or nullptr in a case of failure. \~ */ virtual size_t NurbsCurveMinPoints( const MbNurbsParameters & tParameters, double epsilon = c3d::METRIC_DELTA ) const; @@ -655,7 +656,7 @@ public : \en True - if there is found a projection which satisfies to all input conditions. \~ \ingroup Curves_3D */ - virtual bool NearPointProjection ( const MbCartPoint3D &pnt, double & t, bool ext, MbRect1D * tRange = c3d_null ) const; + virtual bool NearPointProjection ( const MbCartPoint3D &pnt, double & t, bool ext, MbRect1D * tRange = nullptr ) const; // \ru Изоклины кривой (метод Ньютона). \en Isoclines of a curve (Newton method). /** \brief \ru Найти изоклины кривой. @@ -727,17 +728,17 @@ public : \param[in] version - \ru Версия, по умолчанию - последняя. \en Version, last by default. \~ \param[in, out] coincParams - \ru Флаг совпадения параметризации исходной кривой и ее проекции \n - если coincParams != c3d_null, функция попытается сделать проекцию с совпадающей параметризацией \n + если coincParams != nullptr, функция попытается сделать проекцию с совпадающей параметризацией \n если в результате *coincParams = true, у проекции параметризация совпадает с параметрицацией исходной кривой. \en A flag of coincidence between parameterization of initial curve and its projection \n - if coincParams != c3d_null then the function tries to create a projection with coincident parameterization \n + if coincParams != nullptr then the function tries to create a projection with coincident parameterization \n if *coincParams = true then parameterization of projection coincides with parameterization of initial curve. \~ \return \ru Двумерная проекция кривой. \en Two-dimensional projection of a curve \~ \ingroup Curves_3D */ - virtual MbCurve * GetMap( const MbMatrix3D & into, MbRect1D * pRegion = c3d_null, - VERSION version = Math::DefaultMathVersion(), bool * coincParams = c3d_null ) const; + virtual MbCurve * GetMap( const MbMatrix3D & into, MbRect1D * pRegion = nullptr, + VERSION version = Math::DefaultMathVersion(), bool * coincParams = nullptr ) const; /** \brief \ru Построить плоскую проекцию некоторой части пространственной кривой. \en Construct a planar projection of a piece of a space curve. \~ @@ -754,7 +755,7 @@ public : \ingroup Curves_3D */ virtual MbCurve * GetMapPsp( const MbMatrix3D & into, double zNear, - MbRect1D * pRegion = c3d_null ) const; + MbRect1D * pRegion = nullptr ) const; /** \brief \ru Построить плоскую проекцию пространственной кривой на плоскость. \en Construct a planar projection of a space curve to a plane. \~ @@ -794,7 +795,7 @@ public : \param[in] epsilon - \ru Погрешность вычисления. \en The accuracy of the calculation. \~ */ - virtual bool IsContinuousDerivative( bool & contLength, bool & contDirect, c3d::DoubleVector * params = c3d_null, double epsilon = EPSILON ) const; + virtual bool IsContinuousDerivative( bool & contLength, bool & contDirect, c3d::DoubleVector * params = nullptr, double epsilon = EPSILON ) const; /** \brief \ru Устранить разрывы первых производных по длине. \en Eliminate the discontinuities of the first derivative at length. @@ -884,6 +885,8 @@ public : \ingroup Curves_3D */ virtual void GetAnalyticalFunctionsBounds( std::vector & params ) const; + /// \ ru Определение точек излома кривой. \en The determination of curve smoothness break points. + virtual void BreakPoints( std::vector & vBreaks, double precision = ANGLE_REGION ) const; /** \brief \ru Вычислить граничную точку. \en Calculate the boundary point. \~ @@ -1067,6 +1070,23 @@ public : void SetCurveName( SimpleName newName ) { name = newName; } ///< \ru Установить имя кривой. \en Set a curve name. /** \} */ +//------------------------------------------------------------------------------ + /** \brief \ru Продлить кривую. + \en Extend the curve. \~ + \details \ru Продлить кривую в соответствии с заданными параметрами. \n + \en Extend the curve according to the given parameters. \~ \n + \param[in] parameters - \ru Параметры продления. + \en Parameters of extension. \~ + \param[out] resCurve - \ru Продленная кривая или нулевой указатель, если продление невозможно. + \en The extended curve or nullptr if extension is impossible. \~ + \return \ru Возвращает статус ошибки или rt_Success, если все хорошо. + \en Returns error status or rt_Success if all is OK. + \warning \ru В разработке. + \en Under development. \~ + */ +// --- + virtual MbResultType Extend( const MbCurveExtensionParameters & parameters, MbCurve3D *& resCurve ) const; + // \ru Функции унификации кривой и вектора кривых в шаблонных функциях. \en Functions for compatibility of a curve and a vector of curves in template functions. size_t size() const { return 1; } ///< \ru Размер кривой трактуемой как в виде вектора кривых. \en Size of curve interpreted as vector of curves. const MbCurve3D * operator [] ( size_t ) const { return this; } ///< \ru Оператор доступа. \en An access operator. diff --git a/C3d/Include/dxf_converter.h b/C3d/Include/dxf_converter.h index 99f0093..597d4da 100644 --- a/C3d/Include/dxf_converter.h +++ b/C3d/Include/dxf_converter.h @@ -267,8 +267,8 @@ public: const std::vector< SPtr > & m_faces ); size_t GetSolidBodiesCount() const { return solid_bodies.Count(); } - const DXFSolidBody * GetSolidBody( size_t k ) const { return ((k < solid_bodies.Count()) ? solid_bodies[k] : c3d_null); } - DXFSolidBody * SetSolidBody( size_t k ) { return ((k < solid_bodies.Count()) ? solid_bodies[k] : c3d_null); } + const DXFSolidBody * GetSolidBody( size_t k ) const { return ((k < solid_bodies.Count()) ? solid_bodies[k] : nullptr); } + DXFSolidBody * SetSolidBody( size_t k ) { return ((k < solid_bodies.Count()) ? solid_bodies[k] : nullptr); } const DXFCompositeData & GetData() const { return data;} @@ -406,7 +406,7 @@ public: \en Complete the document creation. \~ */ void CompleteDocument ( ItModelDocument & model_document, - IProgressIndicator * indicator = c3d_null ); + IProgressIndicator * indicator = nullptr ); /// \ru Отобразить текующее состояние хода операции. \en Show the current state of operation progress. void ConvertLastComposite( uint32 defaultColor ); diff --git a/C3d/Include/func_analytical_function.h b/C3d/Include/func_analytical_function.h index c946b99..78e1bd9 100644 --- a/C3d/Include/func_analytical_function.h +++ b/C3d/Include/func_analytical_function.h @@ -77,7 +77,7 @@ public : virtual void Explore( double & t, bool ext, double & val, double & fir, double * sec, double * thr ) const; - virtual void Inverse ( MbRegTransform * iReg = c3d_null ); // \ru Изменить направление \en Change direction + virtual void Inverse ( MbRegTransform * iReg = nullptr ); // \ru Изменить направление \en Change direction virtual double Step ( double t, double sag ) const; virtual double DeviationStep( double t, double angle ) const; @@ -88,7 +88,7 @@ public : virtual bool IsConst () const; virtual bool IsLine () const; - virtual void SetOffsetFunc( double distOld, double distNew ); // \ru Сместить функцию \en Shift a function + virtual void SetOffsetFunc( double off, double scale ); // \ru Сместить функцию \en Shift a function virtual bool SetLimitParam( double newTMin, double newTMax ); // \ru Установить область изменения параметра \en Set range of parameter virtual void SetLimitValue( size_t n, double newValue ); // \ru Установить значение на конце ( 1 - в начале, 2 - в конце) \en Set the value at the end (1 - at start point, 2 - at end point) virtual double GetLimitValue( size_t n ) const; // \ru Дать значение на конце ( 1 - в начале, 2 - в конце) \en Get the value at the end (1 - at start point, 2 - at end point) @@ -162,7 +162,7 @@ public : virtual double SecondDer ( double & t ) const; // \ru Вторая производная по t \en The second derivative with respect to t virtual double ThirdDer ( double & t ) const; // \ru Третья производная по t \en The third derivative with respect to t - virtual void Inverse ( MbRegTransform * iReg = c3d_null ); // \ru Изменить направление \en Change direction + virtual void Inverse ( MbRegTransform * iReg = nullptr ); // \ru Изменить направление \en Change direction virtual double Step ( double t, double sag ) const; virtual double DeviationStep ( double t, double angle ) const; @@ -173,7 +173,7 @@ public : virtual bool IsConst () const; virtual bool IsLine () const; - virtual void SetOffsetFunc ( double distOld, double distNew ); // \ru Сместить функцию \en Shift a function + virtual void SetOffsetFunc ( double off, double scale); // \ru Сместить функцию \en Shift a function virtual bool SetLimitParam ( double newTMin, double newTMax ); // \ru Установить область изменения параметра \en Set range of parameter virtual void SetLimitValue ( size_t n, double newValue ); // \ru Установить значение на конце ( 1 - в начале, 2 - в конце) \en Set the value at the end (1 - at start point, 2 - at end point) virtual double GetLimitValue ( size_t n ) const; // \ru Дать значение на конце ( 1 - в начале, 2 - в конце) \en Get the value at the end (1 - at start point, 2 - at end point) diff --git a/C3d/Include/func_const_function.h b/C3d/Include/func_const_function.h index 9fcb2ba..6de0b04 100644 --- a/C3d/Include/func_const_function.h +++ b/C3d/Include/func_const_function.h @@ -61,7 +61,7 @@ public: virtual void Explore( double & t, bool ext, double & val, double & fir, double * sec, double * thr ) const; - virtual void Inverse ( MbRegTransform * iReg = c3d_null ); // \ru Изменить направление \en Change direction + virtual void Inverse ( MbRegTransform * iReg = nullptr ); // \ru Изменить направление \en Change direction virtual double Step( double t, double sag ) const; virtual double DeviationStep( double t, double angle ) const; @@ -73,7 +73,7 @@ public: virtual bool IsConst() const; virtual bool IsLine () const; - virtual void SetOffsetFunc( double distOld, double distNew ); // \ru Сместить функцию \en Shift a function + virtual void SetOffsetFunc( double off, double scale ); // \ru Сместить функцию \en Shift a function virtual bool SetLimitParam( double newTMin, double newTMax ); // \ru Установить область изменения параметра \en Set range of parameter virtual void SetLimitValue( size_t n, double newValue ); // \ru Установить значение на конце ( 1 - в начале, 2 - в конце) \en Set the value at the end (1 - at start point, 2 - at end point) virtual double GetLimitValue( size_t n ) const; // \ru Дать значение на конце ( 1 - в начале, 2 - в конце) \en Get the value at the end (1 - at start point, 2 - at end point) diff --git a/C3d/Include/func_cubic_function.h b/C3d/Include/func_cubic_function.h index 2278fba..608bbc3 100644 --- a/C3d/Include/func_cubic_function.h +++ b/C3d/Include/func_cubic_function.h @@ -31,7 +31,11 @@ protected: SArray valueList; ///< \ru Контрольные точки. \en The control points. SArray firstList; ///< \ru Производные в контрольных точках. \en The derivatives in control points. SArray tList; ///< \ru Значения параметров функции, которую моделирует кубический сплайн. \en The values of parameters on a function which is modeled by a cubic spline. - bool closed; ///< \ru Признак замкнутости кривой. \en An attribute of curve closedness. + bool monotonic; ///< \ru Признак монотонности набора значений. \en The sign of monotonicity of a set of values. + bool closed; ///< \ru Для немонотонного набора значений - признак замыкания на начальное значение. + ///< \ru Для монотонного набора значений - признак периодичности набора. + ///< \en For a non-monotonic set of values, the sign of closeness to the initial value. + ///< \en For a monotonic set of values, the sign of periodicity of a monotonic set of values. ptrdiff_t uppIndex; ///< \ru Количество интервалов (число точек - 1). \en The number of intervals (a number of points - 1). public : @@ -85,7 +89,7 @@ public: // \ru Вычислить аргумент t по значению функции. \en Calculate the argument t by the function value. virtual double Argument( double & val ) const; - virtual void Inverse( MbRegTransform * iReg = c3d_null ); // \ru Изменить направление \en Change direction + virtual void Inverse( MbRegTransform * iReg = nullptr ); // \ru Изменить направление \en Change direction virtual double Step( double t, double sag ) const; virtual double DeviationStep( double t, double angle ) const; @@ -97,7 +101,7 @@ public: virtual bool IsConst() const; virtual bool IsLine () const; - virtual void SetOffsetFunc( double distOld, double distNew ); // \ru Сместить функцию \en Shift a function + virtual void SetOffsetFunc( double off, double scale ); // \ru Сместить функцию \en Shift a function virtual bool SetLimitParam( double newTMin, double newTMax ); // \ru Установить область изменения параметра \en Set range of parameter virtual void SetLimitValue( size_t n, double newValue ); // \ru Установить значение на конце ( 1 - в начале, 2 - в конце) \en Set the value at the end (1 - at start point, 2 - at end point) virtual double GetLimitValue( size_t n ) const; // \ru Дать значение на конце ( 1 - в начале, 2 - в конце) \en Get the value at the end (1 - at start point, 2 - at end point) diff --git a/C3d/Include/func_cubic_spline_function.h b/C3d/Include/func_cubic_spline_function.h index d66ac73..94b98e0 100644 --- a/C3d/Include/func_cubic_spline_function.h +++ b/C3d/Include/func_cubic_spline_function.h @@ -72,7 +72,7 @@ public: virtual void Explore( double & t, bool ext, double & val, double & fir, double * sec, double * thr ) const; - virtual void Inverse( MbRegTransform * iReg = c3d_null ); // \ru Изменить направление \en Change direction + virtual void Inverse( MbRegTransform * iReg = nullptr ); // \ru Изменить направление \en Change direction virtual double Step( double t, double sag ) const; virtual double DeviationStep( double t, double angle ) const; @@ -84,7 +84,7 @@ public: virtual bool IsConst() const; virtual bool IsLine () const; - virtual void SetOffsetFunc( double distOld, double distNew ); // \ru Сместить функцию \en Shift a function + virtual void SetOffsetFunc( double off, double scale ); // \ru Сместить функцию \en Shift a function virtual bool SetLimitParam( double newTMin, double newTMax ); // \ru Установить область изменения параметра \en Set range of parameter virtual void SetLimitValue( size_t n, double newValue ); // \ru Установить значение на конце ( 1 - в начале, 2 - в конце) \en Set the value at the end (1 - at start point, 2 - at end point) virtual double GetLimitValue( size_t n ) const; // \ru Дать значение на конце ( 1 - в начале, 2 - в конце) \en Get the value at the end (1 - at start point, 2 - at end point) diff --git a/C3d/Include/func_line_function.h b/C3d/Include/func_line_function.h index 17897c2..86c8782 100644 --- a/C3d/Include/func_line_function.h +++ b/C3d/Include/func_line_function.h @@ -67,7 +67,7 @@ public: // \ru Вычислить аргумент t по значению функции. \en Calculate the argument t by the function value. virtual double Argument( double & val ) const; - virtual void Inverse( MbRegTransform * iReg = c3d_null ); // \ru Изменить направление \en Change direction + virtual void Inverse( MbRegTransform * iReg = nullptr ); // \ru Изменить направление \en Change direction virtual double Step( double t, double sag ) const; virtual double DeviationStep( double t, double angle ) const; @@ -84,7 +84,7 @@ public: // \ru Разбить функцию точкой с параметром t и вернуть отрезанную часть. \en Function break by the parameter t, and cut off part of the function: begs == true - save the initial half, beg == false - save the final half. virtual MbFunction * BreakFunction( double t, bool beg ); - virtual void SetOffsetFunc( double distOld, double distNew ); // \ru Сместить функцию \en Shift a function + virtual void SetOffsetFunc( double off, double scale ); // \ru Сместить функцию \en Shift a function virtual bool SetLimitParam( double newTMin, double newTMax ); // \ru Установить область изменения параметра \en Set range of parameter virtual void SetLimitValue( size_t n, double newValue ); // \ru Установить значение на конце ( 1 - в начале, 2 - в конце) \en Set the value at the end (1 - at beginning, 2 - at ending) virtual double GetLimitValue( size_t n ) const; // \ru Дать значение на конце ( 1 - в начале, 2 - в конце) \en Get the value at the end (1 - at beginning, 2 - at ending) diff --git a/C3d/Include/func_mono_smooth_function.h b/C3d/Include/func_mono_smooth_function.h index 6ff8c53..aebab3d 100644 --- a/C3d/Include/func_mono_smooth_function.h +++ b/C3d/Include/func_mono_smooth_function.h @@ -65,6 +65,8 @@ protected: c3d::DoubleVector bet; ///< \ru Параметры beta-функций. \en Parameters of beta functions. c3d::DoubleVector gam; ///< \ru Параметры gamma-функций. \en Parameters of gamma functions. bool cls; ///< \ru Периодичность набора значений.\en Periodicity of the set of values. + double tBegin; ///< \ru Начальный параметр.\en Begin parameter. + double tEnd; ///< \ru Конечный параметр.\en End parameter. private: /// \ru Конструктор. \en Constructor. @@ -83,12 +85,12 @@ public: \en Increasing set of parameters. \~ \param[in] vals - \ru Монотонный набор значений. \en Monotonic set of values. \~ - \param[in] valCls - \ru Периодичность набора значений. + \param[in] periodic - \ru Периодичность набора значений. \en Periodicity of the set of values. \~ \return \ru Статус операции. \en Operation status. \~ */ - bool Init ( const c3d::DoubleVector & pars, const c3d::DoubleVector & vals, bool valCls ); + bool Init ( const c3d::DoubleVector & pars, const c3d::DoubleVector & vals, bool periodic ); public: // \ru Общие функции математического объекта \en Common functions of mathematical object virtual MbeFunctionType IsA () const; // \ru Тип элемента \en A type of element @@ -114,12 +116,14 @@ public: virtual double _ThirdDer ( double t ) const; // \ru Третья производная по t \en The third derivative with respect to t // \ru Вычислить значение и производные. \en Calculate value and derivatives of object for given parameter. \~ virtual void Explore( double & t, bool ext, double & val, double & fir, double * sec, double * thr ) const; - - size_t GetListCount() const { return x.size(); } // \ru Количество точек в наборе \en Number of points in a set. - double GetValue(size_t ind ) const { return y[ind]; } // \ru Получить значение по индексу. \en Get value by index. - double GetParam(size_t ind ) const { return x[ind]; } // \ru Получить параметр по индексу. \en Get parameter by index. + // \ru Вычислить аргумент t по значению функции. \en Calculate the argument t by the function value. + virtual double Argument( double & val ) const; - virtual void Inverse( MbRegTransform * iReg = c3d_null ); // \ru Изменить направление \en Change direction + size_t GetListCount() const { return x.size(); } // \ru Количество точек в наборе \en Number of points in a set. + double GetValue(size_t ind ) const { return y[ind]; } // \ru Получить значение по индексу. \en Get value by index. + double GetParam(size_t ind ) const { return x[ind]; } // \ru Получить параметр по индексу. \en Get parameter by index. + + virtual void Inverse( MbRegTransform * iReg = nullptr ); // \ru Изменить направление \en Change direction virtual double Step( double t, double sag ) const; virtual double DeviationStep( double t, double angle ) const; @@ -131,7 +135,7 @@ public: virtual bool IsConst() const; virtual bool IsLine () const; - virtual void SetOffsetFunc( double distOld, double distNew ); // \ru Сместить функцию \en Shift a function + virtual void SetOffsetFunc( double off, double scale ); // \ru Сместить функцию \en Shift a function virtual bool SetLimitParam( double, double ); // \ru Установить область изменения параметра \en Set range of parameter virtual void SetLimitValue( size_t n, double); // \ru Установить значение на конце ( 1 - в начале, 2 - в конце) \en Set the value at the end (1 - at start point, 2 - at end point) virtual double GetLimitValue( size_t n ) const; // \ru Дать значение на конце ( 1 - в начале, 2 - в конце) \en Get the value at the end (1 - at start point, 2 - at end point) diff --git a/C3d/Include/func_nurbs_function.h b/C3d/Include/func_nurbs_function.h index 7e13a58..1294b09 100644 --- a/C3d/Include/func_nurbs_function.h +++ b/C3d/Include/func_nurbs_function.h @@ -140,7 +140,7 @@ public: // \ru Вычислить аргумент t по значению функции. \en Calculate the argument t by the function value. virtual double Argument( double & val ) const; - virtual void Inverse( MbRegTransform * iReg = c3d_null ); // \ru Изменить направление \en Change direction + virtual void Inverse( MbRegTransform * iReg = nullptr ); // \ru Изменить направление \en Change direction virtual double Step( double t, double sag ) const; virtual double DeviationStep( double t, double angle ) const; @@ -152,7 +152,7 @@ public: virtual bool IsConst() const; virtual bool IsLine () const; /// \ru Сместить функцию. \en Shift a function. - virtual void SetOffsetFunc( double distOld, double distNew ); + virtual void SetOffsetFunc( double off, double scale ); virtual bool SetLimitParam( double newTMin, double newTMax ); // \ru Установить область изменения параметра \en Set range of parameter virtual void SetLimitValue( size_t n, double newValue ); // \ru Установить значение на конце ( 1 - в начале, 2 - в конце) \en Set the value at the end (1 - at start point, 2 - at end point) diff --git a/C3d/Include/func_power_function.h b/C3d/Include/func_power_function.h index 41a6c87..564dcc1 100644 --- a/C3d/Include/func_power_function.h +++ b/C3d/Include/func_power_function.h @@ -67,7 +67,7 @@ public: virtual void Explore( double & t, bool ext, double & val, double & fir, double * sec, double * thr ) const; - virtual void Inverse( MbRegTransform * iReg = c3d_null ); // \ru Изменить направление \en Change direction + virtual void Inverse( MbRegTransform * iReg = nullptr ); // \ru Изменить направление \en Change direction virtual double Step( double t, double sag ) const; virtual double DeviationStep( double t, double angle ) const; @@ -84,7 +84,7 @@ public: // \ru Разбить функцию точкой с параметром t и вернуть отрезанную часть. \en Function break by the parameter t, and cut off part of the function: begs == true - save the initial half, beg == false - save the final half. virtual MbFunction * BreakFunction( double t, bool beg ); - virtual void SetOffsetFunc( double distOld, double distNew ); // \ru Сместить функцию \en Shift a function + virtual void SetOffsetFunc( double off, double scaleFactor ); // \ru Сместить функцию \en Shift a function bool SetLimit( double newTMin, double newTMax ); // \ru Установить область изменения параметра \en Set range of parameter virtual void SetLimitValue( size_t n, double newValue ); // \ru Установить значение на конце ( 1 - в начале, 2 - в конце) \en Set the value at the end (1 - at beginning, 2 - at ending) virtual double GetLimitValue( size_t n ) const; // \ru Дать значение на конце ( 1 - в начале, 2 - в конце) \en Get the value at the end (1 - at beginning, 2 - at ending) diff --git a/C3d/Include/func_serve_function.h b/C3d/Include/func_serve_function.h index 545f335..742b0c5 100644 --- a/C3d/Include/func_serve_function.h +++ b/C3d/Include/func_serve_function.h @@ -108,7 +108,7 @@ public: // \ru Вычислить аргумент t по значению функции. \en Calculate the argument t by the function value. virtual double Argument( double & val ) const; - virtual void Inverse( MbRegTransform * iReg = c3d_null ); // \ru Изменить направление \en Change direction + virtual void Inverse( MbRegTransform * iReg = nullptr ); // \ru Изменить направление \en Change direction virtual double Step( double t, double sag ) const; virtual double DeviationStep( double t, double angle ) const; @@ -125,7 +125,7 @@ public: // \ru Разбить функцию точкой с параметром t и вернуть отрезанную часть. \en Function break by the parameter t, and cut off part of the function: begs == true - save the initial half, beg == false - save the final half. virtual MbFunction * BreakFunction( double t, bool beg ); - virtual void SetOffsetFunc( double distOld, double distNew ); // \ru Сместить функцию \en Shift a function + virtual void SetOffsetFunc( double off, double scale ); // \ru Сместить функцию \en Shift a function virtual bool SetLimitParam( double newTMin, double newTMax ); // \ru Установить область изменения параметра \en Set range of parameter virtual void SetLimitValue( size_t n, double newValue ); // \ru Установить значение на конце ( 1 - в начале, 2 - в конце) \en Set the value at the end (1 - at beginning, 2 - at ending) virtual double GetLimitValue( size_t n ) const; // \ru Дать значение на конце ( 1 - в начале, 2 - в конце) \en Get the value at the end (1 - at beginning, 2 - at ending) diff --git a/C3d/Include/func_sinus_function.h b/C3d/Include/func_sinus_function.h index d2994f6..5a5e62a 100644 --- a/C3d/Include/func_sinus_function.h +++ b/C3d/Include/func_sinus_function.h @@ -67,7 +67,7 @@ public: virtual void Explore( double & t, bool ext, double & val, double & fir, double * sec, double * thr ) const; - virtual void Inverse( MbRegTransform * iReg = c3d_null ); // \ru Изменить направление \en Change direction + virtual void Inverse( MbRegTransform * iReg = nullptr ); // \ru Изменить направление \en Change direction virtual double Step( double t, double sag ) const; virtual double DeviationStep( double t, double angle ) const; @@ -84,7 +84,7 @@ public: // \ru Разбить функцию точкой с параметром t и вернуть отрезанную часть. \en Function break by the parameter t, and cut off part of the function: begs == true - save the initial half, beg == false - save the final half. virtual MbFunction * BreakFunction( double t, bool beg ); - virtual void SetOffsetFunc( double distOld, double distNew ); // \ru Сместить функцию \en Shift a function + virtual void SetOffsetFunc( double off, double scale ); // \ru Сместить функцию \en Shift a function bool SetLimit( double newTMin, double newTMax ); // \ru Установить область изменения параметра \en Set range of parameter virtual void SetLimitValue( size_t n, double newValue ); // \ru Установить значение на конце ( 1 - в начале, 2 - в конце) \en Set the value at the end (1 - at beginning, 2 - at ending) virtual double GetLimitValue( size_t n ) const; // \ru Дать значение на конце ( 1 - в начале, 2 - в конце) \en Get the value at the end (1 - at beginning, 2 - at ending) diff --git a/C3d/Include/function.h b/C3d/Include/function.h index 942d1d7..1968ddc 100644 --- a/C3d/Include/function.h +++ b/C3d/Include/function.h @@ -132,9 +132,9 @@ public: \param[out] fir - \ru Производная. \en Derivative with respect to t. \~ \param[out] sec - \ru Вторая производная по t, если не ноль. - \en Second derivative with respect to t, if not c3d_null. \~ + \en Second derivative with respect to t, if not nullptr. \~ \param[out] thr - \ru Третья производная по t, если не ноль. - \en Third derivative with respect to t, if not c3d_null. \~ + \en Third derivative with respect to t, if not nullptr. \~ \ingroup Curves_3D */ virtual void Explore( double & t, bool ext, @@ -146,7 +146,7 @@ public: virtual double Argument( double & val ) const; /// \ru Изменить направление. \en Change direction. - virtual void Inverse( MbRegTransform * iReg = c3d_null ) = 0; + virtual void Inverse( MbRegTransform * iReg = nullptr ) = 0; /// \ru Вычислить шаг по прогибу для заданного параметра t. \en Calculate a step by the sag for a given parameter t. virtual double Step( double t, double sag ) const = 0; /// \ru Вычислить шаг по угловому отклонению для заданного параметра t. \en Calculate a step by the angular deviation for a given parameter t. @@ -173,7 +173,7 @@ public: /// \en Function break by the parameters: begs == true - save the initial half, beg == false - save the final half. bool CuttingFunction( SArray & params, bool beginSafe, double eps, RPArray & cutted ); /// \ru Сместить функцию. \en Shift a function. - virtual void SetOffsetFunc( double distOld, double distNew ) = 0; + virtual void SetOffsetFunc( double off, double scale ) = 0; /// \ru Установить область изменения параметра. \en Set the range of parameter. virtual bool SetLimitParam( double newTMin, double newTMax ); /// \ru Установить значение на конце ( 1 - в начале, 2 - в конце). \en Set the value at the end (1 - at start point, 2 - at end point). diff --git a/C3d/Include/gc_api.h b/C3d/Include/gc_api.h index 21b2f2f..242be7a 100644 --- a/C3d/Include/gc_api.h +++ b/C3d/Include/gc_api.h @@ -54,22 +54,6 @@ private: geom_coord(); }; -//---------------------------------------------------------------------------------------- -/* - Deprecated data type. Use GCE_ConstraintStatus instead this. - 2019.07.02 -*/ -//--- -enum GcConState -{ - cst_None, - cst_Satisfied, - cst_Not_Satisfied, - cst_Redundant, - cst_Overconstraining, - cst_Unsolvable, -}; - /** \addtogroup Constraints2D_API \{ @@ -194,14 +178,6 @@ GCE_FUNC( bool ) GCE_InitFrozenCoords( GCE_system gSys ); Deprecated functions */ -//---------------------------------------------------------------------------------------- -// \ru Выдать состояние ограничения \en Get the state of constraint -/* - The call is deprecated (2019). Use GCE_ConstraintStatus instead this. -*/ -//--- -GCE_FUNC(GcConState) GCE_GetConstraintState( GCE_system, constraint_item ); - //---------------------------------------------------------------------------------------- // \ru Собрать плохо-обусловленную часть системы ограничений. \en Collect ill-conditioned part of the constraint system. /* diff --git a/C3d/Include/gce_api.h b/C3d/Include/gce_api.h index c10ee7c..1493f45 100644 --- a/C3d/Include/gce_api.h +++ b/C3d/Include/gce_api.h @@ -33,7 +33,6 @@ 6) Другая группа вызовов отвечает за способы управления недоопределенной системой ограничений. Вызовы #GCE_PrepareDraggingPoint, #GCE_MovePoint обеспечивают интерактивную манипуляцию объектами чертежа/эскиза.\n - \en A program interface of geometric solver represents a set of data types and functions necessary for solution of a problem of geometric constraints. Subject area of the solver @@ -257,6 +256,29 @@ GCE_FUNC(geom_item) GCE_AddParametricCurve( GCE_system gSys, const MbCurve & crv //--- GCE_FUNC(geom_item) GCE_AddBoundedCurve( GCE_system gSys, geom_item curve, geom_item p[2] ); +//---------------------------------------------------------------------------------------- +/** \brief \ru Добавить в систему ограничений эквидистантную кривую. + \en Add an equidistant curve to the constraint system. \~ + \details \ru Базовой кривой может быть только кривая одного из следующих типов: точка, прямая, отрезок, окружность, + эллипс, сплайн, ограниченная кривая, параметрическая кривая или эквидистантная кривая. + \en Base curve may be only a curve of one of the following types: point, line, segment, circle, + ellipse, spline, bounded curve, parametric curve, or equidistant curve. \~ + \param[in] gSys - \ru Система ограничений. + \en System of constraints. \~ + \param[in] crv - \ru Дескриптор базовой геометрической кривой. Базовой кривой может + быть только кривая одного из следующих типов: точка, прямая, отрезок, окружность, + эллипс, сплайн, ограниченная кривая, параметрическая кривая или эквидистантная кривая. + \en Descriptor of base geometric curve. Base curve may + be only a curve of one of the following types: point, line, segment, circle, + ellipse, spline, bounded curve, parametric curve, or equidistant curve. \~ + \param[in] offset - \ru Величина смещения эквидистантной кривой относительно базовой. + \en Offsets of the equidistant curve relative to the base curve. \~ + \return \ru Дескриптор зарегистрированной эквидистантной кривой. + \en Descriptor of registered equidistant curve. \~ +*/ +//--- +GCE_FUNC(geom_item) GCE_AddOffsetCurve( GCE_system gSys, geom_item curve, double offset ); + //---------------------------------------------------------------------------------------- /** \brief \ru Добавить в систему жёсткое множество геометрических объектов. \en Add a rigid set of geometric objects to the system. \~ @@ -348,14 +370,31 @@ GCE_FUNC(geom_type) GCE_BaseCurveType( GCE_system gSys, geom_item crv ); GCE_FUNC(bool) GCE_RemoveVariable( GCE_system gSys, var_item var ); //---------------------------------------------------------------------------------------- -/** \brief \ru Удалить геометрический объект из системы ограничений. - \en Delete geometric object from the constraint system. \~ +/** \brief \ru Удалить геометрический объект из системы ограничений. + \en Delete geometric object from the constraint system. \~ + \details \ru Функция удаляет геометрический объект, если он не связан ограничениями, + наличие которых можно проверить вызовом IsConstrainedGeom. Функцию можно + применить к геометрическим узлам, подчиненным другим геометрическим объектам, + таким как GCE_BOUNDED_CURVE, GCM_OFFSET_CURVE, GCM_LINE_SEGMENT. + В этом случае вызов исполняется успешно, однако действительное удаление + может произойти позже в автоматическом порядке после удаления + всех геометрических объектов, которые его использует. + \en The function removes a geometric object if it isn't connected to constraints, + which can be checked by calling IsConstrainedGeom. The function can be applied to + geometric nodes subordinated to other geometric objects, such as + GCE_BOUNDED_CURVE, GCM_OFFSET_CURVE, GCM_LINE_SEGMENT. In this case, + the call succeeds but the actual deletion can happen later in an automatic + order after all the owning geometry has released it. + \note \ru Этот вызов применяется только для геометрии добавленной пользователем с помощью + вызовов GCE_Add***(...). + \en The call only applies to geometry added by the user with calls GCE_Add***(...). + \param[in] gSys - \ru Система ограничений. \en System of constraints. \~ \param[in] g - \ru Дескриптор геометрического объекта. \en Descriptor of geometric object \~ - \return \ru true, если геометрический объект g действительно удален. - \en it equals true if the geometric object g is actually deleted. \~ + \return \ru true, если вызов исполнен успешно. + \en it equals true if the function was performed successfully. \~ */ //--- GCE_FUNC(bool) GCE_RemoveGeom( GCE_system gSys, geom_item g ); @@ -462,7 +501,6 @@ GCE_FUNC(double) GCE_GetVarValue( GCE_system gSys, var_item var ); //---------------------------------------------------------------------------------------- /** \brief \ru Задать текущие координаты точки. \en Set the current coordinates of point. \~ - \param[in] gSys - \ru Система ограничений. \en System of constraints. \~ \param[in] g - \ru Дескриптор точки или иного геометрического объекта. @@ -611,7 +649,6 @@ GCE_FUNC(bool) GCE_RemoveSplinePoint( GCE_system gSys, geom_item spl, size_t pnt клиентское приложение методами GCE_SetCoordValue или GCE_SetPointXY. Замороженные объекты следует рассматривать в качестве независимых входных параметров системы ограничений. - \en The function deprives the object of all degrees of freedom. Note that the function GCE_IsConstrainedGeom returns false for the frozen object if the object was not connected with other constraints. I.e. the freezing is not considered @@ -629,6 +666,22 @@ GCE_FUNC(bool) GCE_RemoveSplinePoint( GCE_system gSys, geom_item spl, size_t pnt //--- GCE_FUNC(bool) GCE_FreezeGeom( GCE_system gSys, geom_item g ); +//---------------------------------------------------------------------------------------- +/** + \brief \ru Задать ограничение "Фиксированное смещение". + \en Set the constraint "Fixation of offset" \~ + \details \ru Зафиксировать смещение эквидистантной кривой (#GCE_OFFSET_CURVE). + \en Fix offset of equidistant curve (#GCE_OFFSET_CURVE). \~ + \param[in] gSys - \ru Система ограничений. + \en System of constraints. \~ + \param[in] curve - \ru Дескриптор эквидистантной кривой. + \en Descriptor of equidistant curve. \~ + \return \ru Дескриптор нового ограничения. + \en Descriptor of a new constraint. \~ +*/ +// --- +GCE_FUNC(geom_item) GCE_FixOffset( GCE_system gSys, geom_item curve ); + //---------------------------------------------------------------------------------------- /** \brief \ru Функция отвечает на вопрос: Связан ли геометрический объект ограничениями? \en The function answers the question: Is geometric object connected with constraints? \~ @@ -664,13 +717,11 @@ GCE_FUNC(bool) GCE_IsSatisfied( GCE_system gSys, constraint_item cItem ); \ru Вызов показывает результат диагностики, которая выделяет в системе ограничений хорошо-обусловленные части и части, содержащие переопределения и противоречия. В результате диагностики или попытки решения каждое ограничение помечается одним из статусов, - перечисленных в наборе GCE_c_status. - + перечисленных в наборе GCE_c_status. \en The call shows the result of the diagnostic, which highlights the constraint system well-conditioned parts and parts containing redundancies and inconsistencies. As a result diagnosing or evaluating each constraint is marked with one of the statuses enumerated by GCE_c_status enum. - \param[in] gSys - \ru Система ограничений. \en System of constraints. \~ \param[in] cItem - \ru Дескриптор ограничения. @@ -718,7 +769,6 @@ GCE_FUNC(std::vector) GCE_DiagnoseGeometry( GCE_system gcSys ); то вычислить степень свободы не удалось. \en The function returns degree of freedom of the point; If a negative value is returned, then it is failed to calculate the degree of freedom. \~ - \details \ru Данная функция возвращает степень свободы точки и может принимать одно из следующих значений:\n (-1) - Означает, что функция не определила степень свободы;\n @@ -728,7 +778,6 @@ GCE_FUNC(std::vector) GCE_DiagnoseGeometry( GCE_system gcSys ); точки;\n 2 - Означает, что точка имеет свободу перемещения в некоторой 2D-области.\n Если направление перемещения определить не удалось, то dofDir принимает значение < 0. - \en This function returns the point's degree of freedom and may take one of the following values:\n (-1) - It means that the function didn't determine the degree of freedom;\n @@ -768,7 +817,6 @@ GCE_FUNC(ptrdiff_t) GCE_GetPointDOF( GCE_system gSys, geom_item g, point_type cp тангенциального вектора перемещения точки;\n dof = 2 - Означает, что точка имеет свободу перемещения в некоторой 2D-области.\n Если направление перемещения определить не удалось, то "dof" принимает значение < 0. - \en This function returns the point's degree of freedom and may take one of the following values:\n dof = (-1) - It means that the function didn't determine the degree of freedom;\n @@ -880,7 +928,6 @@ GCE_FUNC(constraint_item) GCE_AddCoincidence( GCE_system gSys, geom_item g[2] ); интервалу [-PI ... PI]. Область значений k из интервала от 0 до 1 отображается на параметрическую область участка кривой, соответственно k = 0 прикрепит точку pnt[2] к началу участка, а k = 1.0 к концу участка. - \en It is assumed that for the curve 'curve' and the points pnt[0], pnt[1] an incidence is provided with the other constraints registered in solver or these points a priori belong to a curve. An incidence between pnt[2] and 'curve' is not required because @@ -1005,7 +1052,7 @@ GCE_FUNC(constraint_item) GCE_AddPointOnParEllipse( GCE_system gSys, geom_item p \param[in] t - \ru Дескриптор параметра кривой. \en Descriptor of a curve parameter. \~ \return \ru Дескриптор нового ограничения. - \en Descriptor of a new constraint. \~ + \en Descriptor of a new constraint. \~ \details \ru Функция отличается от #GCE_AddCoincidence тем, что позволяет связать точку с параметрической кривой через значение параметра и управлять её положением на кривой через этот параметр. Ограничение доступно для следующих типов кривой: #GCE_ELLIPSE, #GCE_SPLINE, @@ -1143,9 +1190,9 @@ GCE_FUNC(constraint_item) GCE_AddColinear3Points( GCE_system gcSys, geom_item pn \return \ru Дескриптор нового ограничения. \en Descriptor of a new constraint. \~ \details \ru Ограничение применимо для отрезков или участков прямых, созданных с помощью - функции #GCE_AddBoundedCurve или #GCE_AddLineSeg. + функции #GCE_AddBoundedCurve или #GCE_AddLineSeg. \en The constraint is applicable for segments or line pieces created by - the function #GCE_AddBoundedCurve or #GCE_AddLineSeg. \~ + the function #GCE_AddBoundedCurve or #GCE_AddLineSeg. \~ */ //--- GCE_FUNC(constraint_item) GCE_AddEqualLength( GCE_system gSys, geom_item ls1, geom_item ls2 ); @@ -1166,6 +1213,24 @@ GCE_FUNC(constraint_item) GCE_AddEqualLength( GCE_system gSys, geom_item ls1, ge //--- GCE_FUNC(constraint_item) GCE_AddEqualRadius( GCE_system gSys, geom_item c1, geom_item c2 ); +//---------------------------------------------------------------------------------------- +/** + \brief \ru Задать ограничение "Равенство смещений эквидистантных кривых". + \en Set the constraint "Equal of offset of equidistant curves" \~ + \details \ru Ограничение применимо для приравнивания смещений эквидистантных кривых. + \en The constraint is applicable to equal offsets of equidistant curves. \~ + \param[in] gSys - \ru Система ограничений. + \en System of constraints. \~ + \param[in] curve1 - \ru Дескриптор эквидистантной кривой. + \en Descriptor of equidistant curve. \~ + \param[in] curve2 - \ru Дескриптор эквидистантной кривой. + \en Descriptor of equidistant curve. \~ + \return \ru Дескриптор нового ограничения. + \en Descriptor of a new constraint. \~ +*/ +// --- +GCE_FUNC(geom_item) GCE_AddEqualOffset( GCE_system gSys, geom_item curve1, geom_item curve2 ); + //---------------------------------------------------------------------------------------- /** \brief \ru Задать ограничение "Равенство кривизны двух кривых в заданных точках". \en Specify a constraint "Equality of curvature of two curves at given points". \~ @@ -1320,24 +1385,24 @@ GCE_FUNC(constraint_item) GCE_FixRadius( GCE_system gSys, geom_item circ, coord_ \param[in] gSys - \ru Система ограничений. \en System of constraints. \~ \param[in] spline - \ru Дескриптор сплайна. \en Descriptor of spline. \~ \param[in] par - \ru Значение параметра, в котором надо зафиксировать производную. - \ \en Parameter value in which it is necessary to record a derivative. \~ + \en Parameter value in which it is necessary to record a derivative. \~ \param[in] derOrder - \ru Порядок производной, которую надо зафиксировать. \en Order of the derivative which must be fixed. \~ \param[in] fixVal - \ru Значение, к которому надо приравнять производную. \en The value to which it is necessary to equate the derivative. \~ \return \ru Дескриптор нового ограничения. \en Descriptor of a new constraint. \~ \details \ru Точка фиксации задается через значение параметра, соответствующего ей. \n Порядок фиксируемой производной может равняться 0 (фиксация точки), 1, 2 или 3. \n - Если fixVal равен c3d_null, будет зафиксировано текущее значение производной, + Если fixVal равен nullptr, будет зафиксировано текущее значение производной, иначе фиксируемой производной будет присвоено значение fixVal. \en Fixation point is specified via the parameter value corresponding to it. \n The order of a fixed derivative can be equal 0 (point fixing), 1, 2 or 3. \n - If fixVal is c3d_null current value of the derivative vector will be fixed. + If fixVal is nullptr current value of the derivative vector will be fixed. Otherwise the derivative vector will be fixed at fixVal value. \~ */ //--- GCE_FUNC(constraint_item) GCE_FixSplineDerivative( GCE_system gSys, geom_item spline - , double par, uint derOrder, GCE_vec2d * fixVal = c3d_null ); + , double par, uint derOrder, GCE_vec2d * fixVal = nullptr ); //---------------------------------------------------------------------------------------- /** \brief \ru Задать ограничение "Средняя точка". @@ -1422,8 +1487,8 @@ GCE_FUNC(constraint_item) GCE_AddSymmetry( GCE_system gSys, geom_item g[2], geom точку касания на первой и второй кривой. Одна или обе tPar могут быть равными GCE_NULL_V, если соответствующая кривая не является сплайном или параметрической кривой, либо пользователь согласен, что точка касания будет локализована автоматически по ближайшему решению. - - \en Variable descriptors tPar[0], tPar[1] specify help values parametrizing a tangent point + \en + Variable descriptors tPar[0], tPar[1] specify help values parametrizing a tangent point on the first and the second curve. One of both tPar can be equal GCE_NULL_V. \note \ru tPar[0] или tPar[1] могут быть равными GCE_NULL_V, если параметры @@ -1502,13 +1567,14 @@ GCE_FUNC(constraint_item) GCE_AddDistancePLs( GCE_system gSys, geom_item p[3] \en Parameters of dimensional constraint. \~ \return \ru Дескриптор нового ограничения. \en Descriptor of a new constraint. \~ - \details \ru Параметр dPars.dirAngle задает направление размера в радианах. + \details \ru + Параметр dPars.dirAngle задает направление размера в радианах. Управляя dPars.dirAngle, можно задать вертикальный или горизонтальный размеры. Так размер параметром dPars.dirAngle = 0 создаст "горизонтальный размер", а dPars.dirAngle, равный PI/2 радиан будет соответствовать "вертикальному" размеру. - - \en The constraint represents the dimension type that dimensions the + \en + The constraint represents the dimension type that dimensions the distance between two points in plane when they are projected onto a line at an angle specified by parameter dPars dirAngle, which sets the direction of dimension in radians. With driving dPars.dirAngle it is possible to diff --git a/C3d/Include/gce_geom.h b/C3d/Include/gce_geom.h index c7d41bd..055b0b5 100644 --- a/C3d/Include/gce_geom.h +++ b/C3d/Include/gce_geom.h @@ -46,7 +46,7 @@ enum GcGeomType // --- #define CAST_PTR(T) IfGeom2dPtr // \ru Указатель с функцией приведения типов \en Pointer with function of type conversion #define GEOM_PTR(T) IfGeom2dPtr // \ru Указатель с функцией приведения типов \en Pointer with function of type conversion -#define CAST2PTR(T,arg) (arg) != c3d_null ? (T*)((arg)->GetInterfacingGeom(iidr_ ## T)) : c3d_null // \ru Привести к другому типу \en Convert to another type +#define CAST2PTR(T,arg) (arg) != nullptr ? (T*)((arg)->GetInterfacingGeom(iidr_ ## T)) : nullptr // \ru Привести к другому типу \en Convert to another type ////////////////////////////////////////////////////////////////////////////////////////// // \ru Координата геометрического объекта или переменной \en Coordinate of a geometric object or a variable @@ -256,18 +256,18 @@ class IfGeom2dPtr T * m_pI; public: - IfGeom2dPtr() : m_pI(c3d_null) {} + IfGeom2dPtr() : m_pI(nullptr) {} IfGeom2dPtr( T * pI ): m_pI(pI) {} - IfGeom2dPtr( IfSomethingGeom2d * pI ) : m_pI(c3d_null) { if ( pI != c3d_null ) m_pI = (T*)pI->GetInterfacingGeom(iid); } + IfGeom2dPtr( IfSomethingGeom2d * pI ) : m_pI(nullptr) { if ( pI != nullptr ) m_pI = (T*)pI->GetInterfacingGeom(iid); } IfGeom2dPtr( const IfGeom2dPtr & o ) : m_pI( o.m_pI ) {} public: unsigned int GetIid() const { return iid; } operator T*() const { return m_pI; } - T& operator *() { C3D_ASSERT(m_pI != c3d_null); return *m_pI; } - T** operator &() { C3D_ASSERT(m_pI == c3d_null); return &m_pI; } - T* operator->() { C3D_ASSERT(m_pI != c3d_null); return m_pI; } - T* operator->() const { C3D_ASSERT(m_pI != c3d_null); return m_pI; } + T& operator *() { C3D_ASSERT(m_pI != nullptr); return *m_pI; } + T** operator &() { C3D_ASSERT(m_pI == nullptr); return &m_pI; } + T* operator->() { C3D_ASSERT(m_pI != nullptr); return m_pI; } + T* operator->() const { C3D_ASSERT(m_pI != nullptr); return m_pI; } T* Get() const { return m_pI; } T* operator= ( T* pI ) { m_pI = pI; } T* operator= ( const IfGeom2dPtr & o ) { return operator=(o.m_pI); } @@ -280,8 +280,8 @@ public: template inline T* IfGeom2dPtr::operator = ( IfSomethingGeom2d * pI ) { T * pOld = m_pI; - m_pI = c3d_null; - if ( pI != c3d_null ) + m_pI = nullptr; + if ( pI != nullptr ) m_pI = (T*)pI->GetInterfacingGeom( iid ); return m_pI; diff --git a/C3d/Include/gce_types.h b/C3d/Include/gce_types.h index d46d414..6c8230f 100644 --- a/C3d/Include/gce_types.h +++ b/C3d/Include/gce_types.h @@ -129,6 +129,7 @@ typedef enum \en Unit vector of orientation: Normal of a line, direction of "major" semiaxis of ellipse. \~ */ , GCE_ORIENTATION + , GCE_BASE_CURVE } query_geom_type; @@ -177,7 +178,7 @@ typedef enum // \ru Бинарные геометрические ограничения: "constr( geom1, geom2 )" \en Binary geometric constraints: "constr( geom1, geom2 )" , GCE_COINCIDENT ///< \ru Совпадение пары геометрических объектов. \en Coincidence of a pair of geometric objects. - , GCE_EQUAL_CURVATURE ///< \ru Равенство кривизны кривых в точках. \en Equality of curves curvature in given points. + , GCE_EQUAL_CURVATURE ///< \ru Равенство кривизны кривых в точках. \en Equality of curves curvature in given points. , GCE_EQUAL_LENGTH ///< \ru Равенство длин пары отрезков. \en Equality of two segments lengths. , GCE_EQUAL_RADIUS ///< \ru Равенство радиусов пары окружностей. \en Equality of two circles lengths. , GCE_EQUAL_OFFSET ///< \ru Равенство смещений пары эквидистантных кривых. \en Equality of offset of two equidistant curves. @@ -201,6 +202,7 @@ typedef enum , GCE_RADIUS_DIM , GCE_OFFSET_DIM , GCE_ANGLE + , GCE_INTERVAL , GCE_CONSTRAINTS_COUNT ///< \ru Количество типов. \en Number of types. , GCE_UNKNOWN = GCE_CONSTRAINTS_COUNT ///< \ru Неизвестный тип ограничения. \en Unknown constraint type. , GCE_UNKNOWN_CON = GCE_UNKNOWN @@ -534,26 +536,37 @@ struct GCE_dim_pars /** \brief \ru Параметры углового размерного ограничения. \en Parameters of angular dimensional constraint. - \details \ru Структура данных передает настройки для создания угловых размеров. Помимо - общих настроек, передаваемых через структуру #GCE_dim_pars, здесь добавлен флаг - типа угла и множитель пересчета угла в переменную. \n + \details \ru Структура данных передает значение и тип измерения угловых размеров, создаваемых + с помощью вызовов GCE_AddAngle, GCE_AddAngle4P. \n - factor - множитель для пересчета из присланного угла в переменную. - Используется для создания кратных углов, например двойного.\n + dPars - задает величину углового размера и определяет тип размера, управляющий или вариационный.\n + + factor - множитель для пересчета из присланного угла в переменную. + Используется для создания кратных углов, например двойного.\n adjacent - смежный угол. Соответствует углу (M_PI - a), где 'a' - угол между векторами, задающими направление линейного объекта.\n - - Угловой размер можно задать для любых комбинаций линейных объектов. - \en The data structure passes settings for creation of angular dimensions. + Значение поля данных dPars.dValue равно произведению factor*alpha, где alpha - угол между + линейными объектами, измеряемый в радианах. Поле данных dPars.var задает дескриптор переменной + вариационного размера, заданной в градусах. Если dPars.var == GCE_NULL_V, то размер является + управляющим, иначе - вариационным. + + \en The data structure passes specific parameters to create angular dimensions. In addition to the general settings passed via structure #GCE_dim_pars there is a flag of angle type and factor of conversion of angle to variable here. \n + + 'dPars' specifies the value of the angular dimension and defines the type of dimension, driving or variational. \ n 'factor' is a factor for converting from a given angle to variable. It is used for creation of multiple angles, for instance, double angle.\n 'adjacent' - adjacent angle. It corresponds to angle (M_PI - a), where 'a' is an angle between vectors specifying the direction of a linear object.\n + The value of the data field 'dPars.dValue' is equal to the product 'factor * alpha', where alpha + is the angle between linear objects measured in radians. The 'dPars.var' data field specifies + the variable defining variatinal dimension. Its value is given in degrees. + If dPars.var == GCE_NULL_V then the dimendion is driving, otherwise - variational.\n + Angular dimension can be specified for any combination of linear objects. \~ */ //--- @@ -563,7 +576,10 @@ struct GCE_adim_pars double factor; ///< \ru Множитель для пересчета из угла в переменную. \en Factor for converting from angle to variable. bool adjacent; ///< \ru Смежный угол. \en Adjacent angle. - GCE_adim_pars() : dPars(), factor( 1.0 ), adjacent( false ) + GCE_adim_pars() + : dPars() + , factor( 1.0 ) + , adjacent( false ) {} }; @@ -590,6 +606,20 @@ struct GCE_ldim_pars } }; +//---------------------------------------------------------------------------------------- +/** \brief \ru Параметры интервального ограничения. + \en Parameters of interval constraint. + \details \ru Нижняя граница lBnd должна быть не больше верхней границы rBnd. + \en The lower bound lBnd must be no more than the upper bound rBnd. +*/ +//--- +struct GCE_interval +{ + double lBnd; ///< \ru Минимальное значение переменной. \en Minimum value of a variable. + double rBnd; ///< \ru Максимальное значение переменной. \en Maximum value of a variable. + GCE_interval() : lBnd(0.0), rBnd(0.0) {}; +}; + //---------------------------------------------------------------------------------------- /** \brief \ru Контрольная точка драггинга. \en Control point of the dragging. @@ -666,22 +696,6 @@ struct geom_point geom_point( geom_item g, point_type pnt ) : geom( g ), pntName( pnt ) {} }; -/* - The values below will be deleted (deprecated names). -*/ -const constraint_type GCE_INCIDENT = GCE_COINCIDENT; -const geom_type GCE_ARC = GCE_ANY_GEOM; -const geom_type GCE_ELLIPSE_ARC = GCE_ANY_GEOM; - -/* - The values below are deprecated. -*/ - -const query_geom_type GCE_EllipseQ1 = GCE_Q1; -const query_geom_type GCE_EllipseQ2 = GCE_Q2; -const query_geom_type GCE_EllipseQ3 = GCE_Q3; -const query_geom_type GCE_EllipseQ4 = GCE_Q4; - #endif // __GCE_TYPES_H // eof diff --git a/C3d/Include/gcm_api.h b/C3d/Include/gcm_api.h index 5535fdf..e0979ca 100644 --- a/C3d/Include/gcm_api.h +++ b/C3d/Include/gcm_api.h @@ -684,7 +684,7 @@ GCM_FUNC(GCM_pattern) GCM_AddCoordSystemPattern( GCM_system gSys, GCM_geom sampl \en Descriptor of the created constraint which has a type GCM_PATTERN_COORDINATE. \~ */ // --- -GCM_FUNC(GCM_pattern) GCM_AddPatternCoordinate( GCM_system gSys, GCM_pattern csPattern, GCM_coord_name crd, GCM_geom controlObj ); +GCM_FUNC(GCM_pattern) GCM_SubPattern( GCM_system gSys, GCM_pattern csPattern, GCM_coord_name crd, GCM_geom controlObj ); //---------------------------------------------------------------------------------------- /** \brief \ru Добавить геометрический объект в паттерн. @@ -1103,8 +1103,7 @@ GCM_FUNC(GCM_result) GCM_SolveReposition( GCM_system gSys, double alpha ); \en Adding records to the journal from parallel code does not occur. */ //--- -GCE_FUNC(bool) GCM_SetJournal( GCM_system gSys, const char * fName ); - +GCM_FUNC(bool) GCM_SetJournal( GCM_system gSys, const char * fName ); /** \} */ // GCM_3D_API diff --git a/C3d/Include/gcm_constraint.h b/C3d/Include/gcm_constraint.h index e3c49b0..47485cd 100644 --- a/C3d/Include/gcm_constraint.h +++ b/C3d/Include/gcm_constraint.h @@ -26,13 +26,14 @@ class MtConstraintNode; //--- struct GCM_geom_axis { - MbVector3D axis; ///< \ru Направляющий вектор оси планарного угла (задана в ЛСК тела geomPtr). \en Vector of planar angle axis direction (specified in LCS of geomPtr solid). - ItGeomPtr geomPtr; ///< \ru Тело, которому принадлежит ось планарного угла. \en solid the axis of a planar angle belongs to. + MbVector3D axis; ///< \ru Направляющий вектор оси планарного угла (задана в ЛСК тела geomPtr). \en Vector of planar angle axis direction (specified in LCS of geomPtr solid). + const ItGeom * geomPtr; ///< \ru Тело, которому принадлежит ось планарного угла. \en solid the axis of a planar angle belongs to. GCM_geom_axis() : axis( MbVector3D::zero ) - , geomPtr( c3d_null ) {} + , geomPtr( nullptr ) {} }; + //---------------------------------------------------------------------------------------- /// \ru Структура параметров ограничения. \en Structure of constraint parameters. //--- @@ -46,6 +47,7 @@ struct GCM_c_params GCM_scale m_scale; GCM_coord_name m_CrdName; double m_RealPar; ///< \ru Вещественный параметр. \en Real parameter. + MtParVariant m_Interval; GCM_c_params() : m_Version( GetCurrentMathFileVersion() ) @@ -56,6 +58,7 @@ struct GCM_c_params , m_scale ( GCM_NO_SCALE ) , m_CrdName( GCM_NULL_CRD ) , m_RealPar( UNDEFINED_DBL ) + , m_Interval() {} }; @@ -133,7 +136,7 @@ public: /* \en Callback function which defines a law of positioning of the first geometric object which is dependent on positions of other objects. */ - virtual GCM_dependent_func Function() const { return c3d_null; } + virtual GCM_dependent_func Function() const { return nullptr; } virtual GCM_extra_param ExtraParam() const { return GCM_extra_param(); } public: /* @@ -234,6 +237,7 @@ public: // (!) The constants below will be removed in a future version (V17 or l protected: virtual GCM_scale _ScaleType() const { return GCM_NO_SCALE; } virtual GCM_coord_name _CoordName() const { return GCM_NULL_CRD; } + virtual MtParVariant _DimValue() const { return MtParVariant::undef; } protected: ItConstraintItem() : m_args() {} @@ -305,9 +309,17 @@ inline void ItConstraintItem::GetParams( GCM_c_params & pars ) const pars.m_Align = AlignType(); pars.m_TanChoice = TangencyChoice(); pars.m_AngType = AngleType(); - pars.m_RealPar = DimParameter(); pars.m_scale = _ScaleType(); pars.m_CrdName = _CoordName(); + GCM_interval interval; + if ( _DimValue().GetInterval(interval) ) + { + pars.m_Interval = interval; + } + else + { + pars.m_RealPar = DimParameter(); + } } //---------------------------------------------------------------------------------------- @@ -315,7 +327,7 @@ inline void ItConstraintItem::GetParams( GCM_c_params & pars ) const //--- inline ItGeomPtr ItConstraintItem::DependentGeom() const { - return (ConstraintType() == GCM_DEPENDENT) ? GeomItem(1) : c3d_null; + return (ConstraintType() == GCM_DEPENDENT) ? GeomItem(1) : nullptr; } //---------------------------------------------------------------------------------------- @@ -480,7 +492,7 @@ GCM_FUNC(void) PrevSolution( GCM_alignment & ); //--- inline ItGeomPtr ItConstraintItem::_GArg( int geomN ) const { - return size_t(geomN-1) < m_args.size() ? m_args[geomN-1] : ItGeomPtr( c3d_null ); + return size_t(geomN-1) < m_args.size() ? m_args[geomN-1] : ItGeomPtr( nullptr ); } //---------------------------------------------------------------------------------------- diff --git a/C3d/Include/gcm_geom.h b/C3d/Include/gcm_geom.h index 7c70d77..9f1c842 100644 --- a/C3d/Include/gcm_geom.h +++ b/C3d/Include/gcm_geom.h @@ -130,12 +130,12 @@ class MtParGeom; class GCM_CLASS MtGeomVariant { public: - MtGeomVariant() : m_value( c3d_null ) {} + MtGeomVariant() : m_value( nullptr ) {} MtGeomVariant( const MbCartPoint3D & ); MtGeomVariant( const MtGeomVariant & ); - MtGeomVariant( const MtParGeom & g ) : m_value( c3d_null ) { Assign(g); } + MtGeomVariant( const MtParGeom & g ) : m_value( nullptr ) { Assign(g); } MtGeomVariant( const GCM_g_type ); - MtGeomVariant( MtParGeom & g ) : m_value( c3d_null ) { Share(g); } + MtGeomVariant( MtParGeom & g ) : m_value( nullptr ) { Share(g); } MtGeomVariant & operator = ( const MtGeomVariant & gVar ) { return Assign( gVar ); } ~MtGeomVariant(); @@ -230,9 +230,9 @@ private: public: MtMatingGeometry() - : myGeom( c3d_null ) + : myGeom( nullptr ) , myOrientation( Unoriented ) - , myLCSMatrix( c3d_null ) + , myLCSMatrix( nullptr ) {} ~MtMatingGeometry() { @@ -244,7 +244,7 @@ public: MtGeomType GetGeomType() const { return myGeomType; } /// \ru Выдать ориентацию; \en Get orientation; Orient GetOrientation() const { return myOrientation; } - /// \ru Выдать геометрический объект сопряжения. Если =c3d_null, то это точка, заданная MtMatingGeometry::myMatingPoint; \en Get geometric object of the mating. If =c3d_null, then this is a point specified by MtMatingGeometry::myMatingPoint; + /// \ru Выдать геометрический объект сопряжения. Если =nullptr, то это точка, заданная MtMatingGeometry::myMatingPoint; \en Get geometric object of the mating. If =nullptr, then this is a point specified by MtMatingGeometry::myMatingPoint; const MbSpaceItem * GetMatingGeom() const { return myGeom; } /// \ru Выдать матрицу ЛСК, в которой задан геометрический объект сопряжения \en Get matrix of LCS in which the geometric object of the mating is specified const MbMatrix3D & LCSMatrix() const; @@ -314,7 +314,7 @@ private: // \ru Реализовать при необходимости \en Imp //--- inline const MbMatrix3D & MtMatingGeometry::LCSMatrix() const { - if ( myLCSMatrix != c3d_null ) + if ( myLCSMatrix != nullptr ) return *myLCSMatrix; return MbMatrix3D::identity; } @@ -371,7 +371,7 @@ inline void MtMatingGeometry::SetAsMarker( const MbCartPoint3D & org, const MbVe inline void MtMatingGeometry::SetAsLCS( const MbPlacement3D & lcs ) { myGeomType = GCM_LCS; - myGeom = c3d_null; // new MbMarker( MbCartPoint::origin, MbVector3D::zAxis, MbVector3D::xAxis ); + myGeom = nullptr; // new MbMarker( MbCartPoint::origin, MbVector3D::zAxis, MbVector3D::xAxis ); myOrientation = Unoriented; _SetLCSMatrix( lcs.GetMatrixFrom() ); } @@ -397,11 +397,11 @@ inline void MtMatingGeometry::SetAsMatingGeomItem( SPtr gIte //--- inline void MtMatingGeometry::_ClearMatrix() { - if ( myLCSMatrix != c3d_null ) + if ( myLCSMatrix != nullptr ) { delete myLCSMatrix; } - myLCSMatrix = c3d_null; + myLCSMatrix = nullptr; } //---------------------------------------------------------------------------------------- @@ -415,7 +415,7 @@ inline void MtMatingGeometry::_SetLCSMatrix( const MbMatrix3D & gSpan ) } else { - if ( myLCSMatrix == c3d_null ) + if ( myLCSMatrix == nullptr ) myLCSMatrix = new MbMatrix3D( gSpan ); else *myLCSMatrix = gSpan; @@ -428,7 +428,7 @@ inline void MtMatingGeometry::_SetLCSMatrix( const MbMatrix3D & gSpan ) inline void MtMatingGeometry::SetNull() { myGeomType = GCM_NULL_GTYPE; - myGeom = c3d_null; + myGeom = nullptr; myOrientation = Unoriented; _ClearMatrix(); } diff --git a/C3d/Include/gcm_manager.h b/C3d/Include/gcm_manager.h index 13df89e..d083600 100644 --- a/C3d/Include/gcm_manager.h +++ b/C3d/Include/gcm_manager.h @@ -97,21 +97,24 @@ public: static const MtParVariant undef; ///< \ru Неопределенное значение. \en Undefined value. public: - MtParVariant() : tag( tagUndef ), enumVal( SYS_MAX_INT64-2 ) {} // \ru Неопределенное значение \en Undefined value - MtParVariant( float val ) : tag( tagReal ), numVal( static_cast(val) ) {} - MtParVariant( double val ) : tag( tagReal ), numVal( val ) {} + MtParVariant() : tag( GCM_ARG_UNDEFINED ), enumVal( SYS_MAX_INT64-2 ) {} // \ru Неопределенное значение \en Undefined value + MtParVariant( float val ) : tag( GCM_ARG_NUMBER ), numVal( static_cast(val) ) {} + MtParVariant( double val ) : tag( GCM_ARG_NUMBER ), numVal( val ) {} template< class _EnumType > - MtParVariant( _EnumType val ) : tag( tagEnum ), enumVal( static_cast(val) ) {} + MtParVariant( _EnumType val ) : tag( GCM_ARG_ENUM ), enumVal( static_cast(val) ) {} + MtParVariant( const GCM_interval & interval ) : tag( GCM_ARG_INTERVAL ), intervalVal( interval ) {} public: template< typename _EnumType > - bool GetEnum( _EnumType & ) const; + bool GetEnum( _EnumType & ) const; template< typename _EnumType > - _EnumType AsEnum() const; - double AsNumber() const { C3D_ASSERT(tag==tagReal); return numVal; } - int AsInteger() const { C3D_ASSERT(tag==tagInt); return static_cast( enumVal ); } - bool operator == ( const MtParVariant & ) const; - bool operator != ( const MtParVariant & v ) const { return !(v == *this); } + _EnumType AsEnum() const; + double AsNumber() const { C3D_ASSERT(GCM_ARG_NUMBER == tag); return numVal; } + int AsInteger() const { C3D_ASSERT(GCM_ARG_ENUM == tag); return static_cast( enumVal ); } + bool GetInterval( GCM_interval & interval ) const; + GCM_interval AsInterval() const { C3D_ASSERT(GCM_ARG_INTERVAL == tag); return intervalVal; } + bool operator == ( const MtParVariant & ) const; + bool operator != ( const MtParVariant & v ) const { return !(v == *this); } public: GCM_alignment AlignType() const; @@ -120,10 +123,11 @@ public: private: union { - double numVal; - int64 enumVal; - }; - enum { tagUndef, tagReal, tagEnum, tagInt } tag : 8; + double numVal; + int64 enumVal; + GCM_interval intervalVal; + }; + GCM_argument_type tag; }; //---------------------------------------------------------------------------------------- @@ -132,11 +136,11 @@ private: template< typename _EnumType > inline _EnumType MtParVariant::AsEnum() const { - if ( tag == tagUndef ) + if ( GCM_ARG_UNDEFINED == tag ) { return GCM_undefined<_EnumType>::value; } - C3D_ASSERT( tag == tagEnum ); + C3D_ASSERT( GCM_ARG_ENUM == tag ); return static_cast<_EnumType>( enumVal ); } @@ -146,7 +150,7 @@ inline _EnumType MtParVariant::AsEnum() const template< typename _EnumType > bool MtParVariant::GetEnum( _EnumType & val ) const { - if ( tag == tagEnum ) + if ( GCM_ARG_ENUM == tag ) { val = AsEnum<_EnumType>(); return true; @@ -174,7 +178,7 @@ inline GCM_alignment MtParVariant::AlignType() const if ( *this == undef ) return GCM_NO_ALIGNMENT; - if ( (tag == tagEnum) && (GCM_MIN_ALIGNMENT <= enumVal && enumVal < GCM_MAX_ALIGNMENT) ) + if ( (GCM_ARG_ENUM == tag) && (GCM_MIN_ALIGNMENT <= enumVal && enumVal < GCM_MAX_ALIGNMENT) ) { return AsEnum(); } @@ -190,18 +194,20 @@ inline GCM_c_arg MtParVariant::CArg() const GCM_c_arg cArg; switch( tag ) { - case tagEnum: - case tagInt: - cArg = enumVal; - break; - case tagReal: - cArg = numVal; - break; - case tagUndef: - cArg = GCM_NULL; - break; - default: - C3D_ASSERT_UNCONDITIONAL( false ); + case GCM_ARG_ENUM: + cArg = enumVal; + break; + case GCM_ARG_NUMBER: + cArg = numVal; + break; + case GCM_ARG_INTERVAL: + cArg = intervalVal; + break; + case GCM_ARG_UNDEFINED: + cArg = GCM_NULL; + break; + default: + C3D_ASSERT_UNCONDITIONAL( false ); } return cArg; } @@ -256,10 +262,9 @@ public: ~MtArgument(); public: - /// \ru Геометрический объект, вычисляемый в системе ограничений. \en Geometric object calculated in the constraint system. - ItGeomPtr Geom() { return m_geom; } /// \ru Геометрический объект, вычисляемый в системе ограничений. \en Geometric object calculated in the constraint system. const ItGeom * Geom() const { return m_geom; } + ItGeomPtr NonConstGeom() { return m_geom; } // For internal use only. /** \brief \ru Геометрическое значение аргумента, заданное в ЛСК объекта ItGeom * Geom(). \en Geometric value of the argument specified in the LCS of the object ItGeom * Geom(). */ @@ -328,7 +333,7 @@ public: /// \ru Добавить паттерн. \en Add a pattern. MtPatternId AddPattern( MtMateType, MtArgument, MtArgument, MtParVariant par=MtParVariant::undef ); /// \ru \ru Задать координату паттерна - Система Координат. \en Create the constraint coordinate of the coordinate system pattern. - MtPatternId AddPatternCoordinate( MtPatternId ptrn, GCM_coord_name, MtArgument axis ); + MtPatternId SubPattern( MtPatternId ptrn, GCM_coord_name, MtArgument axis ); /// \ru Добавить геометрический объект в паттерн. \en Add a geometric object to the pattern. MtConstraintId AddGeomToPattern( MtPatternId ptrn, MtArgument ptrnObj, MtParVariant par1 = MtParVariant::undef, MtParVariant par2 = MtParVariant::undef, GCM_scale scale=GCM_RIGID ); diff --git a/C3d/Include/gcm_routines.h b/C3d/Include/gcm_routines.h index 0e98b63..520bb47 100644 --- a/C3d/Include/gcm_routines.h +++ b/C3d/Include/gcm_routines.h @@ -354,7 +354,6 @@ GCM_FUNC(bool) GCM_RelativePlacement( MbPlacement3D gPlaces[] Сфера - задана точкой \b pc -центр сферы и r1=r2 -радиус сферы;\n Тор задан точкой \b pc - центр тора, {pc,vec}-ось тора, \b r1 -большой радиус тора, \b r2 -радиус малый (половина толщины бублика).\n - \en Writing format of the tuple {pc, vec, r1, r2} Tuple of values {pc, vec, r1, r2} unified describes all the types of geometric objects listed in the #MtGeometryType. \n diff --git a/C3d/Include/gcm_types.h b/C3d/Include/gcm_types.h index 2d864a8..360d3e5 100644 --- a/C3d/Include/gcm_types.h +++ b/C3d/Include/gcm_types.h @@ -53,6 +53,20 @@ const GCM_object GCM_NULL = _GCM_NULL; */ const GCM_geom GCM_GROUND = _GCM_GROUND; +//---------------------------------------------------------------------------------------- +/** \brief \ru Словарь типов аргументов геометрических ограничений. + \en Dictionary of geometric argument types. \~ +*/ +// --- +typedef enum +{ + GCM_ARG_UNDEFINED = 0, // Аргумент не определен. + GCM_ARG_INTERVAL, // Интервальное число. + GCM_ARG_DESCRIPTOR, // Десктриптор переменной или геометрического объекта + GCM_ARG_NUMBER, // Число с плавающей точкой + GCM_ARG_ENUM, // Значение из перечислительног типа (дискретное множество) +} GCM_argument_type; + //---------------------------------------------------------------------------------------- /** \brief \ru Словарь типов геометрических примитивов. \en Dictionary of geometric primitives types. \~ @@ -114,9 +128,9 @@ typedef enum , GCM_ANGULAR_PATTERN = 17 ///< \ru Угловой паттерн. \en Angular pattern. , GCM_CS_PATTERN = 19 ///< \ru Паттерн - Система Координат (СК-паттерн). \en Coordinate System pattern. , GCM_PATTERN_COORDINATE = 20 ///< \ru Координата СК-паттерна. \en Coordinate of the Coordinate System patten. - , GCM_RADIUS = 18 ///< \ru Радиальный размер. \en Radial dimension. - , GCM_LAST_CTYPE = 100 - , GCM_IN_PLACE = 7 // Deprecated + , GCM_RADIUS = 18 ///< \ru Радиальный размер. \en Radial dimension. + , GCM_LAST_CTYPE = 100 + , GCM_IN_PLACE = 7 // Deprecated } GCM_c_type; //---------------------------------------------------------------------------------------- @@ -213,8 +227,8 @@ typedef enum //--- typedef enum { - GCM_RESULT_None = 0 ///< \ru Код неопределенного результата или состояния. \en Code of undefined result or status. \~ - , GCM_RESULT_Ok = 1 ///< \ru Успешный результат вызова API компонента GCM. \en The successful result of GCM API call. \~ + GCM_RESULT_None = 0 ///< \ru Код неопределенного результата или состояния. \en Code of undefined result or status. \~ + , GCM_RESULT_Ok = 1 ///< \ru Успешный результат вызова API компонента GCM. \en The successful result of GCM API call. \~ , GCM_RESULT_Satisfied = GCM_RESULT_Ok ///< \ru Ограничение или система ограничения решены. \en Constraint or system of constraints are fulfilled. \~ , GCM_RESULT_Overconstrained = 2 ///< \ru Ограничение переопределяет систему и противоречит другим условиям. \en Constraint is redundant and contradicts the other conditions. \~ , GCM_RESULT_MatedFixation = 3 ///< \ru Заданы ограничения для пары фиксированных объектов. \en Constraints are specified for pair of fixed objects. \~ @@ -238,7 +252,8 @@ typedef enum */ , GCM_RESULT_IncompatibleArguments = 3001 ///< \ru Несовместные типы аргументов ограничения. \en Inconsistent types of constraint arguments. \~ - , GCM_RESULT_InconsistentAngleType ///< \ru Угловая опция несовместима со степенью свободы соединения (планарный тип угла применим только для соединения, оставляющего единственную степень свободы вращения). \en Angular option is inconsistent with the degree of freedom of the joint (planar type of angle is only applicable for the joint leaving only one degree of freedom of rotation); \~ + , GCM_RESULT_InconsistentAngleType // Deprecated. \ru Угловая опция несовместима со степенью свободы соединения (планарный тип угла применим только для соединения, оставляющего единственную степень свободы вращения). \en Angular option is inconsistent with the degree of freedom of the joint (planar type of angle is only applicable for the joint leaving only one degree of freedom of rotation); \~ + , GCM_RESULT_UndefinedAngleType = GCM_RESULT_InconsistentAngleType , GCM_RESULT_InconsistentAlignment ///< \ru Величина ориентации несовместна с другими сопряжениями. \en The orientation value is inconsistent with other mates. \~ , GCM_RESULT_Duplicated ///< \ru Ограничение дублирует другое. \en Constraint duplicates another. , GCM_RESULT_CyclicDependence ///< \ru Неразрешимая циклическая зависимость. \en Unsolvable cyclic dependence. @@ -265,6 +280,7 @@ typedef enum \en Messages about incorrect results of the solver API calls (not computational). \~ */ , GCM_RESULT_ItsNotDrivingDimension ///< \ru Данное ограничение должно быть управляющим размером. \en Given constraint should be a driving dimension. + , GCM_RESULT_IncorrectDimensionInterval ///< \ru Задан некорректный интервал для размерного ограничения. \en Incorrect interval for dimension constraint. , GCM_RESULT_Unregistered ///< \ru Обращение к недействительному объекту. \en Access to invalid object. , GCM_RESULT_InternalError , GCM_RESULT_Aborted ///< \ru Процесс вычислений был прерван по запросу приложения. \en The evaluation process aborted by the application. \~ @@ -343,6 +359,11 @@ struct GCM_vec3d { double x, y, z; }; //--- struct GCM_point { double x, y, z; }; +//---------------------------------------------------------------------------------------- +/// \ru Интервал допустимых значений линейного или углового размера. \en The range of allowable values for a linear or angular dimension. +//--- +struct GCM_interval { double lBnd, rBnd; }; + //---------------------------------------------------------------------------------------- /** \brief \ru Структура полей данных, представляющих геометрический объект. \en Structure of data fields representing a geometric object. \~ @@ -429,29 +450,42 @@ struct GCM_c_arg GCM_coord_name crd; double dimValue; // Numeric value of a dimension. int64 enumVal; - }; + GCM_interval dimInterval; + }; + + GCM_argument_type tag; // Constraint argument type. GCM_c_arg & operator = ( double val ) - { + { + tag = GCM_ARG_NUMBER; var = GCM_NULL; dimValue = val; return *this; } template GCM_c_arg & operator = ( const _Enum & val ) - { + { + tag = GCM_ARG_ENUM; var = GCM_NULL; enumVal = static_cast( val ); return *this; } GCM_c_arg & operator = ( const GCM_object & varId ) { + tag = GCM_ARG_DESCRIPTOR; var = varId; dimValue = 0.0; return *this; } + GCM_c_arg & operator = ( const GCM_interval & interval ) + { + tag = GCM_ARG_INTERVAL; + var = GCM_NULL; + dimInterval = interval; + return *this; + } - GCM_c_arg() { dimValue = 0.0; var = GCM_NULL; } + GCM_c_arg() { tag = GCM_ARG_UNDEFINED; dimValue = 0.0; var = GCM_NULL; } }; //---------------------------------------------------------------------------------------- diff --git a/C3d/Include/graph_algorithms.h b/C3d/Include/graph_algorithms.h index 6e2d11d..8e2482b 100644 --- a/C3d/Include/graph_algorithms.h +++ b/C3d/Include/graph_algorithms.h @@ -112,7 +112,7 @@ public: static const typename Graph::vertex_index NO_VERTEX = (size_t)-1; BicompDFSVisitor( BicompVisitor & vis ) - : m_graph( c3d_null ) + : m_graph( nullptr ) , m_bicompVis( vis ) , m_dfsCounter( 1 ) , num() diff --git a/C3d/Include/instance.h b/C3d/Include/instance.h index 4534f19..54ee558 100644 --- a/C3d/Include/instance.h +++ b/C3d/Include/instance.h @@ -68,11 +68,11 @@ public : // \ru Общие функции геометрического объекта. \en Common functions of a geometric object. virtual MbeSpaceType IsA() const; // \ru Тип объекта. \en An object type. - virtual MbSpaceItem & Duplicate( MbRegDuplicate * iReg = c3d_null ) const; // \ru Создать копию. \en Create a copy. - virtual void Transform( const MbMatrix3D &, MbRegTransform * iReg = c3d_null ); // \ru Преобразовать согласно матрице. \en Transform according to the matrix. - virtual void Move ( const MbVector3D &, MbRegTransform * iReg = c3d_null ); // \ru Сдвинуть вдоль вектора. \en Move along a vector. - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * iReg = c3d_null ); // \ru Повернуть вокруг оси. \en Rotate about an axis. - virtual bool IsSame ( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const; // \ru Являются ли объекты равными? \en Whether the objects are equal? + virtual MbSpaceItem & Duplicate( MbRegDuplicate * iReg = nullptr ) const; // \ru Создать копию. \en Create a copy. + virtual void Transform( const MbMatrix3D &, MbRegTransform * iReg = nullptr ); // \ru Преобразовать согласно матрице. \en Transform according to the matrix. + virtual void Move ( const MbVector3D &, MbRegTransform * iReg = nullptr ); // \ru Сдвинуть вдоль вектора. \en Move along a vector. + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * iReg = nullptr ); // \ru Повернуть вокруг оси. \en Rotate about an axis. + virtual bool IsSame ( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const; // \ru Являются ли объекты равными? \en Whether the objects are equal? virtual bool IsSimilar( const MbSpaceItem & init ) const; // \ru Являются ли объекты подобными? \en Whether the objects are similar? virtual bool SetEqual ( const MbSpaceItem & init ); // \ru Сделать объекты равными. \en Make the objects equal. virtual double DistanceToPoint ( const MbCartPoint3D & ) const; // \ru Вычислить расстояние до точки. \en Calculate distance to point. @@ -124,11 +124,11 @@ public : virtual const MbItem * GetItemByName( SimpleName n, MbPath & path, MbMatrix3D & from ) const; // \ru Преобразовать согласно матрице c использованием регистратора содержимый объект, если он селектирован. \en Transform the contained object according to the matrix using the registrator if the object selected. - virtual void TransformSelected( const MbMatrix3D & matr, MbRegTransform * iReg = c3d_null ); + virtual void TransformSelected( const MbMatrix3D & matr, MbRegTransform * iReg = nullptr ); // \ru Сдвинуть вдоль вектора с использованием регистратора содержимый объект, если он селектирован. \en Translate the contained object along the vector according to the matrix using the registrator if the object selected. - virtual void MoveSelected( const MbVector3D & to, MbRegTransform * iReg = c3d_null ); + virtual void MoveSelected( const MbVector3D & to, MbRegTransform * iReg = nullptr ); // \ru Повернуть вокруг оси на заданный угол с использованием регистратора содержимый объект, если он селектирован. \en Translate the contained object about the axis according to the matrix using the registrator if the object selected. - virtual void RotateSelected( const MbAxis3D & axis, double angle, MbRegTransform * iReg = c3d_null ); + virtual void RotateSelected( const MbAxis3D & axis, double angle, MbRegTransform * iReg = nullptr ); /// \ru Дать матрицу преобразования из локальной системы объекта. \en Get transform matrix from local coordinate system of object. virtual bool GetMatrixFrom( MbMatrix3D & from ) const; diff --git a/C3d/Include/io_buffer.h b/C3d/Include/io_buffer.h index 119654c..76c6367 100644 --- a/C3d/Include/io_buffer.h +++ b/C3d/Include/io_buffer.h @@ -597,22 +597,22 @@ public: /// \ru Установить для записи FileSpace с заданным индексом (при необходимости создать новый). ///\en Set FileSpace with given index for writing (create if necessary). - virtual FileSpace * enterFileSpace ( uint8 ) { return c3d_null; } // не реализовано; not implemeneted + virtual FileSpace * enterFileSpace ( uint8 ) { return nullptr; } // не реализовано; not implemeneted /// \ru Установить позицию для записи/чтения по заданному ClusterReference. /// Сохранить предыдущую позицию, если saveCurr = true. /// \en Set position for for writing/reading by given ClusterReference. /// If saveCurr = true, save previous position. - virtual FileSpace * enterFileSpace ( const ClusterReference & , bool ) { return c3d_null; } // не реализовано; not implemeneted + virtual FileSpace * enterFileSpace ( const ClusterReference & , bool ) { return nullptr; } // не реализовано; not implemeneted /// \ru Установить позицию для записи/чтения по заданным FileSpace и ClusterReference. /// Внимание, здесь ClusterReference.clusterIndex должен содержать индекс в массиве индексов кластеров в FileSpace! /// Сохранить предыдущую позицию, если saveCurr = true. /// \en Set position for writing/reading by given FileSpace and ClusterReference. /// Warning: in this function, ClusterReference.clusterIndex should contain an index in array of cluster indices in FileSpace! /// If saveCurr = true, save previous position. - virtual FileSpace * enterFileSpace ( const ClusterReference &, FileSpace *, bool ) { return c3d_null; } // не реализовано; not implemeneted + virtual FileSpace * enterFileSpace ( const ClusterReference &, FileSpace *, bool ) { return nullptr; } // не реализовано; not implemeneted /// \ru Установить предыдущий FileSpace для записи/чтения. ///\en Set previous FileSpace for writing/reading. - virtual FileSpace * returnToPreviousFileSpace() { return c3d_null; } // не реализовано; not implemeneted + virtual FileSpace * returnToPreviousFileSpace() { return nullptr; } // не реализовано; not implemeneted /// \ru Получить текущую позицию в буфере. \en Get current position in the buffer. ClusterReference getCurrentClusterPos(); diff --git a/C3d/Include/io_memory_buffer.h b/C3d/Include/io_memory_buffer.h index 2f3af0a..9ddd292 100644 --- a/C3d/Include/io_memory_buffer.h +++ b/C3d/Include/io_memory_buffer.h @@ -61,7 +61,7 @@ protected: ClusterReference _ref; FileSpace * _file; - FileStackEntry() : _file(c3d_null) {} + FileStackEntry() : _file(nullptr) {} FileStackEntry ( ClusterReference r, FileSpace * f ) : _ref(r), _file(f) {} }; std::stack filesStack; @@ -84,18 +84,18 @@ public: bool isEmpty() const; /// \ru Записать в непрерывную память. /// Функция подразумевает вполне определенное толкование значений входных данных, поэтому она не должна вызываться с неинициализированными аргументами. - /// \param[in,out] memory - память, куда писать. Если memory == c3d_null, то память выделяется. + /// \param[in,out] memory - память, куда писать. Если memory == nullptr, то память выделяется. /// \param[in] addSize - размер памяти, которую надо дополнительно выделить при выделении памяти. /// Смысл addSize зависит от начального значения параметра memory: - /// если memory != c3d_null (т.е.память уже распределена), то addSize должен быть равен размеру памяти (addSize >= getMemLen() !!!). - /// если memory == c3d_null, то addSize определяет, столько байт дополнительно добавить (обнулив) в начале при выделении памяти. + /// если memory != nullptr (т.е.память уже распределена), то addSize должен быть равен размеру памяти (addSize >= getMemLen() !!!). + /// если memory == nullptr, то addSize определяет, столько байт дополнительно добавить (обнулив) в начале при выделении памяти. /// \en Write to contiguous memory. /// The function implies a well-defined interpretation of the input values, so it should not be called with uninitialized arguments. - /// \param[in,out] memory - memory to write to. If memory == c3d_null, then memory is allocated. + /// \param[in,out] memory - memory to write to. If memory == nullptr, then memory is allocated. /// \param[in] addSize - size of memory, which should be allocated additionally when allocating memory. /// The meaning of addSize depends on the initial value of the parameter 'memory': - /// if memory != c3d_null (i.e. the memory is already allocated), then addSize should be equal to memory size (addSize >= getMemLen() !!!). - /// if memory == c3d_null, then addSize defines a number of bytes to be added (and zeroed) at the beginning when allocating memory. + /// if memory != nullptr (i.e. the memory is already allocated), then addSize should be equal to memory size (addSize >= getMemLen() !!!). + /// if memory == nullptr, then addSize defines a number of bytes to be added (and zeroed) at the beginning when allocating memory. size_t toMemory( const char *& memory, size_t addSize = 0 ) const; /// \ru Прочитать из непрерывной памяти. \en Read from the contiguous memory. bool fromMemory( const char * memory ); diff --git a/C3d/Include/io_tape.h b/C3d/Include/io_tape.h index 82db405..d503994 100644 --- a/C3d/Include/io_tape.h +++ b/C3d/Include/io_tape.h @@ -470,7 +470,7 @@ public: size_t Add( const TapeBase * e ); /// \ru Выдать указатель на зарегистрированный объект по заданной позиции в кластере. \en Get the pointer of the registered object by the position in the cluster. - virtual TapeBase * Get( const ClusterReference & ) const { return c3d_null; } // unsupported + virtual TapeBase * Get( const ClusterReference & ) const { return nullptr; } // unsupported /// \ru Выдать позицию в кластере по заданному индексу. \en Get position in the cluster by given index. virtual ClusterReference GetClusterRef( size_t ) const { return ClusterReference(); } // unsupported /// \ru Добавить позицию объекта в кластере. \en Add the object position in the cluster. @@ -700,7 +700,7 @@ private: // --- class MATH_CLASS reader : public virtual tape { public: - typedef std_unique_ptr reader_ptr; + typedef std::unique_ptr reader_ptr; protected: /// \ru Конструктор. \en Constructor. reader( iobuf_Seq & buf, bool ownbuf, bool openSys, uint16 om, TapeRegistrator * reg ); @@ -722,7 +722,7 @@ public: public: /// \ru Создать читатель для последовательного буфера. \en Create reader for iobuf_Seq. - static reader_ptr CreateReader ( std_unique_ptr buf, uint16 om ); + static reader_ptr CreateReader ( std::unique_ptr buf, uint16 om ); /// \ru Создать читатель для буфера в памяти. \en Create reader for membuf. static reader_ptr CreateMemReader ( membuf & sb, uint8 om ); @@ -736,7 +736,7 @@ public: /// \ru Читать каталог объектов. \en Read the object catalog. virtual void ReadObjectCatalog(); /// \ru Читать объект по позиции в кластере. \en Read an object by position in cluster. - virtual TapeBase * ReadObjectByPosition ( const ClusterReference & ) { return c3d_null; } + virtual TapeBase * ReadObjectByPosition ( const ClusterReference & ) { return nullptr; } /// \ru Установить позицию чтения. \en Set reading position. virtual bool SetReadPosition ( ClusterReference & ) { return false; } // not supported @@ -754,7 +754,7 @@ public: virtual bool readBytes( void * bf, size_t len ); /// \ru Получить указатель на дерево модели. \en Get pointer to the model tree. - virtual const c3d::IModelTree * GetModelTree() const { return c3d_null; } // not supported + virtual const c3d::IModelTree * GetModelTree() const { return nullptr; } // not supported /// \ru Получить признак полного чтения текущего объекта. \en Get indicator of full reading of the current object. /// \ru Установить признак полного чтения текущего объекта. \en Set indicator of full reading of the current object. @@ -820,7 +820,7 @@ private: // --- class MATH_CLASS reader_ex : public reader { - std_unique_ptr m_tree; + std::unique_ptr m_tree; uint32 m_lastError; bool m_fullRead; protected: @@ -838,10 +838,10 @@ public: public: /// \ru Создать экземпляр reader_ex для последовательного буфера. \en Create reader_ex instance for sequential buffer. - static std_unique_ptr CreateReaderEx( std_unique_ptr buf, uint16 om ); + static std::unique_ptr CreateReaderEx( std::unique_ptr buf, uint16 om ); /// \ru Создать читатель для буфера в памяти. \en Create reader for membuf. - static std_unique_ptr CreateMemReaderEx ( membuf & sb, uint8 om ); + static std::unique_ptr CreateMemReaderEx ( membuf & sb, uint8 om ); public: @@ -891,7 +891,7 @@ private: // --- class MATH_CLASS writer : public virtual tape { public: - typedef std_unique_ptr writer_ptr; + typedef std::unique_ptr writer_ptr; protected: /// \ru Конструктор. \en Constructor. writer ( iobuf_Seq & buf, bool ownBuf, bool openSys, uint16 om, TapeRegistrator * reg ); @@ -910,7 +910,7 @@ public: public: /// \ru Создать писатель для последовательного буфера. \en Create writer for iobuf_Seq. - static writer_ptr CreateWriter( std_unique_ptr buf, uint16 om ); + static writer_ptr CreateWriter( std::unique_ptr buf, uint16 om ); /// \ru Создать писатель для буфера в памяти. \en Create writer for membuf. static writer_ptr CreateMemWriter( membuf & sb, uint8 om ); @@ -946,7 +946,7 @@ public: size_t __lenWchar( const TCHAR * s ); /// \ru Получить указатель на дерево модели. \en Get pointer to the model tree. - virtual const c3d::IModelTree * GetModelTree() const { return c3d_null; } // not supported + virtual const c3d::IModelTree * GetModelTree() const { return nullptr; } // not supported protected: /// \ru Записать объект и тип. \en Write the object and type. @@ -977,7 +977,7 @@ private: // --- class MATH_CLASS writer_ex : public writer { - std_unique_ptr m_tree; + std::unique_ptr m_tree; ClusterReference m_catalogRef; protected: /// \ru Конструктор. \en Constructor. @@ -994,10 +994,10 @@ public: public: /// \ru Создать писатель для последовательного буфера. \en Create writer for iobuf_Seq. - static std_unique_ptr CreateWriterEx( std_unique_ptr buf, uint16 om ); + static std::unique_ptr CreateWriterEx( std::unique_ptr buf, uint16 om ); /// \ru Создать писатель для буфера в памяти. \en Create writer for membuf. - static std_unique_ptr CreateMemWriterEx( membuf & sb, uint8 om ); + static std::unique_ptr CreateMemWriterEx( membuf & sb, uint8 om ); public: /// \ru Записать дерево модели. \en Write the model tree. @@ -1035,7 +1035,7 @@ private: // --- class MATH_CLASS rw : public writer, public reader { public: - typedef std_unique_ptr rw_ptr; + typedef std::unique_ptr rw_ptr; public: /// \ru Конструктор. \en Constructor. \~ \deprecated \ru Метод устарел. \en The method is deprecated. DEPRECATE_DECLARE rw( membuf & sb, uint8 om ); @@ -1124,7 +1124,7 @@ struct TapeClassContainer static bool Add( TapeClass & tapeClass ) { if ( !StaticTapeClassContainer() ) - StaticTapeClassContainer() = new SFDPArray( 430, 1, TapeClass_Compare, c3d_null ); // \ru не владеет \en doesn't own + StaticTapeClassContainer() = new SFDPArray( 430, 1, TapeClass_Compare, nullptr ); // \ru не владеет \en doesn't own return StaticTapeClassContainer()->AddExact( tapeClass ); } @@ -1982,7 +1982,7 @@ inline uint16 hash( const char * name ) // --- inline reader & __readChar( reader & ps, char *& s ) { - s = c3d_null; + s = nullptr; if ( ps.good() ) { @@ -1994,7 +1994,7 @@ inline reader & __readChar( reader & ps, char *& s ) (len > 0 && ps.eof()) || !ps.good() ) { - s = c3d_null; + s = nullptr; } else // good { @@ -2010,7 +2010,7 @@ inline reader & __readChar( reader & ps, char *& s ) { // \ru прочли не все, скорее всего ошибка - очистить строку \en not everything has been read, must be an error - clear the string delete [] s; - s = c3d_null; + s = nullptr; } } else @@ -2030,7 +2030,7 @@ inline reader & __readChar( reader & ps, char *& s ) // --- inline reader & __readWchar( reader & ps, TCHAR * & s ) { - s = c3d_null; // \ru на случай, если ничего не прочитаем \en for case if nothing will be read + s = nullptr; // \ru на случай, если ничего не прочитаем \en for case if nothing will be read if ( ps.good() ) { uint32 len = 0; @@ -2048,7 +2048,7 @@ inline reader & __readWchar( reader & ps, TCHAR * & s ) else { // \ru прочли не все, скорее всего ошибка - очистить строку \en not everything has been read, must be an error - clear the string delete [] readBuf; - readBuf = c3d_null; + readBuf = nullptr; } if ( readBuf ) { // is OK @@ -2085,7 +2085,7 @@ inline reader & __readWchar( reader & ps, TCHAR * & s ) // --- inline reader & __readWcharT( reader & ps, wchar_t * & s ) { - s = c3d_null; // \ru на случай, если ничего не прочитаем \en for case if nothing will be read + s = nullptr; // \ru на случай, если ничего не прочитаем \en for case if nothing will be read if ( ps.good() ) { uint32 len = 0; @@ -2103,7 +2103,7 @@ inline reader & __readWcharT( reader & ps, wchar_t * & s ) else { // \ru прочли не все, скорее всего ошибка - очистить строку \en not everything has been read, must be an error - clear the string delete [] readBuf; - readBuf = c3d_null; + readBuf = nullptr; } if ( readBuf ) { // is OK @@ -2489,6 +2489,7 @@ inline reader & operator >> ( reader & ps, unsigned short & sh ) } //#ifdef __MOBILE_VERSION__ +#ifndef __ATS_BUILD__ // Нужно для сборки решения Tools\ATS... //---------------------------------------------------------------------------------------- /// \ru Чтение wchar_t в поток. \en Reading wchar_t to the stream. \~ \ingroup Base_Tools_IO // --- @@ -2504,6 +2505,7 @@ inline reader & operator >> ( reader & ps, wchar_t & sh ) return ps; } +#endif // __ATS_BUILD__ //#endif // __MOBILE_VERSION__ @@ -2556,7 +2558,7 @@ inline reader & operator >> ( reader & ps, long double & l ) { template inline reader & operator >> ( reader & ps, SPtr<_Class> & sPtr ) { - _Class * ptr = c3d_null; + _Class * ptr = nullptr; ps >> ptr; sPtr.assign( ptr ); return ps; @@ -2623,6 +2625,7 @@ inline writer& operator << ( writer& ps, unsigned short sh ) } //#ifdef __MOBILE_VERSION__ +#ifndef __ATS_BUILD__ // Нужно для сборки решения Tools\ATS... //---------------------------------------------------------------------------------------- /// \ru Запись wchar_t в поток. \en Write wchar_t to the stream. \~ \ingroup Base_Tools_IO // --- @@ -2632,6 +2635,7 @@ inline writer & operator << ( writer & ps, wchar_t sh ) ps.writeBytes( &sh, size ); return ps; } +#endif // __ATS_BUILD__ //#endif // __MOBILE_VERSION__ @@ -2691,7 +2695,7 @@ inline void ReadTCHAR( reader & in, TCHAR *& ts, bool directSingleByte = false ) if ( directSingleByte || in.MathVersion() < UNICODE_VERSION ) { // \ru читаем WCHAR* из CHAR* \en read WCHAR* from CHAR* - char * s = c3d_null; + char * s = nullptr; __readChar( in, s ); // \ru читаем строку в формате ANSI \en read string in ANSI format ts = _strNtcs( s ); // \ru создаем TCHAR из ANSI (если TCHAR == char, то просто дублируем) \en create TCHAR from ANSI (if TCHAR == char, then simply duplicate) delete [] s; @@ -2965,7 +2969,6 @@ inline size_t ReadCOUNT ( void * in, VERSION version ) MATH_FUNC (ClassDescriptor) GetPackedClassName( const ClassDescriptor &, const VersionContainer & ver ); -#ifdef C3D_STANDARD_CXX_11_PARTIAL //---------------------------------------------------------------------------------------- /** Добавить новое соответствие значения хэша записанного в поток упакованному имени класса @@ -2977,7 +2980,6 @@ MATH_FUNC (ClassDescriptor) GetPackedClassName( const ClassDescriptor &, const V */ // --- MATH_FUNC (void) AddPackedClassNameForVersion( const ClassDescriptor & newClassName, const ClassDescriptor & oldClassName, uint appIndex, VERSION lowVersion, VERSION highVersion ); -#endif // C3D_STANDARD_CXX_11_PARTIAL //---------------------------------------------------------------------------------------- @@ -3097,7 +3099,7 @@ inline reader & operator >> ( reader & ps, std::string & s ) { if ( ps.MathVersion() < UNICODE_VERSION ) { - char * str( c3d_null ); + char * str( nullptr ); __readChar( ps, str ); // \ru читаем строку в формате ANSI \en read string in ANSI format if ( str ) s = str; @@ -3105,7 +3107,7 @@ inline reader & operator >> ( reader & ps, std::string & s ) s.clear(); delete [] str; } else { - wchar_t * p (c3d_null); + wchar_t * p (nullptr); ReadWcharT( ps, p ); // \ru в зависимости от версии потока \en subject to the stream version if ( p ) { char* str = wcsnewmbs(p); @@ -3148,7 +3150,7 @@ inline reader & operator >> ( reader & ps, std::wstring & s ) { if ( ps.MathVersion() < UNICODE_VERSION ) { - char * str( c3d_null ); + char * str( nullptr ); __readChar( ps, str ); // \ru читаем строку в формате ANSI \en read string in ANSI format wchar_t* p = mbsnewwcs( str ); if ( p ) @@ -3158,7 +3160,7 @@ inline reader & operator >> ( reader & ps, std::wstring & s ) delete [] p; delete [] str; } else { - wchar_t * p = c3d_null; + wchar_t * p = nullptr; ReadWcharT( ps, p ); // \ru в зависимости от версии потока \en subject to the stream version if ( p ) s = p; @@ -3175,7 +3177,7 @@ inline reader & operator >> ( reader & ps, std::wstring & s ) //--- inline writer & operator << ( writer & ps, const std::wstring * s ) { - WriteWcharT( ps, (s ? s->c_str() : c3d_null) ); // \ru в зависимости от версии потока \en subject to the stream version + WriteWcharT( ps, (s ? s->c_str() : nullptr) ); // \ru в зависимости от версии потока \en subject to the stream version return ps; } diff --git a/C3d/Include/io_tree.h b/C3d/Include/io_tree.h index e2967e3..33eab58 100644 --- a/C3d/Include/io_tree.h +++ b/C3d/Include/io_tree.h @@ -153,7 +153,7 @@ protected: public: - IModelTree() : m_type ( mtt_Model ), m_nodeToAddFunc( c3d_null ), m_filterFunc( c3d_null ) {} + IModelTree() : m_type ( mtt_Model ), m_nodeToAddFunc( nullptr ), m_filterFunc( nullptr ) {} virtual ~IModelTree() {} // \ru Выдать тип дерева. \en Get the tree type. @@ -163,14 +163,14 @@ public: // \ru Построить дерево из узлов, выбранных по фильтрам. В случае дерева исполнений, функция работает с первым исполнением. // \en Build a tree with nodes, selected by filters. In case of embodiment tree, the function works with the first embodiment. - virtual std_unique_ptr GetFilteredTree ( const std::vector& filters ) const = 0; + virtual std::unique_ptr GetFilteredTree ( const std::vector& filters ) const = 0; - // \ru Построить дерево по заданным узлам. Не применимо к дереву исполнений (в этом случае возвращает c3d_null). - // \en Build a tree for given nodes. Not applicable to embodiment tree (in this case, returns c3d_null). - virtual std_unique_ptr GetFilteredTree ( std::vector& nodes ) const = 0; + // \ru Построить дерево по заданным узлам. Не применимо к дереву исполнений (в этом случае возвращает nullptr). + // \en Build a tree for given nodes. Not applicable to embodiment tree (in this case, returns nullptr). + virtual std::unique_ptr GetFilteredTree ( std::vector& nodes ) const = 0; - // \ru Выдать указатель на дерево исполнений. Выдает c3d_null, если не применимо (нет исполнений). - // \en Get pointer to embodiments tree. Return c3d_null if not applicable (no embodiments). + // \ru Выдать указатель на дерево исполнений. Выдает nullptr, если не применимо (нет исполнений). + // \en Get pointer to embodiments tree. Return nullptr if not applicable (no embodiments). virtual const IEmbodimentTree* GetEmbodimentsTree() const = 0; // \ru Добавить узел. \en Add a node. @@ -209,7 +209,7 @@ public: // \ru Построить поддерево из потомков заданного узла. // \en Build a tree from children of a given node. - static std_unique_ptr GetSubtree ( const IModelTreeNode* node ); + static std::unique_ptr GetSubtree ( const IModelTreeNode* node ); // \ru Получить значимые узлы поддерева с указанным корнем (исключив узлы, которые добавлены для восстановления иерархии дерева). // Возвращает количество значимых узлов. @@ -244,12 +244,12 @@ public: IEmbodimentNode() {} virtual ~IEmbodimentNode() { for ( std::set::iterator i = m_children.begin(); i != m_children.end(); ++i ) - if ( *i != c3d_null ) delete *i; + if ( *i != nullptr ) delete *i; } // \ru Построить поддерево модели, содержащееся в данном исполнении. // \en Build a subtree of a model tree which is contained in a given embodiment. - virtual std_unique_ptr GetEmbodiment() const = 0; + virtual std::unique_ptr GetEmbodiment() const = 0; // \ru Выдать узел дерева модели, соответствующий данному исполнению. // \en Get a model tree node which corresponds to a given embodiment. diff --git a/C3d/Include/item_registrator.h b/C3d/Include/item_registrator.h index fa1260b..6f1c06b 100644 --- a/C3d/Include/item_registrator.h +++ b/C3d/Include/item_registrator.h @@ -29,10 +29,10 @@ class MATH_CLASS MbRefItem; */ // --- #define __REG_DUPLICATE_IMPL( __CLASS ) \ -MbRefItem * copyItem = c3d_null; \ -if ( iReg == c3d_null || !iReg->IsReg( this, copyItem ) ) { \ +MbRefItem * copyItem = nullptr; \ +if ( iReg == nullptr || !iReg->IsReg( this, copyItem ) ) { \ copyItem = new __CLASS; \ - if ( iReg != c3d_null ) \ + if ( iReg != nullptr ) \ iReg->SetReg( this, copyItem ); \ } diff --git a/C3d/Include/legend.h b/C3d/Include/legend.h index 136f13a..e173802 100644 --- a/C3d/Include/legend.h +++ b/C3d/Include/legend.h @@ -38,10 +38,10 @@ public: /* \ru Общие функции геометрического объе virtual MbeSpaceType IsA() const = 0; // \ru Тип объекта. \en Type of the object. virtual MbeSpaceType Type() const = 0; // \ru Тип объекта. \en Type of the object. virtual MbeSpaceType Family() const; // \ru Семейство элемента. \en Family of the element. - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const = 0; // \ru Создать копию. \en Create a copy. - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ) = 0; // \ru Преобразовать согласно матрице. \en Transform according to the matrix. - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ) = 0; // \ru Сдвинуть вдоль вектора. \en Translate along a vector. - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ) = 0; // \ru Повернуть вокруг оси. \en Rotate around an axis. + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const = 0; // \ru Создать копию. \en Create a copy. + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ) = 0; // \ru Преобразовать согласно матрице. \en Transform according to the matrix. + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ) = 0; // \ru Сдвинуть вдоль вектора. \en Translate along a vector. + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ) = 0; // \ru Повернуть вокруг оси. \en Rotate around an axis. virtual bool IsSame ( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const = 0; // \ru Являются ли объекты равными? \en Determine whether the objects are equal. virtual bool IsSimilar( const MbSpaceItem & init ) const = 0; // \ru Являются ли объекты подобными? \en Determine whether the objects are similar. virtual bool SetEqual ( const MbSpaceItem & init ) = 0; // \ru Сделать объекты равным. \en Make the objects equal. diff --git a/C3d/Include/lump.h b/C3d/Include/lump.h index a803bc2..b6e06bd 100644 --- a/C3d/Include/lump.h +++ b/C3d/Include/lump.h @@ -67,7 +67,7 @@ typedef std::pair ConstLumpsSPtrSetRet; // --- struct MATH_CLASS MbLump: public MbRefItem { protected: - c3d::ConstSolidSPtr solid; ///< \ru Тело (всегда не c3d_null). \en Solid (always not c3d_null). + c3d::ConstSolidSPtr solid; ///< \ru Тело (всегда не nullptr). \en Solid (always not nullptr). MbMatrix3D from; ///< \ru Матрица преобразования из локальной системы координат. \en A transformation matrix from the local coordinate system. uint component; ///< \ru Идентификатор компонента, в котором определено тело. \en An identifier of a component which a solid is defined in. size_t identifier; ///< \ru Идентификатор нити. \en A thread identifier. @@ -79,7 +79,7 @@ private: MbLump( const MbLump & other, MbRegDuplicate * iReg ); public: /// \ru Пустой конструктор. \en Empty constructor. - MbLump() : solid( c3d_null ), from(), component( 0 ), identifier( SYS_MAX_T ), changed( true ) {} + MbLump() : solid( nullptr ), from(), component( 0 ), identifier( SYS_MAX_T ), changed( true ) {} /// \ru Конструктор по данным. \en Constructor by data. MbLump( const MbSolid & _solid, const MbMatrix3D & _from, uint _comp = 0, size_t _ident = SYS_MAX_T, bool _changed = true ); /// \ru Деструктор. \en Destructor. @@ -96,7 +96,7 @@ public: /// \ru Разрезать тело в производном виде. \en Cut solid on derive view. virtual bool WillCutOnDeriveView() const { return true; } /// \ru Дублирование объекта. \en Duplication of an object. - virtual MbLump & Duplicate( MbRegDuplicate * iReg = c3d_null ) const; + virtual MbLump & Duplicate( MbRegDuplicate * iReg = nullptr ) const; /// \ru Получить имя компонента. \en Get the name of a component. uint GetComponent() const { return component; } /// \ru Установить имя компонента. \en Set the name of a component. diff --git a/C3d/Include/map_create.h b/C3d/Include/map_create.h index af3547d..f591436 100644 --- a/C3d/Include/map_create.h +++ b/C3d/Include/map_create.h @@ -64,11 +64,11 @@ class MATH_CLASS MbMapBodiesPArray; class MATH_CLASS MbProjectionsObjects { public: - TPointer< RPArray > annCurves; ///< \ru Аннотационные кривые (может быть нулем). \en Annotation curves (can be c3d_null). - TPointer< RPArray > annotations; ///< \ru Аннотационные объекты (может быть нулем). \en Annotation objects (can be c3d_null). - TPointer< RPArray > symbolObjects; ///< \ru Условные обозначения (может быть нулем). \en Conventional notations (can be c3d_null). - TPointer< RPArray > pointsData; ///< \ru Пространственные точки (может быть нулем). \en Spatial points (can be c3d_null). - TPointer< RPArray > curvesData; ///< \ru Пространственные кривые (может быть нулем). \en Spatial curves (can be c3d_null). + TPointer< RPArray > annCurves; ///< \ru Аннотационные кривые (может быть нулем). \en Annotation curves (can be nullptr). + TPointer< RPArray > annotations; ///< \ru Аннотационные объекты (может быть нулем). \en Annotation objects (can be nullptr). + TPointer< RPArray > symbolObjects; ///< \ru Условные обозначения (может быть нулем). \en Conventional notations (can be nullptr). + TPointer< RPArray > pointsData; ///< \ru Пространственные точки (может быть нулем). \en Spatial points (can be nullptr). + TPointer< RPArray > curvesData; ///< \ru Пространственные кривые (может быть нулем). \en Spatial curves (can be nullptr). public: /** \brief \ru Конструктор. @@ -78,11 +78,11 @@ public: \en Constructor of empty sets of projected objects.\n \~ */ MbProjectionsObjects() - : annCurves ( c3d_null ) - , annotations ( c3d_null ) - , symbolObjects( c3d_null ) - , pointsData ( c3d_null ) - , curvesData ( c3d_null ) + : annCurves ( nullptr ) + , annotations ( nullptr ) + , symbolObjects( nullptr ) + , pointsData ( nullptr ) + , curvesData ( nullptr ) {} /// \ru Конструктор копирования с регистратором. \en Copy-constructor with the registrator. MbProjectionsObjects( const MbProjectionsObjects & other, MbRegDuplicate * iReg ); @@ -104,7 +104,7 @@ public: } /// \ru Дать копию объекта. \en Get a copy of the object. - virtual MbProjectionsObjects & Duplicate( MbRegDuplicate * iReg = c3d_null ) const; + virtual MbProjectionsObjects & Duplicate( MbRegDuplicate * iReg = nullptr ) const; /// \ru Отпустить все указатели. \en Detach all pointers. void Relinquish() @@ -173,9 +173,9 @@ public: size_t GetLumpsCount() const { return lumps.size(); } const MbLump * _GetLump( size_t k ) const { return lumps[k]; } - const MbLump * GetLump( size_t k ) const { return ((k < lumps.size()) ? lumps[k] : c3d_null); } + const MbLump * GetLump( size_t k ) const { return ((k < lumps.size()) ? lumps[k] : nullptr); } MbLump * _SetLump( size_t k ) { return lumps[k]; } - MbLump * SetLump( size_t k ) { return ((k < lumps.size()) ? lumps[k] : c3d_null); } + MbLump * SetLump( size_t k ) { return ((k < lumps.size()) ? lumps[k] : nullptr); } template void GetLumps( Lumps & _lumps ) const @@ -282,7 +282,7 @@ MATH_FUNC (MbResultType) GetVestiges ( const MbPlacement3D & place, const MbMapVisibilityMode & visMode, VERSION version = Math::DefaultMathVersion(), bool merge = true, - const std::vector * prevCubes = c3d_null ); + const std::vector * prevCubes = nullptr ); //------------------------------------------------------------------------------ @@ -316,7 +316,7 @@ public: public: MbMapSettings( MbMapVisibilityMode mode, MbPlacement3D place = MbPlacement3D::global, - double znear = 0, bool merge = true, const LumpCubes * prevCubes = c3d_null ) + double znear = 0, bool merge = true, const LumpCubes * prevCubes = nullptr ) : m_place ( place ) , m_zNear ( znear ) , m_visMode ( mode ) diff --git a/C3d/Include/map_implementation.h b/C3d/Include/map_implementation.h index fbb0280..436190c 100644 --- a/C3d/Include/map_implementation.h +++ b/C3d/Include/map_implementation.h @@ -109,7 +109,7 @@ public: void CreateFirst( const RPArray & lumps, const MbMatrix3D & into, double znear, bool perspective, const MbMapVisibilityMode & visMode, VERSION version, - const std::vector * prevCubes = c3d_null ); + const std::vector * prevCubes = nullptr ); /** \brief \ru Построение ассоциативных проекций. \en The construction of associative projections. \~ diff --git a/C3d/Include/map_lump.h b/C3d/Include/map_lump.h index 89e83e8..0a4a6b0 100644 --- a/C3d/Include/map_lump.h +++ b/C3d/Include/map_lump.h @@ -138,7 +138,7 @@ public: /// \ru Деструктор. \en Destructor. virtual ~CurveWType() {} /// \ru Сделать копию объекта. \en Create a copy of the object. - virtual CurveWType & Duplicate( MbRegDuplicate * iReg = c3d_null ) const; + virtual CurveWType & Duplicate( MbRegDuplicate * iReg = nullptr ) const; public: @@ -229,7 +229,7 @@ public: explicit MbAnnCurves( const MbName & _name, uint _comp, size_t _ident ) : component ( _comp ) , identifier( _ident ) - , solid ( c3d_null ) + , solid ( nullptr ) , name ( &_name ) , from ( ) , wtCurves ( 0, 1, true ) @@ -245,7 +245,7 @@ public: public: /// \ru Дать копию объекта. \en Get a copy of the object. - virtual MbAnnCurves & Duplicate( MbRegDuplicate * iReg = c3d_null ) const; + virtual MbAnnCurves & Duplicate( MbRegDuplicate * iReg = nullptr ) const; /// \ru Получить имя компонента. \en Get the component name. uint GetComponent() const { return component; } @@ -265,12 +265,12 @@ public: \param[in, out] wtCurve - \ru Кривая. \en A curve. \~ */ - void AbsorbCurve( CurveWType *& wtCurve ) { wtCurves.Add( wtCurve ); wtCurve = c3d_null; } + void AbsorbCurve( CurveWType *& wtCurve ) { wtCurves.Add( wtCurve ); wtCurve = nullptr; } /// \ru Количество кривых в наборе. \en The number of curves in the set. size_t GetCurvesCount() const { return wtCurves.Count(); } /// \ru Получить указатель на кривую. \en Get the pointer to the curve. - const CurveWType * GetCurve( size_t k ) const { return ((k < wtCurves.Count()) ? wtCurves[k] : c3d_null); } + const CurveWType * GetCurve( size_t k ) const { return ((k < wtCurves.Count()) ? wtCurves[k] : nullptr); } private: DECLARE_PERSISTENT_CLASS_NEW_DEL ( MbAnnCurves ) @@ -317,7 +317,7 @@ public : public: /// \ru Дать копию объекта. \en Get a copy of the object. - virtual MbSimbolthThreadView & Duplicate( MbRegDuplicate * iReg = c3d_null ) const; + virtual MbSimbolthThreadView & Duplicate( MbRegDuplicate * iReg = nullptr ) const; public : /// \ru Получить аннотационные кривые для редактирования. \en Get annotative curves for editing. @@ -508,7 +508,7 @@ public: public: /// \ru Дать копию объекта. \en Get a copy of the object. - virtual MbSpacePoints & Duplicate( MbRegDuplicate * iReg = c3d_null ) const; + virtual MbSpacePoints & Duplicate( MbRegDuplicate * iReg = nullptr ) const; public: @@ -587,9 +587,7 @@ public: Free the unnecessary memory in arrays of points and names. \~ */ void AdjustMemory() { - #ifdef C3D_STANDARD_CXX_11_PARTIAL points.shrink_to_fit(); names.shrink_to_fit(); - #endif } /** \} */ @@ -659,16 +657,16 @@ public: \en Get the name. \~ \details \ru Получить имя по индексу.\n Если индекс некорректный, то есть не меньше числа точек, - вернет c3d_null. + вернет nullptr. \en Get the name by an index.\n If the index is incorrect i.e. it isn't less than the number of points, - c3d_null is returned. \~ + nullptr is returned. \~ \param[in] k - \ru Индекс имени. \en A name index. \~ \return \ru Имя по индексу из набора имен. \en A name by an index from the set of names. \~ */ - const MbName * GetName( size_t k ) const { return ((k < names.size()) ? names[k] : c3d_null); } + const MbName * GetName( size_t k ) const { return ((k < names.size()) ? names[k] : nullptr); } /** \} */ DECLARE_PERSISTENT_CLASS_NEW_DEL ( MbSpacePoints ) @@ -786,7 +784,7 @@ private: public: /// \ru Дать копию объекта. \en Get a copy of the object. - virtual MbSpaceCurves & Duplicate( MbRegDuplicate * iReg = c3d_null ) const; + virtual MbSpaceCurves & Duplicate( MbRegDuplicate * iReg = nullptr ) const; public: /** \} */ @@ -877,9 +875,7 @@ public: Frees the unnecessary memory in arrays of points and names. \~ */ void AdjustMemory() { - #ifdef C3D_STANDARD_CXX_11_PARTIAL curves.shrink_to_fit(); names.shrink_to_fit(); - #endif } /** \} */ @@ -908,11 +904,11 @@ public: \param[in] k - \ru Индекс кривой. \en A curve index. \~ \return \ru Указатель на кривую, если индекс меньше количества кривых,\n - иначе c3d_null. + иначе nullptr. \en A pointer to a curve, if the index is less than the number of curves,\n - otherwise c3d_null is returned. \~ + otherwise nullptr is returned. \~ */ - const MbCurve3D * GetCurve( size_t k ) const { return ((k < curves.size()) ? curves[k] : c3d_null); } + const MbCurve3D * GetCurve( size_t k ) const { return ((k < curves.size()) ? curves[k] : nullptr); } /** \} */ /**\ru \name Доступ к именам. @@ -940,11 +936,11 @@ public: \param[in] k - \ru Индекс имени. \en A name index. \~ \return \ru Указатель на имя, если индекс меньше количества имен,\n - иначе c3d_null. + иначе nullptr. \en A pointer to a name, if the index is less than the number of curves, - otherwise c3d_null is returned. \~ + otherwise nullptr is returned. \~ */ - const MbName * GetName( size_t k ) const { return ((k < names.size()) ? names[k] : c3d_null); } ///< \ru Получить имя. \en Get the name. + const MbName * GetName( size_t k ) const { return ((k < names.size()) ? names[k] : nullptr); } ///< \ru Получить имя. \en Get the name. /** \} */ DECLARE_PERSISTENT_CLASS_NEW_DEL ( MbSpaceCurves ) @@ -958,7 +954,7 @@ IMPL_PERSISTENT_OPS( MbSpaceCurves ) inline void MbSpaceCurves::AddNamedCurve( MbCurve3D * crv, MbName * nm, bool noSameCheck ) { - if ( crv != c3d_null && (noSameCheck || curves.FindIt( crv ) == SYS_MAX_T ) ) { + if ( crv != nullptr && (noSameCheck || curves.FindIt( crv ) == SYS_MAX_T ) ) { curves.push_back( crv ); crv->AddRef(); names.push_back( nm ); @@ -1111,7 +1107,7 @@ public: */ MbMappingLumps( const MbSolid & _solid, const MbMatrix3D & _from, bool _willCut, uint _comp = 0, size_t _ident = SYS_MAX_T ) : MbCutLump ( _solid, _from, _comp, _ident ) - , lumps ( c3d_null ) + , lumps ( nullptr ) , willCut ( _willCut ) { } @@ -1121,13 +1117,13 @@ public: \details \ru Конструктор по набору тел.\n Захватывает тело MbSolid из первого элемента _lumps и остальные элементы _lumps методом AddRef().\n - Если в _lumps один элемент, массив lumps остается c3d_null.\n - Если в _lumps нет элементов, тело MbSolid в базовом объекте = c3d_null. Таких объектов быть не должно. + Если в _lumps один элемент, массив lumps остается nullptr.\n + Если в _lumps нет элементов, тело MbSolid в базовом объекте = nullptr. Таких объектов быть не должно. \en Constructor by a set of solids.\n Captures MbSolid solid from the first element of the _lumps and the other elements of the _lumps by AddRef() method.\n - If the _lumps contains one element the lumps array remains c3d_null.\n - If the _lumps doesn't contain any elements the MbSolid solid in the base object = c3d_null. These objects should not be. \~ + If the _lumps contains one element the lumps array remains nullptr.\n + If the _lumps doesn't contain any elements the MbSolid solid in the base object = nullptr. These objects should not be. \~ \param[in] _lumps - \ru Контейнер тел с матрицами преобразования в глобальную систему координат,. не должен быть пустым контейнером. \en A container of solids with the matrices of transformation to the global coordinate system @@ -1136,13 +1132,13 @@ public: template MbMappingLumps( const LumpsVector & _lumps ) : MbCutLump() - , lumps( c3d_null ) + , lumps( nullptr ) , willCut( false ) // конструктор по нескольким телам только в случае "не рассекать" { size_t count = _lumps.size(); - C3D_ASSERT( count > 0 && _lumps[0] != c3d_null ); + C3D_ASSERT( count > 0 && _lumps[0] != nullptr ); - if ( count > 0 && _lumps[0] != c3d_null ) { + if ( count > 0 && _lumps[0] != nullptr ) { from = _lumps[0]->GetMatrixFrom(); component = _lumps[0]->GetComponent(); identifier = _lumps[0]->GetIdentifier(); @@ -1154,7 +1150,7 @@ public: lumps = new c3d::LumpsSPtrVector(); for ( size_t i = 1; i < count; ++i ) { MbLump * lump = _lumps[i]; - if ( lump != c3d_null ) + if ( lump != nullptr ) lumps->push_back( c3d::LumpSPtr(lump) ); } } @@ -1167,19 +1163,19 @@ public: /** \brief \ru Число тел. \en The number of solids. \~ \details \ru Число тел.\n - Минимальное количество - 1 тело. В этом случае массив lumps = c3d_null. - В случае, если массив lumps != c3d_null, количество тел равно количеству + Минимальное количество - 1 тело. В этом случае массив lumps = nullptr. + В случае, если массив lumps != nullptr, количество тел равно количеству элементов в массиве плюс один. \en The number of solids.\n - Minimal number = 1 solid. In this case the lumps array is c3d_null. - In a case when the lumps array isn't c3d_null the number of solids is equal to + Minimal number = 1 solid. In this case the lumps array is nullptr. + In a case when the lumps array isn't nullptr the number of solids is equal to the number of elements in the array plus one. \~ \return \ru Число тел. \en The number of solids. \~ */ size_t Count() const { size_t res = 1; - if ( lumps != c3d_null ) + if ( lumps != nullptr ) res += lumps->size(); return res; } @@ -1190,21 +1186,21 @@ public: По индексу 0 выдается базовый объект.\n По индексу i выдается объект из массива lumps с индексом i-1.\n Индекс проверяется на корректность. - В случае некорректного индекса возвращает c3d_null. + В случае некорректного индекса возвращает nullptr. \en A solid by an index.\n The basic object is given by the "0" index.\n An object with the index i - 1 from the lumps array is issued by the index i.\n An index is validated for correctness. - In a case of an incorrect index the method returns c3d_null. \~ + In a case of an incorrect index the method returns nullptr. \~ \return \ru Указатель на тело с матрицей. \en A pointer to a solid with a matrix. \~ */ MbLump * operator []( size_t ind ) { if ( ind == 0 ) return static_cast( this ); - else if ( lumps != c3d_null && ind - 1 < lumps->size() ) + else if ( lumps != nullptr && ind - 1 < lumps->size() ) return lumps->operator []( ind - 1 ); - return c3d_null; + return nullptr; } /** \brief \ru Тело по индексу. @@ -1213,12 +1209,12 @@ public: По индексу 0 выдается базовый объект.\n По индексу i выдается объект из массива lumps с индексом i-1.\n Индекс проверяется на корректность. - В случае некорректного индекса возвращает c3d_null. + В случае некорректного индекса возвращает nullptr. \en A solid by an index.\n The basic object is given by the "0" index.\n An object with the index i - 1 from the lumps array is issued by the index i.\n An index is validated for correctness. - In a case of an incorrect index the method returns c3d_null. \~ + In a case of an incorrect index the method returns nullptr. \~ \return \ru Константный указатель на тело с матрицей. \en A constant pointer to a solid with a matrix. \~ */ @@ -1226,9 +1222,9 @@ public: { if ( ind == 0 ) return static_cast( this ); - else if ( lumps != c3d_null && ind - 1 < lumps->size() ) + else if ( lumps != nullptr && ind - 1 < lumps->size() ) return lumps->operator []( ind - 1 ); - return c3d_null; + return nullptr; } void ChangeLump( size_t ind, MbLump * newLump ) @@ -1239,7 +1235,7 @@ public: component = newLump->GetComponent(); identifier = newLump->GetIdentifier(); } - else if ( lumps != c3d_null && ind - 1 < lumps->size() ) { + else if ( lumps != nullptr && ind - 1 < lumps->size() ) { (*lumps)[ind - 1] = newLump; } } @@ -1323,7 +1319,7 @@ public: } /// \ru Деструктор. \en Destructor. ~MbPolygon3DSolid() { - if ( polygon != c3d_null ) + if ( polygon != nullptr ) delete polygon; } @@ -1332,7 +1328,7 @@ public: /// \ru Получить имя компонента. \en Get the name of a component. uint GetComponent() const { return component; } /// \ru Занулить полигон без удаления. \en Reset polygon without removal. - void DoNotDeletePolyg() { polygon = c3d_null; } + void DoNotDeletePolyg() { polygon = nullptr; } OBVIOUS_PRIVATE_COPY( MbPolygon3DSolid ) }; diff --git a/C3d/Include/map_section.h b/C3d/Include/map_section.h index f7dffe2..8fc7806 100644 --- a/C3d/Include/map_section.h +++ b/C3d/Include/map_section.h @@ -87,7 +87,7 @@ public: \en Clear the array of contours if it isn't null. \~ */ void DetachContours() { - if ( arContours != c3d_null ) + if ( arContours != nullptr ) arContours->Flush( noDelete ); } @@ -142,10 +142,10 @@ public: /** \brief \ru Добавить оболочку. \en Add a shell. \~ \details \ru Добавить оболочку в набор оболочек.\n - Добавляется, даже если равна c3d_null.\n + Добавляется, даже если равна nullptr.\n Если не нулевая - захватывается. \en Add a shell into the set of shells.\n - A shell is added even if it is equal to c3d_null.\n + A shell is added even if it is equal to nullptr.\n If a shell isn't null it is captured. \~ \param[in] secShell - \ru Оболочка. \en A shell. \~ @@ -331,7 +331,7 @@ public: \return \ru true, если массив точек не нулевой и не пустой. \en returns true if the array of points isn't null and isn't empty. \~ */ - bool IsSpacePoints() const { return (pointsData != c3d_null && pointsData->size() > 0); } + bool IsSpacePoints() const { return (pointsData != nullptr && pointsData->size() > 0); } /** \brief \ru Есть ли в объекте кривые. \en Whether any curve is in an object. \~ @@ -340,7 +340,7 @@ public: \return \ru true, если массив кривых не нулевой и не пустой. \en returns true if the array of curves isn't null and isn't empty. \~ */ - bool IsSpaceCurves() const { return (curvesData != c3d_null && curvesData->size() > 0); } + bool IsSpaceCurves() const { return (curvesData != nullptr && curvesData->size() > 0); } const RPArray * GetSpacePoints() const { return pointsData; } ///< \ru Получить указатель на пространственные точки. \en Get spatial points. const RPArray * GetSpaceCurves() const { return curvesData; } ///< \ru Получить указатель на пространственные кривые. \en Get spatial curves. diff --git a/C3d/Include/map_vestige.h b/C3d/Include/map_vestige.h index e05ce3b..bd6a1a6 100644 --- a/C3d/Include/map_vestige.h +++ b/C3d/Include/map_vestige.h @@ -154,7 +154,7 @@ protected: , ident ( otherIdent ) , style ( SYS_MAX_UINT16 ) , attrData ( ) - , item ( c3d_null ) + , item ( nullptr ) , name ( &otherName ) { name.SetOwn( false ); } /// \ru Конструктор копирования с регистратором. \en Copy-constructor with the registrator. @@ -164,13 +164,13 @@ protected: : comp ( 0 ) , ident ( SYS_MAX_T ) , style ( SYS_MAX_UINT16 ) - , item ( c3d_null ) - , name ( c3d_null ) + , item ( nullptr ) + , name ( nullptr ) { name.SetOwn(false); } virtual ~MbBaseVestige() {} public: - virtual MbBaseVestige & Duplicate( MbRegDuplicate * iReg = c3d_null ) const; ///< \ru Создать копию объекта. \en Create a copy of the object. + virtual MbBaseVestige & Duplicate( MbRegDuplicate * iReg = nullptr ) const; ///< \ru Создать копию объекта. \en Create a copy of the object. public: uint GetComponent() const { return comp; } size_t GetIdentifier() const { return ident; } @@ -268,7 +268,7 @@ protected: {} public: /// \ru Создать копию объекта. \en Create a copy of the object. - virtual MbBaseVestige & Duplicate( MbRegDuplicate * iReg = c3d_null ) const; + virtual MbBaseVestige & Duplicate( MbRegDuplicate * iReg = nullptr ) const; public: /// \ru Тип отображения. \en Mapping type. Type GetType() const { return (Type)vesType; } @@ -304,11 +304,11 @@ void ReplaceCurveVestigeDuplicates( MbCurveVestige & ); // --- struct MATH_CLASS MbCurveVestige : public TapeBase { protected: - SPtr totalPrj; ///< \ru Полная проекция (может быть c3d_null). \en A full projection (can be c3d_null). \~ \internal \ru Владеет. \en Owns. \~ \endinternal + SPtr totalPrj; ///< \ru Полная проекция (может быть nullptr). \en A full projection (can be nullptr). \~ \internal \ru Владеет. \en Owns. \~ \endinternal std::vector arTotal; ///< \ru Все проекции в упорядоченной форме. \en All projections in an ordered form. \~ \internal \ru Не владеет. \en Doesn't own. \~ \endinternal // \ru Двумерные кривые лежат копиями, поэтому массивы владеющие. \en Two-dimensional uv-curves are copies therefore arrays are owners - // \ru Если кривых нет то указатель останется нулевым. \en If no curves then the pointer remains c3d_null. + // \ru Если кривых нет то указатель останется нулевым. \en If no curves then the pointer remains nullptr. TPointer< PArray > arVisPrj; ///< \ru Видимые проекции. \en Visible projections. TPointer< PArray > arHidPrj; ///< \ru Не видимые проекции. \en Invisible projections. @@ -321,10 +321,10 @@ public: Creates an object with the null projection. \~ */ MbCurveVestige() - : totalPrj( c3d_null ) + : totalPrj( nullptr ) , arTotal ( ) - , arVisPrj( c3d_null ) - , arHidPrj( c3d_null ) + , arVisPrj( nullptr ) + , arHidPrj( nullptr ) {} /// \ru Конструктор копирования с регистратором. \en Copy-constructor with the registrator. MbCurveVestige( const MbCurveVestige & other, MbRegDuplicate * iReg ); @@ -332,7 +332,7 @@ public: virtual ~MbCurveVestige() { ClearAll(); } public: /// \ru Создать копию объекта. \en Create a copy of the object. - virtual MbCurveVestige & Duplicate( MbRegDuplicate * iReg = c3d_null ) const; + virtual MbCurveVestige & Duplicate( MbRegDuplicate * iReg = nullptr ) const; public: /** \brief \ru Очистить проекции. @@ -347,14 +347,14 @@ public: void ClearAll() { arTotal.clear(); - totalPrj = c3d_null; - arVisPrj = c3d_null; - arHidPrj = c3d_null; + totalPrj = nullptr; + arVisPrj = nullptr; + arHidPrj = nullptr; } /// \ru Пустое ли отображение кривой? \en Is an empty curve vestige? bool IsEmpty() const { - return ( totalPrj == c3d_null ) && + return ( totalPrj == nullptr ) && ( arTotal.size() < 1 ) && ( !arVisPrj || arVisPrj->empty() ) && ( !arHidPrj || arHidPrj->empty() ); @@ -372,9 +372,9 @@ public: bool IsHiddenCurvesArray () const { return !!arHidPrj; } /// \ru Получить видимую часть проекции. \en Get visible part of projection. - const MbCurve * _GetVisibleCurve( size_t k ) const { return (( !!arVisPrj ) ? (*arVisPrj)[k] : c3d_null); } + const MbCurve * _GetVisibleCurve( size_t k ) const { return (( !!arVisPrj ) ? (*arVisPrj)[k] : nullptr); } /// \ru Получить невидимую часть проекции. \en Get hidden part of projection. - const MbCurve * _GetHiddenCurve ( size_t k ) const { return (( !!arHidPrj ) ? (*arHidPrj)[k] : c3d_null); } + const MbCurve * _GetHiddenCurve ( size_t k ) const { return (( !!arHidPrj ) ? (*arHidPrj)[k] : nullptr); } /// \ru Положить в массив указатели видимых частей проекции. \en Put pointers of visible parts of projection into the array. template @@ -433,7 +433,7 @@ public: bool RepairSpecificCorrespondence( bool uncertainIsVisible ); /// \ru Есть ли указатель на полную проекцию? \en Is there a pointer to the full projection? - bool IsTotalProjection() const { return (totalPrj != c3d_null); } + bool IsTotalProjection() const { return (totalPrj != nullptr); } /// \ru Указатель на полную проекцию. \en The pointer to a full projection. MbCurve * DetachTotalProjection() { return ::DetachItem( totalPrj ); } /// \ru Установить полную проекцию. \en Set a full projection. @@ -466,7 +466,7 @@ const MbCurve * MbCurveVestige::GetFullProjection() const MbCurve * curve = totalPrj; - if ( curve == c3d_null ) { + if ( curve == nullptr ) { if ( !!arVisPrj && (arVisPrj->size() == 1) ) curve = arVisPrj->operator[]( 0 ); else if ( !!arHidPrj && (arHidPrj->size() == 1) ) @@ -480,15 +480,15 @@ const MbCurve * MbCurveVestige::GetFullProjection() const //--- inline MbCurve * MbCurveVestige::_PickupVisibleCurve( size_t k ) { - if ( arVisPrj != c3d_null ) { + if ( arVisPrj != nullptr ) { PArray & crvs = *arVisPrj; MbCurve * crv = crvs[k]; ::AddRefItem( crv ); // захват и отпускание на случай перехода на владение по счетчику ссылок - crvs[k] = c3d_null; + crvs[k] = nullptr; ::DecRefItem( crv ); return crv; } - return c3d_null; + return nullptr; } //------------------------------------------------------------------------------ @@ -496,15 +496,15 @@ inline MbCurve * MbCurveVestige::_PickupVisibleCurve( size_t k ) //--- inline MbCurve * MbCurveVestige::_PickupHiddenCurve( size_t k ) { - if ( arHidPrj != c3d_null ) { + if ( arHidPrj != nullptr ) { PArray & crvs = *arHidPrj; MbCurve * crv = crvs[k]; ::AddRefItem( crv ); // захват и отпускание на случай перехода на владение по счетчику ссылок - crvs[k] = c3d_null; + crvs[k] = nullptr; ::DecRefItem( crv ); return crv; } - return c3d_null; + return nullptr; } //------------------------------------------------------------------------------ @@ -513,11 +513,11 @@ inline MbCurve * MbCurveVestige::_PickupHiddenCurve( size_t k ) inline void MbCurveVestige::DetachAllCurves( PArray *& visCurves, PArray *& hidCurves, SPtr & wholePrj ) { wholePrj = totalPrj; - totalPrj = c3d_null; + totalPrj = nullptr; arTotal.clear(); - visCurves = !!arVisPrj ? arVisPrj.Relinquish() : c3d_null; - hidCurves = !!arHidPrj ? arHidPrj.Relinquish() : c3d_null; + visCurves = !!arVisPrj ? arVisPrj.Relinquish() : nullptr; + hidCurves = !!arHidPrj ? arHidPrj.Relinquish() : nullptr; } //------------------------------------------------------------------------------ @@ -634,7 +634,7 @@ protected: , vesSubType( vst_None ) {} public: - virtual MbBaseVestige & Duplicate( MbRegDuplicate * iReg = c3d_null ) const; + virtual MbBaseVestige & Duplicate( MbRegDuplicate * iReg = nullptr ) const; public: /// \ru Получить тип отображения. \en Get mapping type. Type GetType() const { return (Type)vesType; } @@ -735,7 +735,7 @@ protected: /// \ru Конструктор копирования с регистратором. \en Copy-constructor with the registrator. MbFaceVestige( const MbFaceVestige & other, MbRegDuplicate * iReg ); public: - virtual MbBaseVestige & Duplicate( MbRegDuplicate * iReg = c3d_null ) const; + virtual MbBaseVestige & Duplicate( MbRegDuplicate * iReg = nullptr ) const; public: /// \ru Тип отображения. \en Mapping type. Type GetType() const { return (Type)vesType; } @@ -796,7 +796,7 @@ protected: MbAnnotationEdgeVestige( const MbAnnotationEdgeVestige & other, MbRegDuplicate * iReg ); public: - virtual MbBaseVestige & Duplicate( MbRegDuplicate * iReg = c3d_null ) const; + virtual MbBaseVestige & Duplicate( MbRegDuplicate * iReg = nullptr ) const; public: /// \ru Тип отображения. \en Mapping type. @@ -886,7 +886,7 @@ protected: MbSymbolVestige( uint otherComp, size_t otherIdent, const MbTopologyItem * otherItem, const MbName & otherName, bool _bvisible = true ) : MbBaseVestige( otherComp, otherIdent, otherName, otherItem ) , bvisible( _bvisible ) - , matrix ( c3d_null ) + , matrix ( nullptr ) {} /// \ru Конструктор копирования с регистратором. \en Copy-constructor with the registrator. MbSymbolVestige( const MbSymbolVestige & other, MbRegDuplicate * iReg ); @@ -894,12 +894,12 @@ protected: MbSymbolVestige() : MbBaseVestige() , bvisible( true ) - , matrix ( c3d_null ) + , matrix ( nullptr ) {} public: virtual ~MbSymbolVestige() {} - virtual MbBaseVestige & Duplicate( MbRegDuplicate * iReg = c3d_null ) const; + virtual MbBaseVestige & Duplicate( MbRegDuplicate * iReg = nullptr ) const; public: /// \ru Это видимая точка? \en Is point visible? @@ -924,8 +924,8 @@ IMPL_PERSISTENT_OPS( MbSymbolVestige ) // --- inline void MbSymbolVestige::SetMatrix( const MbMatrix & initMatrix ) { - C3D_ASSERT( matrix == c3d_null ); - if ( matrix == c3d_null ) + C3D_ASSERT( matrix == nullptr ); + if ( matrix == nullptr ) matrix = new MbMatrix( initMatrix ); else *matrix = initMatrix; @@ -970,7 +970,7 @@ public: public: /// \ru Создать копию объекта. \en Create a copy of the object. - virtual MbVEFVestiges & Duplicate( MbRegDuplicate * iReg = c3d_null ) const; + virtual MbVEFVestiges & Duplicate( MbRegDuplicate * iReg = nullptr ) const; /// \ru Очистить массивы следов. \en Clear arrays of vestiges. void SetEmpty() { @@ -1209,16 +1209,16 @@ inline MbEdgeVestige * MbVEFVestiges::AddVestigeCurve( uint otherComp, size_t ot inline MbEdgeVestige * MbVEFVestiges::AddVestigeCurve( uint otherComp, size_t otherIdent, const RPArray & mapCurves, bool visible, const MbName & otherName ) { - MbEdgeVestige * ev = c3d_null; + MbEdgeVestige * ev = nullptr; ev = ::AddVestigeCurve( otherComp, otherIdent, otherName, curveVestiges, false, false ); // BUG_93683 ev = ::AddVestigeEdge( otherComp, otherIdent, otherName, MbBaseVestige::vt_Edge, edgeVestiges ); - if ( ev != c3d_null ) { + if ( ev != nullptr ) { MbCurveVestige & vc = ev->curveInfo; for ( size_t m = 0, mapCurvesCnt = mapCurves.Count(); m < mapCurvesCnt; m++ ) { MbCurve * mapCurve = mapCurves[m]; - if ( mapCurve != c3d_null ) + if ( mapCurve != nullptr ) vc.AddSegment( *mapCurve, visible ); } } diff --git a/C3d/Include/marker.h b/C3d/Include/marker.h index 94cbd38..bd687c9 100644 --- a/C3d/Include/marker.h +++ b/C3d/Include/marker.h @@ -76,10 +76,10 @@ public: // \ru Общие функции геометрического объекта \en Common functions of a geometric object virtual MbeSpaceType IsA() const; // \ru Тип объекта. \en Type of the object. virtual MbeSpaceType Type() const; // \ru Тип объекта. \en Type of the object. - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Создать копию. \en Create a copy. - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать согласно матрице. \en Transform according to the matrix. - virtual void Move( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвинуть вдоль вектора. \en Translate along a vector. - virtual void Rotate( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси. \en Rotate around an axis. + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Создать копию. \en Create a copy. + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать согласно матрице. \en Transform according to the matrix. + virtual void Move( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвинуть вдоль вектора. \en Translate along a vector. + virtual void Rotate( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси. \en Rotate around an axis. virtual bool IsSame( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const; // \ru Являются ли объекты равными? \en Determine whether objects are equal. virtual bool IsSimilar( const MbSpaceItem & init ) const; // \ru Являются ли объекты подобными? \en Determine whether objects are similar. virtual bool SetEqual ( const MbSpaceItem & init ); // \ru Сделать объекты равным. \en Make objects equal. diff --git a/C3d/Include/math_define.h b/C3d/Include/math_define.h index bc49714..9e8ba39 100644 --- a/C3d/Include/math_define.h +++ b/C3d/Include/math_define.h @@ -106,7 +106,7 @@ typedef std::pair IndicesPairsPair; ///< \ru Па // --- template bool IsNullPointer( const ItemPtr * itemPtr ) { - return ((c3d_null == itemPtr) ? true : false); + return ((nullptr == itemPtr) ? true : false); } //------------------------------------------------------------------------------ @@ -306,7 +306,7 @@ private: \ // // \ru примеры: \en examples: // \ru #pragma message( __TODO__ "Восстановить закрытый код" ) \en #pragma message( __TODO__ "Restore the private code" ) -// \ru #pragma message( __WARN__ "Отсутствует проверка на c3d_null" ) \en #pragma message( __WARN__ "There is no check for c3d_null" ) +// \ru #pragma message( __WARN__ "Отсутствует проверка на nullptr" ) \en #pragma message( __WARN__ "There is no check for nullptr" ) //--- #define __ANYTOSTR__(x) #x #define __DEFTOSTR__(x) __ANYTOSTR__(x) @@ -352,9 +352,9 @@ private: \ #define MATH_FUNC_EX __declspec( dllimport ) #endif #else // C3D_WINDOWS - #define MATH_CLASS - #define MATH_FUNC(retType) retType - #define MATH_FUNC_EX + #define MATH_CLASS __attribute__ ((visibility ("default"))) + #define MATH_FUNC(retType) __attribute__ ((visibility ("default"))) retType + #define MATH_FUNC_EX __attribute__ ((visibility ("default"))) #endif // \ru Модуль геометрических ограничений. \en Geometric constraints module. @@ -362,13 +362,13 @@ private: \ #define GCM_CLASS MATH_CLASS #define GCE_FUNC MATH_FUNC #define GCM_FUNC MATH_FUNC -#if !defined(PROTECTION_ENABLED) +#ifdef GCT_EXPORT #define GCT_CLASS MATH_CLASS #define GCT_FUNC MATH_FUNC #else #define GCT_CLASS #define GCT_FUNC(retType) retType -#endif +#endif // GCT_EXPORT // \ru Модуль конвертеров. \en Converters module. #define CONV_CLASS MATH_CLASS diff --git a/C3d/Include/math_version.h b/C3d/Include/math_version.h index 3feb3b2..393e82a 100644 --- a/C3d/Include/math_version.h +++ b/C3d/Include/math_version.h @@ -115,7 +115,7 @@ MATH_FUNC (VERSION) GetCurrentMathFileVersion(); //------------------------------------------------------------------------------ /// \ru Можно ли потенциально сохранить в заданную версию? \en Can it be saved to this math version? \~ \ingroup Base_Tools // --- -MATH_FUNC( bool ) CanWriteToMathFileVersion( VERSION dstVertsion, bool * canUseWriterEx = c3d_null ); +MATH_FUNC( bool ) CanWriteToMathFileVersion( VERSION dstVertsion, bool * canUseWriterEx = nullptr ); //------------------------------------------------------------------------------ diff --git a/C3d/Include/mb_class_traits.h b/C3d/Include/mb_class_traits.h index 9ef6082..b771839 100644 --- a/C3d/Include/mb_class_traits.h +++ b/C3d/Include/mb_class_traits.h @@ -57,7 +57,7 @@ struct _IsInstant template inline bool operator()( const ParentType * obj, const ClassEnum _typeId ) { - return obj == c3d_null ? true : obj->IsA() == _typeId; + return obj == nullptr ? true : obj->IsA() == _typeId; } }; @@ -69,7 +69,7 @@ struct _IsFamily template inline bool operator()( const ParentType * obj, const ClassEnum _typeId ) { - return obj == c3d_null ? true : obj->Family() == _typeId; + return obj == nullptr ? true : obj->Family() == _typeId; } }; @@ -154,7 +154,7 @@ inline DerivedPtr _IsaCast( ParentType * obj ) { return static_cast( obj ); } - return static_cast( c3d_null ); + return static_cast( nullptr ); } //---------------------------------------------------------------------------------------- @@ -202,7 +202,7 @@ DerivedPtr isa_cast( ParentType * obj ) template< class DerivedPtr > DerivedPtr isa_cast( const MbRefItem * obj ) { - DerivedPtr resPtr = c3d_null; + DerivedPtr resPtr = nullptr; return _IsaCast( obj, resPtr ); } @@ -214,7 +214,7 @@ DerivedPtr isa_cast( const MbRefItem * obj ) template< class DerivedPtr > DerivedPtr isa_cast( MbRefItem * obj ) { - DerivedPtr resPtr = c3d_null; + DerivedPtr resPtr = nullptr; return _IsaCast( obj, resPtr ); } diff --git a/C3d/Include/mb_cross_point.h b/C3d/Include/mb_cross_point.h index 4076aba..285555f 100644 --- a/C3d/Include/mb_cross_point.h +++ b/C3d/Include/mb_cross_point.h @@ -55,7 +55,7 @@ public: template MbPointOnCurve::MbPointOnCurve() : t ( 0.0 ) - , curve( c3d_null ) + , curve( nullptr ) {} diff --git a/C3d/Include/mb_cube.h b/C3d/Include/mb_cube.h index 26ae2c4..e4f306a 100644 --- a/C3d/Include/mb_cube.h +++ b/C3d/Include/mb_cube.h @@ -17,13 +17,14 @@ #include -c3d_constexpr size_t CUBE_CONTROL_POINTS_COUNT = 26; ///< \ru Количество характерных точек куба. \en The number of control points of cube. -c3d_constexpr size_t CUBE_VERTEX_COUNT = 8; ///< \ru Количество вершин куба. \en The number of cube vertices. -c3d_constexpr size_t CUBE_EDGES_COUNT = 12; ///< \ru Количество рёбер куба. \en The number of cube edges. -c3d_constexpr size_t CUBE_FACES_COUNT = 6; ///< \ru Количество граней куба. \en The number of cube faces. +c3d_constexpr size_t CUBE_CONTROL_POINTS_COUNT = 26; ///< \ru Количество характерных точек куба. \en The number of control points of thebounding box. +c3d_constexpr size_t CUBE_VERTEX_COUNT = 8; ///< \ru Количество вершин куба. \en The number of the bounding box vertices. +c3d_constexpr size_t CUBE_EDGES_COUNT = 12; ///< \ru Количество рёбер куба. \en The number of the bounding box edges. +c3d_constexpr size_t CUBE_FACES_COUNT = 6; ///< \ru Количество граней куба. \en The number of the bounding box faces. class MATH_CLASS MbRect; +class MATH_CLASS MbRect1D; class MATH_CLASS MbCube; class MATH_CLASS MbPlacement3D; class MATH_CLASS MbCurve3D; @@ -58,7 +59,7 @@ typedef MbCubeTree CubesTree; \en The bounding box is a domain (block) of 3D-space bounded by parallelepiped with edges parallel to the axes of coordinate system.\n It is used for quick estimation of the proximity or non-intersection of three-dimensional objects, - which are contained in the "cube". Faces of "cube" are parallel to planes of coordinate system. + which are contained in the "box". Faces of "box" are parallel to planes of coordinate system. The bounding box is described by a pair of points which are located on the main diagonal of a box. \~ \ingroup Mathematic_Base_3D */ @@ -185,13 +186,15 @@ public : \brief \ru Проекция на плейсмент. \en A projection onto the placement. \~ \details \ru Вычисляет прямоугольник, охватывающий проекцию куба на плейсмент. - \en Calculates a rectangle covering a projection of box onto the placement. \~ + \en Calculates a rectangle covering a projection of the box onto the placement. \~ \param[in] place - \ru Локальная система координат. \en A local coordinate system. \~ \param[out] rect - \ru Прямоугольник, охватывающий искомую проекцию. \en A rectangle covering a required projection. \~ */ void ProjectionRect( const MbPlacement3D & place, MbRect & rect ) const; + /// \ru Вычислить параметрический интервал кривой, охватывающий проекцию куба на кривую. \en Calculate a parametric interval of the curve covering the projection of the box on the curve. + void ProjectionRect( const MbCurve3D & curve, bool ext, MbRect1D & rect ) const; /** \ru \name Перегрузка логических операций. @@ -384,7 +387,7 @@ public : /// \ru Дать объем куба. \en Give the volume of a box. double GetVolume ( double eps = Math::metricRegion ) const; - /// \ru Дать половину площади граней куба. \en Give half of the area of the cube faces. + /// \ru Дать половину площади граней куба. \en Give half of the area of the box faces. double GetSquare ( double eps = Math::metricRegion ) const; /// \ru Дать размер стороны X куба. \en Give the size of the X side of a box. double GetLengthX() const { return pmax.x - pmin.x; } @@ -407,9 +410,9 @@ public : double DistanceToPoint( const MbCartPoint3D & point ) const; /** \brief \ru Вычислить расстояние до куба. - \en Calculate the distance to the cube. \~ + \en Calculate the distance to the box. \~ \details \ru Возвращается ноль, если кубы пересекаются или один содержится в другом. - \en It returns zero if the cubes intersect or one is contained in the other. \~ + \en It returns zero if the boexs intersect or one is contained in the other. \~ \param[in] cube - \ru Другой куб. \en Other cube. \~ \param[in] eps - \ru Метрическая точность. @@ -464,6 +467,17 @@ public : // \ru Выдать характерные точки куба \en Give control points of the box /// \ru Количество вершин. \en Number of vertices. size_t GetVerticesCount() const { return 8; } + /** + \brief \ru Выдать все вершины куба. + \en Give all vertices of the box. \~ + \details \ru Выдать все вершины куба. + \en Give all vertices of the box. \~ + \param[out] points - \ru Вершины. + \en Vertices. \~ + \return \ru Число вершин. Ноль, если куб пуст. + \en The number of vertices. Null if the box is empty. \~ + */ + size_t GetVertices( std::vector & points ) const; /// \ru Выдать вершину куба по индексу. \en Get a box vertex by an index. /** \param[in] index - \ru Исходный индекс. 0 <= index <= 7. diff --git a/C3d/Include/mb_cube_tree.h b/C3d/Include/mb_cube_tree.h index a55f613..8d3df4c 100644 --- a/C3d/Include/mb_cube_tree.h +++ b/C3d/Include/mb_cube_tree.h @@ -337,9 +337,9 @@ inline MbCubeTree::MbCubeTree( std::vector , dmType ( dm ) , leafObjects( ) , branchCube ( ) - , midstBranch( c3d_null ) - , lowerBranch( c3d_null ) - , upperBranch( c3d_null ) + , midstBranch( nullptr ) + , lowerBranch( nullptr ) + , upperBranch( nullptr ) { size_t cnt = objects.size(); C3D_ASSERT( Cube::GetDimension() == Point::GetDimension() ); @@ -347,7 +347,7 @@ inline MbCubeTree::MbCubeTree( std::vector if ( cnt > 0 ) { // Инициализация дерева Cube gabarit; for ( size_t i = 0; i < cnt; ++i ) { - if ( objects[i].first != c3d_null ) + if ( objects[i].first != nullptr ) gabarit |= objects[i].first->GetCube(); } branchCube = gabarit; @@ -372,9 +372,9 @@ inline MbCubeTree::MbCubeTree( std::vector , dmType ( dm ) , leafObjects( ) , branchCube ( gabarit ) - , midstBranch( c3d_null ) - , lowerBranch( c3d_null ) - , upperBranch( c3d_null ) + , midstBranch( nullptr ) + , lowerBranch( nullptr ) + , upperBranch( nullptr ) { C3D_ASSERT( Cube::GetDimension() == Point::GetDimension() ); InitTree( objects, gabarit, eda_anyDir, 0, 0 ); @@ -397,9 +397,9 @@ inline MbCubeTree::MbCubeTree( DistanceMeasure dm ) , dmType ( dm ) , leafObjects( ) , branchCube ( ) - , midstBranch( c3d_null ) - , lowerBranch( c3d_null ) - , upperBranch( c3d_null ) + , midstBranch( nullptr ) + , lowerBranch( nullptr ) + , upperBranch( nullptr ) { } @@ -413,7 +413,7 @@ inline void MbCubeTree::Clear() delete midstBranch; delete lowerBranch; delete upperBranch; - midstBranch = lowerBranch = upperBranch = c3d_null; + midstBranch = lowerBranch = upperBranch = nullptr; midst = minimum = maximum = lower = upper = 0.0; direction = eda_anyDir; branchCube.SetEmpty(); @@ -440,11 +440,11 @@ template inline void MbCubeTree::Move( const Vector & to ) { if ( to.MaxFactor() > 0.0 ) { - if ( midstBranch != c3d_null ) + if ( midstBranch != nullptr ) midstBranch->Move( to ); - if ( lowerBranch != c3d_null ) + if ( lowerBranch != nullptr ) lowerBranch->Move( to ); - if ( upperBranch != c3d_null ) + if ( upperBranch != nullptr ) upperBranch->Move( to ); Point pto; @@ -485,7 +485,7 @@ inline bool MbCubeTree::InitTree( const MbCubeTree::const_iterator it; - ItemItem itemPair( c3d_null, c3d_null ); + ItemItem itemPair( nullptr, nullptr ); for ( size_t k = 0; k < cnt && res; ++k ) { res = false; @@ -503,9 +503,9 @@ inline bool MbCubeTree::InitTree( const MbCubeTree( srcTree.midstBranch->dmType ); else midstBranch->Clear(); @@ -513,9 +513,9 @@ inline bool MbCubeTree::InitTree( const MbCubeTreeInitTree( *srcTree.midstBranch, itemPairs ); } - if ( res && (srcTree.lowerBranch != c3d_null) ) { - C3D_ASSERT( lowerBranch == c3d_null ); - if ( lowerBranch == c3d_null ) + if ( res && (srcTree.lowerBranch != nullptr) ) { + C3D_ASSERT( lowerBranch == nullptr ); + if ( lowerBranch == nullptr ) lowerBranch = new MbCubeTree( srcTree.lowerBranch->dmType ); else lowerBranch->Clear(); @@ -523,9 +523,9 @@ inline bool MbCubeTree::InitTree( const MbCubeTreeInitTree( *srcTree.lowerBranch, itemPairs ); } - if ( res && (srcTree.upperBranch != c3d_null) ) { - C3D_ASSERT( upperBranch == c3d_null ); - if ( upperBranch == c3d_null ) + if ( res && (srcTree.upperBranch != nullptr) ) { + C3D_ASSERT( upperBranch == nullptr ); + if ( upperBranch == nullptr ) upperBranch = new MbCubeTree( srcTree.upperBranch->dmType ); else upperBranch->Clear(); @@ -565,7 +565,7 @@ inline bool MbCubeTree::InitTree( const MbCubeTreeIsSame( *dstItem, eps ) ) { itemPairs[k].first = srcItem; itemPairs[k].second = dstItem; @@ -822,7 +822,7 @@ inline void MbCubeTree::SetBranches( std::vectorGetCube(); double pMin, pMax; @@ -861,34 +861,22 @@ inline void MbCubeTree::SetBranches( std::vectorGetCube(); double pMin, pMax; GetCubeMinMaxComponents( cube, 0.0, pMin, pMax ); if ( pMax < midst - eps ) { // объект расположен ниже центрального значения -#ifdef C3D_STANDARD_CXX_11_PARTIAL lowerArray.emplace_back( obj ); -#else - lowerArray.push_back( obj ); -#endif } else if ( pMin > midst + eps ) { // объект расположен выше центрального значения -#ifdef C3D_STANDARD_CXX_11_PARTIAL upperArray.emplace_back( obj ); -#else - upperArray.push_back( obj ); -#endif } else { // объект содержит центральное значение lower = std_min( lower, pMin ); upper = std_max( upper, pMax ); -#ifdef C3D_STANDARD_CXX_11_PARTIAL midstArray.emplace_back( obj ); -#else - midstArray.push_back( obj ); -#endif } } } @@ -902,22 +890,22 @@ inline void MbCubeTree::SetBranches( std::vector 0) || (upperCount > 0) ) { if ( lowerCount > 0 ) { // нижняя ветвь / lower branch - C3D_ASSERT ( lowerBranch == c3d_null ); - if ( lowerBranch == c3d_null ) + C3D_ASSERT ( lowerBranch == nullptr ); + if ( lowerBranch == nullptr ) lowerBranch = new MbCubeTree( dmType ); lowerBranch->InitTree( lowerArray, lowerGabarit, eda_anyDir, tier+1, 0 ); lowerArray.clear(); } if ( upperCount > 0 ) { // верхняя ветвь / upper branch - C3D_ASSERT( upperBranch == c3d_null ); - if ( upperBranch == c3d_null ) + C3D_ASSERT( upperBranch == nullptr ); + if ( upperBranch == nullptr ) upperBranch = new MbCubeTree( dmType ); upperBranch->InitTree( upperArray, upperGabarit, eda_anyDir, tier+1, 0 ); upperArray.clear(); } if ( midstCount > 0 ) { // центральная ветвь / central branch - C3D_ASSERT( midstBranch == c3d_null ); - if ( midstBranch == c3d_null ) + C3D_ASSERT( midstBranch == nullptr ); + if ( midstBranch == nullptr ) midstBranch = new MbCubeTree( dmType ); midstBranch->InitTree( midstArray, midstGabarit, direction, tier+1, 0 ); midstArray.clear(); @@ -945,18 +933,7 @@ inline void MbCubeTree::SetBranches( std::vectorGetCube(); - leafObjects.push_back( objects[i] ); - } - } -#endif } } } @@ -1033,18 +1010,7 @@ inline void MbCubeTree::FillLeaf( std::vectorGetCube(); - leafObjects.push_back( objects[i] ); - } - } -#endif } @@ -1054,9 +1020,9 @@ inline void MbCubeTree::FillLeaf( std::vector inline bool MbCubeTree::IsReady() const { - return ( (midstBranch != c3d_null) || - (lowerBranch != c3d_null) || - (upperBranch != c3d_null) || + return ( (midstBranch != nullptr) || + (lowerBranch != nullptr) || + (upperBranch != nullptr) || (leafObjects.size() > 0) ); } @@ -1069,11 +1035,11 @@ inline size_t MbCubeTree::Count() const { size_t cnt = leafObjects.size(); - if ( midstBranch != c3d_null ) + if ( midstBranch != nullptr ) cnt += midstBranch->Count(); - if ( lowerBranch != c3d_null ) + if ( lowerBranch != nullptr ) cnt += lowerBranch->Count(); - if ( upperBranch != c3d_null ) + if ( upperBranch != nullptr ) cnt += upperBranch->Count(); return cnt; @@ -1087,19 +1053,19 @@ template inline void MbCubeTree::GetContainsObjects( const Point & pnt, double epsilon, std::vector & items ) const { - if ( (lowerBranch != c3d_null) || (upperBranch != c3d_null) || (midstBranch != c3d_null) ) { + if ( (lowerBranch != nullptr) || (upperBranch != nullptr) || (midstBranch != nullptr) ) { double w = GetPointComponent( pnt ); if ( (w < (minimum - epsilon)) || ((maximum + epsilon) < w) ) return; // вне области / out of region - if ( (w < (midst + epsilon)) && (lowerBranch != c3d_null) ) { + if ( (w < (midst + epsilon)) && (lowerBranch != nullptr) ) { lowerBranch->GetContainsObjects( pnt, epsilon, items ); } - if ( ((midst - epsilon) < w) && (upperBranch != c3d_null) ) { + if ( ((midst - epsilon) < w) && (upperBranch != nullptr) ) { upperBranch->GetContainsObjects( pnt, epsilon, items ); } - if ( ((lower - epsilon) < w) && (w < (upper + epsilon)) && (midstBranch != c3d_null) ) { + if ( ((lower - epsilon) < w) && (w < (upper + epsilon)) && (midstBranch != nullptr) ) { midstBranch->GetContainsObjects( pnt, epsilon, items ); } } @@ -1108,7 +1074,7 @@ inline void MbCubeTree::GetContainsObjects( const Poi items.reserve( items.size() + iCount ); for ( size_t i = 0; i < iCount; ++i ) { const ItemIndex & obj = leafObjects[i]; - if ( obj.first != c3d_null ) { + if ( obj.first != nullptr ) { if ( obj.first->GetCube().Contains( pnt, epsilon ) ) items.push_back( obj.first ); } @@ -1124,19 +1090,19 @@ template inline void MbCubeTree::GetContainsObjects( const Point & pnt, double epsilon, std::vector & indices ) const { - if ( (lowerBranch != c3d_null) || (upperBranch != c3d_null) || (midstBranch != c3d_null) ) { + if ( (lowerBranch != nullptr) || (upperBranch != nullptr) || (midstBranch != nullptr) ) { double w = GetPointComponent( pnt ); if ( (w < (minimum - epsilon)) || ((maximum + epsilon) < w) ) return; // вне области / out of region - if ( (w < (midst + epsilon)) && (lowerBranch != c3d_null) ) { + if ( (w < (midst + epsilon)) && (lowerBranch != nullptr) ) { lowerBranch->GetContainsObjects( pnt, epsilon, indices ); } - if ( ((midst - epsilon) < w) && (upperBranch != c3d_null) ) { + if ( ((midst - epsilon) < w) && (upperBranch != nullptr) ) { upperBranch->GetContainsObjects( pnt, epsilon, indices ); } - if ( ((lower - epsilon) < w) && (w < (upper + epsilon)) && (midstBranch != c3d_null) ) { + if ( ((lower - epsilon) < w) && (w < (upper + epsilon)) && (midstBranch != nullptr) ) { midstBranch->GetContainsObjects( pnt, epsilon, indices ); } } @@ -1145,7 +1111,7 @@ inline void MbCubeTree::GetContainsObjects( const Poi indices.reserve( indices.size() + iCount ); for ( size_t i = 0; i < iCount; ++i ) { const ItemIndex & obj = leafObjects[i]; - if ( obj.first != c3d_null ) { + if ( obj.first != nullptr ) { if ( obj.first->GetCube().Contains( pnt, epsilon ) ) indices.push_back( obj.second ); } @@ -1162,20 +1128,20 @@ inline void MbCubeTree::GetIntersectObjects( const Cu std::vector & items, bool skipOwnself ) const { - if ( (lowerBranch != c3d_null) || (upperBranch != c3d_null) || (midstBranch != c3d_null) ) { + if ( (lowerBranch != nullptr) || (upperBranch != nullptr) || (midstBranch != nullptr) ) { double wMin, wMax; GetCubeMinMaxComponents( gabarit, 0.0, wMin, wMax ); if ( (wMax < minimum) || (maximum < wMin) ) return; // вне области / out of region - if ( (wMin < midst) && (lowerBranch != c3d_null) ) { + if ( (wMin < midst) && (lowerBranch != nullptr) ) { lowerBranch->GetIntersectObjects( gabarit, epsilon, items, skipOwnself ); } - if ( (midst < wMax) && (upperBranch != c3d_null) ) { + if ( (midst < wMax) && (upperBranch != nullptr) ) { upperBranch->GetIntersectObjects( gabarit, epsilon, items, skipOwnself ); } - if ( (lower < wMax) && (wMin < upper) && (midstBranch != c3d_null) ) { + if ( (lower < wMax) && (wMin < upper) && (midstBranch != nullptr) ) { midstBranch->GetIntersectObjects( gabarit, epsilon, items, skipOwnself ); } } @@ -1184,7 +1150,7 @@ inline void MbCubeTree::GetIntersectObjects( const Cu items.reserve( items.size() + iCount ); for ( size_t i = 0; i < iCount; ++i ) { const ItemIndex & obj = leafObjects[i]; - if ( obj.first != c3d_null ) { + if ( obj.first != nullptr ) { if ( !skipOwnself || (&gabarit != &static_cast(obj.first->GetCube()) ) ) { // KOMPAS-20871 if ( obj.first->GetCube().Intersect( gabarit, epsilon ) ) items.push_back( obj.first ); @@ -1203,20 +1169,20 @@ inline void MbCubeTree::GetIntersectObjects( const Cu std::vector & items, bool skipOwnself ) const { - if ( (lowerBranch != c3d_null) || (upperBranch != c3d_null) || (midstBranch != c3d_null) ) { + if ( (lowerBranch != nullptr) || (upperBranch != nullptr) || (midstBranch != nullptr) ) { double wMin, wMax; GetCubeMinMaxComponents( gabarit, 0.0, wMin, wMax ); if ( (wMax < minimum) || (maximum < wMin) ) return; // вне области / out of region - if ( (wMin < midst) && (lowerBranch != c3d_null) ) { + if ( (wMin < midst) && (lowerBranch != nullptr) ) { lowerBranch->GetIntersectObjects( gabarit, epsilon, items, skipOwnself ); } - if ( (midst < wMax) && (upperBranch != c3d_null) ) { + if ( (midst < wMax) && (upperBranch != nullptr) ) { upperBranch->GetIntersectObjects( gabarit, epsilon, items, skipOwnself ); } - if ( (lower < wMax) && (wMin < upper) && (midstBranch != c3d_null) ) { + if ( (lower < wMax) && (wMin < upper) && (midstBranch != nullptr) ) { midstBranch->GetIntersectObjects( gabarit, epsilon, items, skipOwnself ); } } @@ -1225,7 +1191,7 @@ inline void MbCubeTree::GetIntersectObjects( const Cu items.reserve( items.size() + iCount ); for ( size_t i = 0; i < iCount; ++i ) { const ItemIndex & obj = leafObjects[i]; - if ( obj.first != c3d_null ) { + if ( obj.first != nullptr ) { if ( !skipOwnself || (&gabarit != &static_cast(obj.first->GetCube()) ) ) { // KOMPAS-20871 if ( obj.first->GetCube().Intersect( gabarit, epsilon ) ) items.push_back( obj.second ); @@ -1243,7 +1209,7 @@ template inline void MbCubeTree::GetIntersectObjects( const Point & rayPnt1, const Point & rayPnt2, double eps, std::vector & itemIndices ) const { - bool isBranch = (lowerBranch != c3d_null) || (upperBranch != c3d_null) || (midstBranch != c3d_null); + bool isBranch = (lowerBranch != nullptr) || (upperBranch != nullptr) || (midstBranch != nullptr); bool isLeaf = !leafObjects.empty(); @@ -1300,13 +1266,13 @@ inline void MbCubeTree::GetIntersectObjects( const Po if ( (wMax < (minimum - eps)) || ((maximum + eps) < wMin) ) return; // вне области / out of region - if ( (wMin < (midst + eps)) && (lowerBranch != c3d_null) ) { + if ( (wMin < (midst + eps)) && (lowerBranch != nullptr) ) { lowerBranch->GetIntersectObjects( segmPnt1, segmPnt2, eps, itemIndices ); } - if ( (wMax > (midst - eps)) && (upperBranch != c3d_null) ) { + if ( (wMax > (midst - eps)) && (upperBranch != nullptr) ) { upperBranch->GetIntersectObjects( segmPnt1, segmPnt2, eps, itemIndices ); } - if ( (wMax > (lower - eps)) && (wMin < (upper + eps)) && (midstBranch != c3d_null) ) { + if ( (wMax > (lower - eps)) && (wMin < (upper + eps)) && (midstBranch != nullptr) ) { midstBranch->GetIntersectObjects( segmPnt1, segmPnt2, eps, itemIndices ); } } @@ -1322,7 +1288,7 @@ inline void MbCubeTree::GetIntersectObjects( const Po itemIndices.reserve( itemIndices.size() + iCount ); for ( size_t i = 0; i < iCount; ++i ) { const ItemIndex & obj = leafObjects[i]; - if ( obj.first != c3d_null ) { + if ( obj.first != nullptr ) { bool add = false; const Cube & objCube = obj.first->GetCube(); @@ -1384,27 +1350,27 @@ inline double MbCubeTree::GetDistance( const Type & o template inline void MbCubeTree::FindNearestObject( const Cube & gabarit, double & distance, const Type *& item, double eps ) const { - if ( (lowerBranch != c3d_null) || (upperBranch != c3d_null) || (midstBranch != c3d_null) ) { + if ( (lowerBranch != nullptr) || (upperBranch != nullptr) || (midstBranch != nullptr) ) { double wMin, wMax; GetCubeMinMaxComponents( gabarit, 0.0, wMin, wMax ); if ( (wMax < (minimum-distance)) || ((maximum+distance) < wMin) ) return; // вне области / out of region - if ( (wMin < (midst+distance)) && (lowerBranch != c3d_null) ) { + if ( (wMin < (midst+distance)) && (lowerBranch != nullptr) ) { lowerBranch->FindNearestObject( gabarit, distance, item, eps ); } - if ( ((midst-distance) < wMax) && (upperBranch != c3d_null) ) { + if ( ((midst-distance) < wMax) && (upperBranch != nullptr) ) { upperBranch->FindNearestObject( gabarit, distance, item, eps ); } - if ( ((lower-distance) < wMax) && (wMin < (upper+distance)) && (midstBranch != c3d_null) ) { + if ( ((lower-distance) < wMax) && (wMin < (upper+distance)) && (midstBranch != nullptr) ) { midstBranch->FindNearestObject( gabarit, distance, item, eps ); } } else { // содержимое конечной ветви // terminal branch content for ( size_t i = 0, iCount = leafObjects.size(); i < iCount; ++i ) { const ItemIndex & obj = leafObjects[i]; - if ( obj.first != c3d_null ) { + if ( obj.first != nullptr ) { double d = obj.first->GetCube().DistanceToCube( gabarit, eps ); if ( distance > d - eps ) { item = obj.first; @@ -1422,27 +1388,27 @@ inline void MbCubeTree::FindNearestObject( const Cube template inline void MbCubeTree::FindNearestObject( const Cube & gabarit, double & distance, size_t & index, double eps ) const { - if ( (lowerBranch != c3d_null) || (upperBranch != c3d_null) || (midstBranch != c3d_null) ) { + if ( (lowerBranch != nullptr) || (upperBranch != nullptr) || (midstBranch != nullptr) ) { double wMin, wMax; GetCubeMinMaxComponents( gabarit, 0.0, wMin, wMax ); if ( (wMax < (minimum-distance)) || ((maximum+distance) < wMin) ) return; // вне области / out of region - if ( (wMin < (midst+distance)) && (lowerBranch != c3d_null) ) { + if ( (wMin < (midst+distance)) && (lowerBranch != nullptr) ) { lowerBranch->FindNearestObject( gabarit, distance, index, eps ); } - if ( ((midst-distance) < wMax) && (upperBranch != c3d_null) ) { + if ( ((midst-distance) < wMax) && (upperBranch != nullptr) ) { upperBranch->FindNearestObject( gabarit, distance, index, eps ); } - if ( ((lower-distance) < wMax) && (wMin < (upper+distance)) && (midstBranch != c3d_null) ) { + if ( ((lower-distance) < wMax) && (wMin < (upper+distance)) && (midstBranch != nullptr) ) { midstBranch->FindNearestObject( gabarit, distance, index, eps ); } } else { // содержимое конечной ветви // terminal branch content for ( size_t i = 0, iCount = leafObjects.size(); i < iCount; ++i ) { const ItemIndex & obj = leafObjects[i]; - if ( obj.first != c3d_null ) { + if ( obj.first != nullptr ) { double d = obj.first->GetCube().DistanceToCube( gabarit, eps ); if ( distance > d - eps ) { index = obj.second; @@ -1462,27 +1428,27 @@ inline void MbCubeTree::GetNearestObjects( const Cube std::vector & itemDistances, double eps ) const { - if ( (lowerBranch != c3d_null) || (upperBranch != c3d_null) || (midstBranch != c3d_null) ) { + if ( (lowerBranch != nullptr) || (upperBranch != nullptr) || (midstBranch != nullptr) ) { double wMin, wMax; GetCubeMinMaxComponents( gabarit, 0.0, wMin, wMax ); if ( (wMax < (minimum-distance)) || ((maximum+distance) < wMin) ) return; // вне области / out of region - if ( (wMin < (midst+distance)) && (lowerBranch != c3d_null) ) { + if ( (wMin < (midst+distance)) && (lowerBranch != nullptr) ) { lowerBranch->GetNearestObjects( gabarit, distance, itemDistances, eps ); } - if ( ((midst-distance) < wMax) && (upperBranch != c3d_null) ) { + if ( ((midst-distance) < wMax) && (upperBranch != nullptr) ) { upperBranch->GetNearestObjects( gabarit, distance, itemDistances, eps ); } - if ( ((lower-distance) < wMax) && (wMin < (upper+distance)) && (midstBranch != c3d_null) ) { + if ( ((lower-distance) < wMax) && (wMin < (upper+distance)) && (midstBranch != nullptr) ) { midstBranch->GetNearestObjects( gabarit, distance, itemDistances, eps ); } } else { // содержимое конечной ветви // terminal branch content for ( size_t i = 0, iCount = leafObjects.size(); i < iCount; ++i ) { const ItemIndex & obj = leafObjects[i]; - if ( obj.first != c3d_null ) { + if ( obj.first != nullptr ) { double d = obj.first->GetCube().DistanceToCube( gabarit, eps ); if ( distance > d - eps ) { IndexDistance itemDistance( obj.second, d ); @@ -1500,26 +1466,26 @@ inline void MbCubeTree::GetNearestObjects( const Cube template inline void MbCubeTree::FindNearestObject( const Point & pnt, double & distance, const Type *& item, double eps ) const { - if ( (lowerBranch != c3d_null) || (upperBranch != c3d_null) || (midstBranch != c3d_null) ) { + if ( (lowerBranch != nullptr) || (upperBranch != nullptr) || (midstBranch != nullptr) ) { double w = GetPointComponent( pnt ); if ( (w < (minimum-distance)) || ((maximum+distance) < w) ) return; // вне области / out of region - if ( (w < (midst+distance)) && (lowerBranch != c3d_null) ) { + if ( (w < (midst+distance)) && (lowerBranch != nullptr) ) { lowerBranch->FindNearestObject( pnt, distance, item, eps ); } - if ( ((midst-distance) < w) && (upperBranch != c3d_null) ) { + if ( ((midst-distance) < w) && (upperBranch != nullptr) ) { upperBranch->FindNearestObject( pnt, distance, item, eps ); } - if ( ((lower-distance) < w) && (w < (upper+distance)) && (midstBranch != c3d_null) ) { + if ( ((lower-distance) < w) && (w < (upper+distance)) && (midstBranch != nullptr) ) { midstBranch->FindNearestObject( pnt, distance, item, eps ); } } else { // содержимое конечной ветви // terminal branch content for ( size_t i = 0, iCount = leafObjects.size(); i < iCount; ++i ) { const ItemIndex & obj = leafObjects[i]; - if ( obj.first != c3d_null ) { + if ( obj.first != nullptr ) { double d = GetDistance( *obj.first, pnt, false ); if ( distance > d - eps ) { item = obj.first; @@ -1537,26 +1503,26 @@ inline void MbCubeTree::FindNearestObject( const Poin template inline void MbCubeTree::FindNearestObject( const Point & pnt, double & distance, size_t & index, double eps ) const { - if ( (lowerBranch != c3d_null) || (upperBranch != c3d_null) || (midstBranch != c3d_null) ) { + if ( (lowerBranch != nullptr) || (upperBranch != nullptr) || (midstBranch != nullptr) ) { double w = GetPointComponent( pnt ); if ( (w < (minimum-distance)) || ((maximum+distance) < w) ) return; // вне области / out of region - if ( (w < (midst+distance)) && (lowerBranch != c3d_null) ) { + if ( (w < (midst+distance)) && (lowerBranch != nullptr) ) { lowerBranch->FindNearestObject( pnt, distance, index, eps ); } - if ( ((midst-distance) < w) && (upperBranch != c3d_null) ) { + if ( ((midst-distance) < w) && (upperBranch != nullptr) ) { upperBranch->FindNearestObject( pnt, distance, index, eps ); } - if ( ((lower-distance) < w) && (w < (upper+distance)) && (midstBranch != c3d_null) ) { + if ( ((lower-distance) < w) && (w < (upper+distance)) && (midstBranch != nullptr) ) { midstBranch->FindNearestObject( pnt, distance, index, eps ); } } else { // содержимое конечной ветви // terminal branch content for ( size_t i = 0, iCount = leafObjects.size(); i < iCount; ++i ) { const ItemIndex & obj = leafObjects[i]; - if ( obj.first != c3d_null ) { + if ( obj.first != nullptr ) { double d = GetDistance( *obj.first, pnt, false ); if ( distance > d - eps ) { index = obj.second; @@ -1576,19 +1542,19 @@ inline void MbCubeTree::GetNearestObjects( const Poin std::vector & itemDistances, double eps ) const { - if ( (lowerBranch != c3d_null) || (upperBranch != c3d_null) || (midstBranch != c3d_null) ) { + if ( (lowerBranch != nullptr) || (upperBranch != nullptr) || (midstBranch != nullptr) ) { double w = GetPointComponent( pnt ); if ( (w < (minimum-distance)) || ((maximum+distance) < w) ) return; // вне области / out of region - if ( (w < (midst+distance)) && (lowerBranch != c3d_null) ) { + if ( (w < (midst+distance)) && (lowerBranch != nullptr) ) { lowerBranch->GetNearestObjects( pnt, distance, itemDistances, eps ); } - if ( ((midst-distance) < w) && (upperBranch != c3d_null) ) { + if ( ((midst-distance) < w) && (upperBranch != nullptr) ) { upperBranch->GetNearestObjects( pnt, distance, itemDistances, eps ); } - if ( ((lower-distance) < w) && (w < (upper+distance)) && (midstBranch != c3d_null) ) { + if ( ((lower-distance) < w) && (w < (upper+distance)) && (midstBranch != nullptr) ) { midstBranch->GetNearestObjects( pnt, distance, itemDistances, eps ); } } @@ -1597,7 +1563,7 @@ inline void MbCubeTree::GetNearestObjects( const Poin itemDistances.reserve( itemDistances.size() + iCount ); for ( size_t i = 0; i < iCount; ++i ) { const ItemIndex & obj = leafObjects[i]; - if ( obj.first != c3d_null ) { + if ( obj.first != nullptr ) { double d = GetDistance( *obj.first, pnt, true ); if ( distance > d - eps ) { ItemDistance itemDistance( obj.first, d ); @@ -1617,19 +1583,19 @@ inline void MbCubeTree::GetNearestObjects( const Poin std::vector & itemDistances, double eps ) const { - if ( (lowerBranch != c3d_null) || (upperBranch != c3d_null) || (midstBranch != c3d_null) ) { + if ( (lowerBranch != nullptr) || (upperBranch != nullptr) || (midstBranch != nullptr) ) { double w = GetPointComponent( pnt ); if ( (w < (minimum-distance)) || ((maximum+distance) < w) ) return; // вне области / out of region - if ( (w < (midst+distance)) && (lowerBranch != c3d_null) ) { + if ( (w < (midst+distance)) && (lowerBranch != nullptr) ) { lowerBranch->GetNearestObjects( pnt, distance, itemDistances, eps ); } - if ( ((midst-distance) < w) && (upperBranch != c3d_null) ) { + if ( ((midst-distance) < w) && (upperBranch != nullptr) ) { upperBranch->GetNearestObjects( pnt, distance, itemDistances, eps ); } - if ( ((lower-distance) < w) && (w < (upper+distance)) && (midstBranch != c3d_null) ) { + if ( ((lower-distance) < w) && (w < (upper+distance)) && (midstBranch != nullptr) ) { midstBranch->GetNearestObjects( pnt, distance, itemDistances, eps ); } } @@ -1638,7 +1604,7 @@ inline void MbCubeTree::GetNearestObjects( const Poin itemDistances.reserve( itemDistances.size() + iCount ); for ( size_t i = 0; i < iCount; ++i ) { const ItemIndex & obj = leafObjects[i]; - if ( obj.first != c3d_null ) { + if ( obj.first != nullptr ) { double d = GetDistance( *obj.first, pnt, true ); if ( distance > d - eps ) { IndexDistance itemDistance( obj.second, d ); @@ -1658,19 +1624,19 @@ inline void MbCubeTree::GetNearestObjects( const Poin std::vector & itemIndices, double eps ) const { - if ( (lowerBranch != c3d_null) || (upperBranch != c3d_null) || (midstBranch != c3d_null) ) { + if ( (lowerBranch != nullptr) || (upperBranch != nullptr) || (midstBranch != nullptr) ) { double w = GetPointComponent( pnt ); if ( (w < (minimum-distance)) || ((maximum+distance) < w) ) return; // вне области / out of region - if ( (w < (midst+distance)) && (lowerBranch != c3d_null) ) { + if ( (w < (midst+distance)) && (lowerBranch != nullptr) ) { lowerBranch->GetNearestObjects( pnt, distance, itemIndices, eps ); } - if ( ((midst-distance) < w) && (upperBranch != c3d_null) ) { + if ( ((midst-distance) < w) && (upperBranch != nullptr) ) { upperBranch->GetNearestObjects( pnt, distance, itemIndices, eps ); } - if ( ((lower-distance) < w) && (w < (upper+distance)) && (midstBranch != c3d_null) ) { + if ( ((lower-distance) < w) && (w < (upper+distance)) && (midstBranch != nullptr) ) { midstBranch->GetNearestObjects( pnt, distance, itemIndices, eps ); } } @@ -1679,7 +1645,7 @@ inline void MbCubeTree::GetNearestObjects( const Poin itemIndices.reserve( itemIndices.size() + iCount ); for ( size_t i = 0; i < iCount; ++i ) { const ItemIndex & obj = leafObjects[i]; - if ( obj.first != c3d_null ) { + if ( obj.first != nullptr ) { double d = GetDistance( *obj.first, pnt, true ); if ( distance > d - eps ) { itemIndices.push_back( obj.second ); diff --git a/C3d/Include/mb_data.h b/C3d/Include/mb_data.h index d291b70..dc47bf6 100644 --- a/C3d/Include/mb_data.h +++ b/C3d/Include/mb_data.h @@ -552,7 +552,7 @@ public: MbVector3D lastTangent; ///< \ru Касательная в конечной точке. \en Tangent in the last point. double firstCurvature; ///< \ru Значение кривизны в начальной точке. \en Curvature in the first point. double lastCurvature; ///< \ru Значение кривизны в конечной точке. \en Curvature in the last point. - + bool smoothTorsion; ///< \ru Флаг сглаживания кручения пространственной кривой (false - незамкнут, true - замкнут). \en Sign of smoothing of torsion of curve (false - not smoothed, true - smoothed). #ifdef C3D_DEBUG_FAIR_CURVES /*DEBUG*/ FILE *prt; @@ -573,11 +573,11 @@ public: clothoidLMax( 200.0 ), clothoidSegms( 10 ), numberOfIterationsBSpl( 500 ), numberOfIterationsVCurve( 192 ), #ifdef C3D_DEBUG_FAIR_CURVES - prt( c3d_null ), + prt( nullptr ), #endif realAccuracyBSpl( METRIC_ACCURACY ), realAccuracyVCurve( METRIC_EPSILON ), switchEndTangents( false ), switchEndCurvature( false ), - firstCurvature( 0.0 ), lastCurvature( 0.0 ) {} + firstCurvature( 0.0 ), lastCurvature( 0.0 ), smoothTorsion( true ){} ~MbFairCurveData() {} @@ -831,6 +831,47 @@ public: } }; +//------------------------------------------------------------------------------ +/** \brief \ru Класс для уведомления одного объекта об изменениях определенного объекта. + \en Class for notifying a single object about changes of a certain object. \~ + \details \ru Класс для передачи сигналов об изменениях объекта в другой объект. + Объект, который хочет нотифицировать о своих изменениях, должен иметь экземпляр + класса MbObjectChangeSignal и вызывать его метод Signal() при своей модификации. + Объект, который будет получать сигналы об изменениях определенного объекта, должен + иметь метод Refresh( MbeObjectChangeType ) и подписаться на сигналы этого объекта. + Сигнал работает без блокировки. + \en Class for sending signals about changes of an object to another object. + An object which wants to notify about its changes must have an instance of + MbObjectChangeSignal class and call its Signal() method when gets modified. + An object which will receive signals about changes of a certain object must + have the Refresh( MbeObjectChangeType) method and subscribe to signals of this object. + Signal works without locking. \~ + \ingroup Data_Structures +*/ +// --- +template +class MbObjectChangeSignalOne +{ + Object * _subscriber; // \ru Подписчик на сигнал. \en Subscriber to a signal. +public: + + MbObjectChangeSignalOne() : _subscriber( nullptr ) {} + + /// \ru Подписаться на сигнал. \en Subscribe to a signal. + void Subscribe( Object * c ) { + _subscriber = c; + } + /// \ru Отписаться от сигнала. \en Unsubscribe from a signal. + void Unsubscribe( Object * ) { + _subscriber = nullptr; + } + /// \ru Послать сигнал об изменениях подписчикам. \en Send a signal about changes to the subscribers. + void Signal( MbeObjectChangeType type = oct_All ) { + if ( _subscriber != nullptr ) + _subscriber->Refresh( type ); + } +}; + //------------------------------------------------------------------------------ // \ru Активация использования сигналов. \en Enabling use of signals //--- diff --git a/C3d/Include/mb_dimension.h b/C3d/Include/mb_dimension.h index 70a5bd6..50897cb 100644 --- a/C3d/Include/mb_dimension.h +++ b/C3d/Include/mb_dimension.h @@ -83,12 +83,12 @@ public: \en \name Common functions of a geometric object. \{ */ virtual MbeSpaceType IsA() const; - virtual MbSpaceItem & Duplicate(MbRegDuplicate * = c3d_null) const; + virtual MbSpaceItem & Duplicate(MbRegDuplicate * = nullptr) const; virtual bool IsSame(const MbSpaceItem & /*other*/, double /*accuracy*/ = LENGTH_EPSILON) const; virtual bool SetEqual(const MbSpaceItem &); - virtual void Transform(const MbMatrix3D &, MbRegTransform * = c3d_null); - virtual void Move(const MbVector3D &, MbRegTransform * = c3d_null); - virtual void Rotate(const MbAxis3D &, double, MbRegTransform * = c3d_null); + virtual void Transform(const MbMatrix3D &, MbRegTransform * = nullptr); + virtual void Move(const MbVector3D &, MbRegTransform * = nullptr); + virtual void Rotate(const MbAxis3D &, double, MbRegTransform * = nullptr); virtual double DistanceToPoint(const MbCartPoint3D &) const; virtual void AddYourGabaritTo(MbCube &) const; virtual void CalculateMesh( const MbStepData & stepData, const MbFormNote & note, MbMesh & mesh ) const; // \ru Построить полигональную копию mesh. \en Build polygonal copy mesh. @@ -155,12 +155,12 @@ public: \en \name Common functions of a geometric object. \{ */ virtual MbeSpaceType IsA() const; - virtual MbSpaceItem & Duplicate(MbRegDuplicate * = c3d_null) const; + virtual MbSpaceItem & Duplicate(MbRegDuplicate * = nullptr) const; virtual bool IsSame(const MbSpaceItem & /*other*/, double /*accuracy*/ = LENGTH_EPSILON) const; virtual bool SetEqual(const MbSpaceItem &); - virtual void Transform(const MbMatrix3D &, MbRegTransform * = c3d_null); - virtual void Move(const MbVector3D &, MbRegTransform * = c3d_null); - virtual void Rotate(const MbAxis3D &, double, MbRegTransform * = c3d_null); + virtual void Transform(const MbMatrix3D &, MbRegTransform * = nullptr); + virtual void Move(const MbVector3D &, MbRegTransform * = nullptr); + virtual void Rotate(const MbAxis3D &, double, MbRegTransform * = nullptr); virtual double DistanceToPoint(const MbCartPoint3D &) const; virtual void AddYourGabaritTo(MbCube &) const; virtual void CalculateMesh( const MbStepData & stepData, const MbFormNote & note, MbMesh & mesh ) const; // \ru Построить полигональную копию mesh. \en Build polygonal copy mesh. @@ -231,12 +231,12 @@ public: \en \name Common functions of a geometric object. \{ */ virtual MbeSpaceType IsA() const; - virtual MbSpaceItem & Duplicate(MbRegDuplicate * = c3d_null) const; + virtual MbSpaceItem & Duplicate(MbRegDuplicate * = nullptr) const; virtual bool IsSame(const MbSpaceItem & /*other*/, double /*accuracy*/ = LENGTH_EPSILON) const; virtual bool SetEqual(const MbSpaceItem &); - virtual void Transform(const MbMatrix3D &, MbRegTransform * = c3d_null); - virtual void Move(const MbVector3D &, MbRegTransform * = c3d_null); - virtual void Rotate(const MbAxis3D &, double, MbRegTransform * = c3d_null); + virtual void Transform(const MbMatrix3D &, MbRegTransform * = nullptr); + virtual void Move(const MbVector3D &, MbRegTransform * = nullptr); + virtual void Rotate(const MbAxis3D &, double, MbRegTransform * = nullptr); virtual double DistanceToPoint(const MbCartPoint3D &) const; virtual void AddYourGabaritTo(MbCube &) const; virtual void CalculateMesh( const MbStepData & stepData, const MbFormNote & note, MbMesh & mesh ) const; // \ru Построить полигональную копию mesh. \en Build polygonal copy mesh. diff --git a/C3d/Include/mb_enum.h b/C3d/Include/mb_enum.h index e6c6a9f..7e988ea 100644 --- a/C3d/Include/mb_enum.h +++ b/C3d/Include/mb_enum.h @@ -658,6 +658,7 @@ enum MbeProgBarId_PointsSurface pbarId_PointsSurface_End, }; + //------------------------------------------------------------------------------ /** \brief \ru Управление построением гладких кривых на базе трехмерной ломаной. Коэффициент уплотнения кривой. \en Construction of smooth curves based on a three-dimensional polyline. Curve subdivision coefficient. \~ @@ -705,11 +706,11 @@ enum MbeFairApprox //--- enum MbeFairVector { - fairVector_Tangent = 0, ///< \ru Учет направления касательной. \en Direction of tangent to curve. - fairSmooth_Segment = 1, ///< \ru Плавная форма участка перегиба. \en Smooth shape of the inflection site. - fairSuperSmooth_Segment = 2, ///< \ru Супер плавная форма участка перегиба. \en Super smooth shape of the inflection site. - + fairVector_Tangent = 0, ///< \ru Учет направления касательной. \en Direction of tangent to curve. + fairSmooth_Segment = 1, ///< \ru Плавная форма участка перегиба. \en Smooth shape of the inflection site. + fairSuperSmooth_Segment = 2, ///< \ru Супер плавная форма участка перегиба. \en Super smooth shape of the inflection site. }; + //------------------------------------------------------------------------------ /** \brief \ru Управление построением гладких кривых на базе трехмерной ломаной. Учет касательной в заданной точке / точки на касательной. \en Construction of smooth curves based on a three-dimensional polyline. Taking into account tangent on point / point on tangent. \~ @@ -720,6 +721,7 @@ enum MbeFixPntTng fixPntTng_NotFix = 0, ///< \ru Не фиксировать точки на касательных / касательные в точках. \en Do not fix the points on tangents / the tangents on points. fixPntTng_Fix = 1, ///< \ru Фиксировать точки на касательных / касательные в точках. \en Fix the points on tangents / the tangents on points. }; + //------------------------------------------------------------------------------ /** \brief \ru Управление построением гладких кривых на базе трехмерной ломаной. Формат сплайна. \en Construction of smooth curves based on a three-dimensional polyline. Spline Format. \~ @@ -773,16 +775,34 @@ enum MbeSectionShape { //------------------------------------------------------------------------------ -/** \brief \ru Поверхность кривой пересечения, отвечающая существующей грани. - \en Surface of the intersection curve corresponding to the existent face. \~ +/** \brief \ru Выбор из пары объектов. + \en Selection from a pair of objects. \~ \ingroup Data_Structures */ // --- -enum MbeIntCurSurface +enum MbePairObjectsSelection { - ics_First = 0, ///<\ru Первая поверхность. \en First surface. \~ - ics_Second = 1, ///<\ru Вторая поверхность. \en Second surface. \~ - ics_Both = 2, ///<\ru Обе поверхности. \en Both surfaces. \~ + pos_First = 0, ///<\ru Первый объект. \en First object. \~ + pos_Second = 1, ///<\ru Второй объект. \en Second object. \~ + pos_Both = 2, ///<\ru Оба объекта. \en Both objects. \~ +}; + + +//------------------------------------------------------------------------------ +/** \brief \ru Перечисление способов продления кривой. + \en Enumeration of ways to extend the curve. \~ +\ingroup Curve_Modeling +*/ +// --- +enum class MbeCurveExtensionWays : unsigned int +{ + cew_Linear = 0, ///< \ru Кривая продлевается по касательной в крайней точке. \en The curve is extended by tangent to the boundary point. \~ + cew_Circular = 1, ///< \ru Кривая продлевается по дуге, радиус которой равен радиусу кривизны кривой в крайней точке. \en The curve is extended by an arc with radius equal to its curvature radius in the boundary point. \~ + cew_Natural = 2, ///< \ru Кривая продлевается по заданной аналитической зависимости. \en The curve is extended by the given analytical function. \~ + + // \ru !!! СТРОКИ ВСТАВЛЯТЬ СТРОГО ПЕРЕД ЭТОЙ СТРОКОЙ !!!! \en !!! INSERT LINES STRICTLY BEFORE THIS LINE !!!! + + cew_Undefined ///< \ru Не задано. \en Not set. \~ }; diff --git a/C3d/Include/mb_matrix3d.h b/C3d/Include/mb_matrix3d.h index 21eb18c..2cd48a2 100644 --- a/C3d/Include/mb_matrix3d.h +++ b/C3d/Include/mb_matrix3d.h @@ -196,6 +196,8 @@ public: bool IsRotation () const { return !!( CheckFlag() & MB_ROTATION ); } /// \ru Выдать признак отрицательности детерминанта матрицы вращения. \en Get an attribute of negativity of the determinant of a rotation matrix. bool IsReflection () const { return !!( CheckFlag() & MB_REFLECTION ); } + /// \ru Выдать признак лево-определенной матрицы. \en Get an attribute of the left-definite matrix. + bool IsLeft () const { return !!( CheckFlag() & MB_LEFT ); } /// \ru Выдать признак ортогональности для случая аффинной матрицы. \en Get an attribute of orthogonality for the case if the matrix is affine. bool IsOrt () const { return !!( CheckFlag() & MB_ORTOGONAL ); } /// \ru Выдать признак ортогональности для матрицы вращения. \en Get an attribute of orthogonality for the case if the matrix is a rotation matrix. @@ -398,7 +400,7 @@ public: \param[in] sx, sy, sz - \ru Коэффициенты масштабирования для каждой из осей. \en Scaling coefficients for each axis. \~ */ - void Scale ( double sx, double sy, double sz ) { ScaleX( sx ), ScaleY( sy ), ScaleZ( sz ); } + void Scale( double sx, double sy, double sz ); /// \ru Масштабировать по X, Y, Z. \en Scale by X, Y and Z. void Scale ( double s ); /// \ru Масштабировать по X. \en Scale by X. diff --git a/C3d/Include/mb_matrixnn.h b/C3d/Include/mb_matrixnn.h index 4e056f9..ca93772 100644 --- a/C3d/Include/mb_matrixnn.h +++ b/C3d/Include/mb_matrixnn.h @@ -29,12 +29,12 @@ private : protected: /// \ru Конструктор. \en Constructor. - MatrixNN() : parr( c3d_null ), n( 0 ) {} + MatrixNN() : parr( nullptr ), n( 0 ) {} /// \ru Конструктор по заданной размерности. \en The constructor by a given dimension. - MatrixNN( size_t dim ) : parr( c3d_null ), n( 0 ) { SetSize( dim ); } + MatrixNN( size_t dim ) : parr( nullptr ), n( 0 ) { SetSize( dim ); } public: /// \ru Конструктор ограниченной размерности. \en The constructor of restricted dimension. - MatrixNN ( const uint16 & dim ) : parr( c3d_null ), n( 0 ) { SetSize( dim ); } + MatrixNN ( const uint16 & dim ) : parr( nullptr ), n( 0 ) { SetSize( dim ); } /// \ru Конструктор копирования. \en The copy constructor. explicit MatrixNN ( const MatrixNN & ); /// \ru Деструктор. \en Destructor. @@ -116,10 +116,10 @@ private: */ // --- template -MbeNewtonResult TypedGaussEquation ( MatrixNN & a, Type * b, double epsilon, ProgressBarWrapper * baseProgBar = c3d_null ) +MbeNewtonResult TypedGaussEquation ( MatrixNN & a, Type * b, double epsilon, ProgressBarWrapper * baseProgBar = nullptr ) { - ProgressBarWrapper * progBar = c3d_null; - if ( baseProgBar != c3d_null ) { + ProgressBarWrapper * progBar = nullptr; + if ( baseProgBar != nullptr ) { StrData strData( pbarId_Solve_LinearEquationsSystem ); progBar = &baseProgBar->CreateChildAddRef( strData ); } @@ -254,10 +254,10 @@ MbeNewtonResult TypedGaussEquation ( MatrixNN & a, Type * b, double epsilon, Pro */ // --- template -MbeNewtonResult TypedGaussEquationWithBandMatrix( SparseMatrix & a, Type * b, double epsilon, ProgressBarWrapper * baseProgBar = c3d_null ) +MbeNewtonResult TypedGaussEquationWithBandMatrix( SparseMatrix & a, Type * b, double epsilon, ProgressBarWrapper * baseProgBar = nullptr ) { - ProgressBarWrapper * progBar = c3d_null; - if ( baseProgBar != c3d_null ) { + ProgressBarWrapper * progBar = nullptr; + if ( baseProgBar != nullptr ) { StrData strData( pbarId_Solve_LinearEquationsSystem ); progBar = &baseProgBar->CreateChildAddRef( strData ); } diff --git a/C3d/Include/mb_nurbs_function.h b/C3d/Include/mb_nurbs_function.h index 5f0fa0b..49a38af 100644 --- a/C3d/Include/mb_nurbs_function.h +++ b/C3d/Include/mb_nurbs_function.h @@ -480,7 +480,7 @@ bool IsValidNurbsParamsExt( size_t degree, bool closed, size_t pcnt, template bool IsValidNurbsParamsExt( size_t degree, bool closed, const PointVector & pnts, const DoubleVector * wts, - const DoubleVector * knots = c3d_null ) + const DoubleVector * knots = nullptr ) { // \ru 1. Порядок B-сплайна должен быть не менее 2. \en 1. The order of B-spline must be at least 2. // \ru 2а. Для незамкнутой кривой количество точек не меньше порядка сплайна. \en 2a. The number of open curve points isn't less than the order of spline. @@ -491,10 +491,10 @@ bool IsValidNurbsParamsExt( size_t degree, bool closed, const PointVector & pnts size_t pcnt = pnts.size(); bool res = ::IsValidNurbsParams( degree, closed, pcnt ) && - ( (wts == c3d_null) || (wts->size() == pcnt) ) && - ( (knots == c3d_null) || (knots->size() == (degree + pcnt + (closed ? (degree - 1) : 0))) ); + ( (wts == nullptr) || (wts->size() == pcnt) ) && + ( (knots == nullptr) || (knots->size() == (degree + pcnt + (closed ? (degree - 1) : 0))) ); - if ( res && (knots != c3d_null) ) { + if ( res && (knots != nullptr) ) { if ( !c3d::IsMonotonic( *knots, true, true ) ) res = false; // SD#7118498 } @@ -690,7 +690,7 @@ bool DefineKnotsVector( size_t degree, double knot = 0.0; - if ( (paramsPtr == c3d_null) || (*paramsPtr).empty() ) { + if ( (paramsPtr == nullptr) || (*paramsPtr).empty() ) { for ( size_t i = 0; i < knotsCount; ++i ) { if ( closed ) // Замкнутый В-сплайн. knot = (double)(ptrdiff_t)(i - degree + 1); @@ -937,14 +937,14 @@ template void CurveDeriveCpts( ptrdiff_t p, const KnotsVector & U, const Point * P, const double * W, size_t pointCount, const NurbsVector * PW, ptrdiff_t d, ptrdiff_t r1, ptrdiff_t r2, NurbsVector * PK ) { - C3D_ASSERT( (P != c3d_null && W != c3d_null) != (PW != c3d_null) ); + C3D_ASSERT( (P != nullptr && W != nullptr) != (PW != nullptr) ); ptrdiff_t r = ( r2 - r1 ); ptrdiff_t degree = ( p + 1 ); ptrdiff_t i, k, icount; NurbsVector & PK0 = PK[0]; - if ( PW != c3d_null ) { + if ( PW != nullptr ) { for ( i = 0; i <= r; i++ ) PK0.Set( i, *PW, (r1 + i) ); } @@ -987,14 +987,14 @@ template void CurveDeriveCpts( ptrdiff_t p, const KnotsVector & U, const Point * P, const double w, size_t pointCount, const NurbsVector * PW, ptrdiff_t d, ptrdiff_t r1, ptrdiff_t r2, NurbsVector * PK ) { - C3D_ASSERT( (P != c3d_null) != (PW != c3d_null) ); + C3D_ASSERT( (P != nullptr) != (PW != nullptr) ); ptrdiff_t r = ( r2 - r1 ); ptrdiff_t degree = ( p + 1 ); ptrdiff_t i, k, icount; NurbsVector & PK0 = PK[0]; - if ( PW != c3d_null ) { + if ( PW != nullptr ) { for ( i = 0; i <= r; i++ ) PK0.Set( i, *PW, (r1 + i) ); } @@ -1037,16 +1037,16 @@ template void CurveDeriveCpts( ptrdiff_t p, const KnotsVector & U, const Point * P, const double * W, size_t pointCount, const NurbsVector * PW, ptrdiff_t d, ptrdiff_t r1, ptrdiff_t r2, DoubleTriple ** DT, double ** WT ) { - C3D_ASSERT( ( P != c3d_null && W != c3d_null ) != ( PW != c3d_null ) ); + C3D_ASSERT( ( P != nullptr && W != nullptr ) != ( PW != nullptr ) ); ptrdiff_t r = ( r2 - r1 ); ptrdiff_t degree = ( p + 1 ); ptrdiff_t i, k, icount; DoubleTriple * DT0 = DT[0]; double * WT0 = WT[0]; - bool useWeight = WT0 != c3d_null; + bool useWeight = WT0 != nullptr; - if ( PW != c3d_null ) { + if ( PW != nullptr ) { if ( !useWeight ) { for ( i = 0; i <= r; i++ ) DT0[i].Init( (*PW)[r1 + i] ); @@ -1074,8 +1074,8 @@ void CurveDeriveCpts( ptrdiff_t p, const KnotsVector & U, const Point * P, const } } - double * WTMin = c3d_null; - double * WTPls = c3d_null; + double * WTMin = nullptr; + double * WTPls = nullptr; for ( k = 1; k <= d; k++ ) { DoubleTriple * DTMin = DT[k - 1]; DoubleTriple * DTPls = DT[k]; @@ -1109,16 +1109,16 @@ template void CurveDeriveCpts( ptrdiff_t p, const KnotsVector & U, const Point * P, const double w, size_t pointCount, const NurbsVector * PW, ptrdiff_t d, ptrdiff_t r1, ptrdiff_t r2, DoubleTriple ** DT, double ** WT ) { - C3D_ASSERT( ( P != c3d_null ) != ( PW != c3d_null ) ); + C3D_ASSERT( ( P != nullptr ) != ( PW != nullptr ) ); ptrdiff_t r = ( r2 - r1 ); ptrdiff_t degree = ( p + 1 ); ptrdiff_t i, k, icount; DoubleTriple * DT0 = DT[0]; double * WT0 = WT[0]; - bool useWeight = WT0 != c3d_null; + bool useWeight = WT0 != nullptr; - if ( PW != c3d_null ) { + if ( PW != nullptr ) { if ( !useWeight ) { for ( i = 0; i <= r; i++ ) DT0[i].Init( (*PW)[r1 + i] ); @@ -1147,8 +1147,8 @@ void CurveDeriveCpts( ptrdiff_t p, const KnotsVector & U, const Point * P, const } } - double * WTMin = c3d_null; - double * WTPls = c3d_null; + double * WTMin = nullptr; + double * WTPls = nullptr; for ( k = 1; k <= d; k++ ) { DoubleTriple * DTMin = DT[k - 1]; DoubleTriple * DTPls = DT[k]; @@ -1188,7 +1188,7 @@ void CurveDeriveCpts( ptrdiff_t p, const double * U, const Point * P, const doub for ( i = 0; i <= r; i++ ) { k = ( (r1 + i) % pointCount ); - if ( W != c3d_null ) + if ( W != nullptr ) H0[i].Init( P[k], W[k] ); else H0[i].Init( P[k], 1.0 ); @@ -1345,7 +1345,7 @@ MbeNewtonResult CalculatePointList( const ParamsVector & params, DPtr matrixPtr( MatrixNN::Create(pointsCount) ); // \ru Матрица системы уравнений для прохождения NURBS при params[i] через points[i] \en Matrix of equation system for constructing the NURBS-curve passing through the points[i] with params[i] - if ( matrixPtr != c3d_null && ::IsValidNurbsParamsExt(degree, closed, pointList.size(), knots) ) { + if ( matrixPtr != nullptr && ::IsValidNurbsParamsExt(degree, closed, pointList.size(), knots) ) { MatrixNN & matrix = *matrixPtr; c3d::DoubleVector bSplines; // \ru Ненулевые B-сплайны \en Non-zero B-splines @@ -1406,7 +1406,7 @@ MbeNewtonResult CalculatePointListWithBandMatrix( const ParamsVector & params // \ru Матрица системы уравнений для прохождения NURBS при params[i] через points[i]. \en Matrix of equation system for constructing the NURBS-curve passing through the points[i] with params[i]. DPtr< SparseArray2 > matrixPtr( SparseArray2::Create( pointsCount, pointsCount ) ); - if ( matrixPtr != c3d_null && ::IsValidNurbsParamsExt( degree, closed, pointList.size(), knots ) ) { + if ( matrixPtr != nullptr && ::IsValidNurbsParamsExt( degree, closed, pointList.size(), knots ) ) { SparseArray2 & matrix = *matrixPtr; c3d::DoubleVector bSplines; // \ru Ненулевые B-сплайны. \en Non-zero B-splines. @@ -1768,9 +1768,9 @@ bool AttachNurbsG2( TypedNurbs & nurbs, // \ru Модифицируемы // \ru Сохраняем вычисленные производные \en Save the calculated derivatives if ( res ) { - if ( wDiff1 != c3d_null ) + if ( wDiff1 != nullptr ) *wDiff1 = weightDiff1; - if ( wDiff2 != c3d_null && res ) + if ( wDiff2 != nullptr && res ) *wDiff2 = weightDiff2; } @@ -2416,7 +2416,7 @@ MATH_FUNC (bool) CreateNurbsLSMClosed( SPtr & nurbs, // \ru Мод const ptrdiff_t pCount, const PointsVector & aPoints, const DoubleVector & aKnots, - const DoubleVector * aParams = c3d_null ); + const DoubleVector * aParams = nullptr ); //------------------------------------------------------------------------------ @@ -2447,7 +2447,7 @@ MATH_FUNC (bool) CreateNurbsLSM( SPtr & nurbs, // \ru Модифи const ptrdiff_t pCount, const PointsVector & aPoints, const DoubleVector & aKnots, - const DoubleVector * aParams = c3d_null ); + const DoubleVector * aParams = nullptr ); //------------------------------------------------------------------------------- @@ -2457,7 +2457,7 @@ template Nurbs * CreateLineOutRgn( const Curve & curve, double tn1, double tn2, double t1, double t2, const MbCurveIntoNurbsInfo & nci ) { - Nurbs * nurbs = c3d_null; + Nurbs * nurbs = nullptr; if ( !curve.IsClosed() && nci.ExtendRange() && ((tn2 - tn1) > Math::paramEpsilon) ) { SArray points ( 2, 1 ); diff --git a/C3d/Include/mb_operation_result.h b/C3d/Include/mb_operation_result.h index 2ed4a4f..daa1e41 100644 --- a/C3d/Include/mb_operation_result.h +++ b/C3d/Include/mb_operation_result.h @@ -269,6 +269,10 @@ enum MbResultType { rt_SectionMovementWrong, ///< \ru Движение сечения не совместимо с направляющими. \en The cross section movement is not compatible with the guides. rt_DiscriminantSurfaceFar, ///< \ru Дискриминантная поверхность далеко от сечения. \en The discriminant surface far from section. rt_CrossOrderError, ///< \ru Нарушен порядок взаимного пересечения кривых. \en The order of mutual intersection of curves is violated. + + // \ru Ошибки построения удлинения кривой. \en Build failure of the curve extension. + rt_WrongExtensionLength, ///< \ru Некорректная длина продления. \en Incorrect extension length. + rt_WrongExtensionWayValue, ///< \ru Неизвестный способ продления. \en Unknown extension way. // \ru !!! СТРОКИ ВСТАВЛЯТЬ СТРОГО ПЕРЕД ЭТОЙ СТРОКОЙ !!!! \en !!! INSERT LINES STRICTLY BEFORE THIS LINE !!!! rt_ErrorTotal // \ru НИЖЕ НЕ ДОБАВЛЯТЬ! \en DON'T ADD BELOW! }; diff --git a/C3d/Include/mb_placement3d.h b/C3d/Include/mb_placement3d.h index 0f4a31c..b802508 100644 --- a/C3d/Include/mb_placement3d.h +++ b/C3d/Include/mb_placement3d.h @@ -393,7 +393,7 @@ public: /** \} /// \ru Пересчитать СК по измененным внутренним данным. \en Recalculate the coordinate system for changed internal data. void Reset (); /// \ru Инвертировать. \en Invert. - void Invert( MbMatrix * = c3d_null ); + void Invert( MbMatrix * = nullptr ); /// \ru Найти ближайшую точку пересечения с линией. \en Find the nearest point of intersection with line. bool LineIntersectionPoint( const MbCartPoint3D & pc, const MbVector3D & axis, MbCartPoint3D & p, double & d, double eps = ANGLE_EPSILON ) const; diff --git a/C3d/Include/mb_point_mating.h b/C3d/Include/mb_point_mating.h index dbd395b..946a360 100644 --- a/C3d/Include/mb_point_mating.h +++ b/C3d/Include/mb_point_mating.h @@ -108,10 +108,10 @@ private: // \ru не реализовано \en not implemented template MbPntMatingData::MbPntMatingData() : MbRefItem ( ) - , tangent ( c3d_null ) - , tangentDer1 ( c3d_null ) - , tangentDer2 ( c3d_null ) - , changedPnts ( c3d_null ) + , tangent ( nullptr ) + , tangentDer1 ( nullptr ) + , tangentDer2 ( nullptr ) + , changedPnts ( nullptr ) , type ( trt_Position ) , movePnts ( false ) , attach ( false ) @@ -132,9 +132,9 @@ MbPntMatingData::MbPntMatingData( const MbeMatingType nType, bool nAttach ) : MbRefItem ( ) , type ( nType ) - , tangent ( (nTang != c3d_null) ? new Vector( *nTang ) : c3d_null ) - , tangentDer1 ( (nTangDer1 != c3d_null) ? new Vector( *nTangDer1 ) : c3d_null ) - , tangentDer2 ( (nTangDer2 != c3d_null) ? new Vector( *nTangDer2 ) : c3d_null ) + , tangent ( (nTang != nullptr) ? new Vector( *nTang ) : nullptr ) + , tangentDer1 ( (nTangDer1 != nullptr) ? new Vector( *nTangDer1 ) : nullptr ) + , tangentDer2 ( (nTangDer2 != nullptr) ? new Vector( *nTangDer2 ) : nullptr ) , movePnts ( nMovePnts ) , changedPnts ( nChangedPnts ) , attach ( nAttach ) @@ -154,9 +154,9 @@ template MbPntMatingData::MbPntMatingData( const MbPntMatingData & d ) : MbRefItem ( ) , type ( d.type ) - , tangent ( (d.tangent != c3d_null) ? new Vector( *d.tangent ) : c3d_null ) - , tangentDer1 ( (d.tangentDer1 != c3d_null) ? new Vector( *d.tangentDer1 ) : c3d_null ) - , tangentDer2 ( (d.tangentDer2 != c3d_null) ? new Vector( *d.tangentDer2 ) : c3d_null ) + , tangent ( (d.tangent != nullptr) ? new Vector( *d.tangent ) : nullptr ) + , tangentDer1 ( (d.tangentDer1 != nullptr) ? new Vector( *d.tangentDer1 ) : nullptr ) + , tangentDer2 ( (d.tangentDer2 != nullptr) ? new Vector( *d.tangentDer2 ) : nullptr ) , movePnts ( d.movePnts ) , changedPnts ( d.changedPnts ) , attach ( d.attach ) @@ -190,25 +190,25 @@ void MbPntMatingData::Init( const MbeMatingType nType, { type = nType; - if ( tangent != c3d_null && nTang != c3d_null ) // \ru касательный вектор \en tangent vector + if ( tangent != nullptr && nTang != nullptr ) // \ru касательный вектор \en tangent vector tangent->Init( *nTang ); - else if ( nTang != c3d_null ) + else if ( nTang != nullptr ) tangent = new Vector( *nTang ); - else if ( tangent != c3d_null ) + else if ( tangent != nullptr ) ::DeleteMatItem( tangent ); - if ( tangentDer1 != c3d_null && nTangDer1 != c3d_null ) // \ru первая производная касательного вектора \en first derivative of tangent vector + if ( tangentDer1 != nullptr && nTangDer1 != nullptr ) // \ru первая производная касательного вектора \en first derivative of tangent vector tangentDer1->Init( *nTangDer1 ); - else if ( nTangDer1 != c3d_null ) + else if ( nTangDer1 != nullptr ) tangentDer1 = new Vector( *nTangDer1 ); - else if ( tangentDer1 != c3d_null ) + else if ( tangentDer1 != nullptr ) ::DeleteMatItem( tangentDer1 ); - if ( tangentDer2 != c3d_null && nTangDer2 != c3d_null ) // \ru вторая производная касательного вектора \en second derivative of tangent vector + if ( tangentDer2 != nullptr && nTangDer2 != nullptr ) // \ru вторая производная касательного вектора \en second derivative of tangent vector tangentDer2->Init( *nTangDer2 ); - else if ( nTangDer2 != c3d_null ) + else if ( nTangDer2 != nullptr ) tangentDer2 = new Vector( *nTangDer2 ); - else if ( tangentDer2 != c3d_null ) + else if ( tangentDer2 != nullptr ) ::DeleteMatItem( tangentDer2 ); if ( type <= trt_Position ) { // BUG_52162 @@ -217,7 +217,7 @@ void MbPntMatingData::Init( const MbeMatingType nType, ::DeleteMatItem( tangentDer2 ); } - if ( changedPnts != c3d_null ) + if ( changedPnts != nullptr ) changedPnts->clear(); movePnts = nMovePnts; @@ -232,10 +232,10 @@ void MbPntMatingData::Init( const MbeMatingType nType, template bool MbPntMatingData::Init( const MbPntMatingData & d ) { - C3D_ASSERT( changedPnts == c3d_null ); + C3D_ASSERT( changedPnts == nullptr ); if ( this != &d ) { - SArray * dummyInds = c3d_null; + SArray * dummyInds = nullptr; Init( d.type, d.tangent, d.tangentDer1, d.tangentDer2, dummyInds, d.movePnts, d.attach ); return true; } @@ -274,9 +274,9 @@ bool MbPntMatingData::IsValid() const if ( type >= trt_Position ) { double lenEps = LENGTH_EPSILON; - bool isTang = (tangent != c3d_null); - bool isTangDer1 = (tangentDer1 != c3d_null); - bool isTangDer2 = (tangentDer2 != c3d_null); + bool isTang = (tangent != nullptr); + bool isTangDer1 = (tangentDer1 != nullptr); + bool isTangDer2 = (tangentDer2 != nullptr); bool isTangLen = (isTang && tangent->Length() > lenEps); switch( type ) { @@ -317,8 +317,8 @@ size_t MbPntMatingData::GetSmoothDegree() const res = 1; break; case trt_Normal : - if ( tangentDer1 != c3d_null ) res = 2; - else if ( tangent != c3d_null ) res = 1; + if ( tangentDer1 != nullptr ) res = 2; + else if ( tangent != nullptr ) res = 1; break; case trt_SmoothG2: res = 2; @@ -340,17 +340,17 @@ void MbPntMatingData::SetVector( ptrdiff_t i, const Vector & vect ) { switch ( i ) { case 0 : { - if ( tangent != c3d_null ) tangent->Init( vect ); + if ( tangent != nullptr ) tangent->Init( vect ); else tangent = new Vector( vect ); break; } case 1 : { - if ( tangentDer1 != c3d_null ) tangentDer1->Init( vect ); + if ( tangentDer1 != nullptr ) tangentDer1->Init( vect ); else tangentDer1 = new Vector( vect ); break; } case 2 : { - if ( tangentDer2 != c3d_null ) tangentDer2->Init( vect ); + if ( tangentDer2 != nullptr ) tangentDer2->Init( vect ); else tangentDer2 = new Vector( vect ); break; } @@ -364,7 +364,7 @@ void MbPntMatingData::SetVector( ptrdiff_t i, const Vector & vect ) template void MbPntMatingData::NormalizeAttachTangent() { - if ( attach && tangent != c3d_null ) { + if ( attach && tangent != nullptr ) { double tangLen = tangent->Length(); if ( tangLen > LENGTH_EPSILON ) (*tangent) /= tangLen; @@ -395,11 +395,11 @@ void MbPntMatingData::GetProperties( MbProperties & properties ) properties.Add( new StringProperty( IDS_PROP_0901, typeName, false ) ); */ - if ( tangent != c3d_null ) + if ( tangent != nullptr ) properties.Add( new MathItemProperty( IDS_PROP_0908, tangent, true ) ); - if ( tangentDer1 != c3d_null ) + if ( tangentDer1 != nullptr ) properties.Add( new MathItemProperty( IDS_PROP_0909, tangentDer1, true ) ); - if ( tangentDer2 != c3d_null ) + if ( tangentDer2 != nullptr ) properties.Add( new MathItemProperty( IDS_PROP_0910, tangentDer2, true ) ); properties.Add( new BoolProperty( IDS_PROP_0911, movePnts, false ) ); @@ -424,7 +424,7 @@ bool IsMatingDefined( const MbPntMatingData * data ) { bool isDefined = false; - if ( data != c3d_null && data->IsValid() ) { + if ( data != nullptr && data->IsValid() ) { if ( data->GetType() > trt_Position ) // \ru по позиции и так выполнится, поэтому считаем не заданным \en would be held at position, so assumed as undefined isDefined = true; } @@ -465,8 +465,8 @@ bool CopyMating( const PointMatingDataPtrVector & src, PointMatingDataPtrVector if ( src.size() > 0 && dst.size() < 1 ) { isDone = true; for ( size_t k = 0, cnt = src.size(); k < cnt && isDone; ++k ) { - MbPntMatingData * copyItem = c3d_null; - if ( src[k] != c3d_null ) { + MbPntMatingData * copyItem = nullptr; + if ( src[k] != nullptr ) { copyItem = new MbPntMatingData(); isDone = copyItem->Init( *src[k] ); } @@ -511,18 +511,18 @@ void TransformMating( const PointMatingDataPtrVector & data, const Matrix & matr for ( size_t k = 0, cnt = data.size(); k < cnt; ++k ) { MbPntMatingData * dataItem = data[k]; - if ( dataItem != c3d_null ) { - if ( dataItem->GetTangent() != c3d_null ) { + if ( dataItem != nullptr ) { + if ( dataItem->GetTangent() != nullptr ) { vect = *dataItem->GetTangent(); vect.Transform( matr ); dataItem->SetVector( 0, vect ); } - if ( dataItem->GetTangentDer1() != c3d_null ) { + if ( dataItem->GetTangentDer1() != nullptr ) { vect = *dataItem->GetTangentDer1(); vect.Transform( matr ); dataItem->SetVector( 1, vect ); } - if ( dataItem->GetTangentDer2() != c3d_null ) { + if ( dataItem->GetTangentDer2() != nullptr ) { vect = *dataItem->GetTangentDer2(); vect.Transform( matr ); dataItem->SetVector( 2, vect ); @@ -542,17 +542,17 @@ void RotateMating( const PointMatingDataPtrVector & data, const Axis & axis, dou for ( size_t i = 0, cnt = data.size(); i < cnt; ++i ) { MbPntMatingData * dataItem = data[i]; - if ( dataItem->GetTangent() != c3d_null ) { + if ( dataItem->GetTangent() != nullptr ) { vect = *dataItem->GetTangent(); vect.Rotate( axis, angle ); dataItem->SetVector( 0, vect ); } - if ( dataItem->GetTangentDer1() != c3d_null ) { + if ( dataItem->GetTangentDer1() != nullptr ) { vect = *dataItem->GetTangentDer1(); vect.Rotate( axis, angle ); dataItem->SetVector( 1, vect ); } - if ( dataItem->GetTangentDer2() != c3d_null ) { + if ( dataItem->GetTangentDer2() != nullptr ) { vect = *dataItem->GetTangentDer2(); vect.Rotate( axis, angle ); dataItem->SetVector( 2, vect ); @@ -573,10 +573,10 @@ void WriteMating( writer & out, const PointMatingDataPtrVector & data ) for ( size_t k = 0; k < cnt && out.good(); k++ ) { const MbPntMatingData * item = data[k]; // \ru наличие сопряжения \en presence of conjugation - bool isItem = (item != c3d_null); + bool isItem = (item != nullptr); out << isItem; - if ( isItem && item->GetChangedPoints() != c3d_null ) { + if ( isItem && item->GetChangedPoints() != nullptr ) { C3D_ASSERT_UNCONDITIONAL( false ); // \ru KYA массив индексов должен быть пуст, т.к. он общий для всех сопряжений, им владеет заказчик операции \en KYA array of indices should be empy because it is shared between all of conjugations and owned by user of operation out.setState( io::cantWriteObject ); } @@ -586,17 +586,17 @@ void WriteMating( writer & out, const PointMatingDataPtrVector & data ) uint32 type = (uint32)item->GetType(); out << type; // \ru касательный вектор \en tangent vector - isItem = (item->GetTangent() != c3d_null); + isItem = (item->GetTangent() != nullptr); out << isItem; if ( isItem ) out << (*item->GetTangent()); // \ru первая производная касательного вектора \en first derivative of tangent vector - isItem = (item->GetTangentDer1() != c3d_null); + isItem = (item->GetTangentDer1() != nullptr); out << isItem; if ( isItem ) out << (*item->GetTangentDer1()); // \ru вторая производная касательного вектора \en second derivative of tangent vector - isItem = (item->GetTangentDer2() != c3d_null); + isItem = (item->GetTangentDer2() != nullptr); out << isItem; if ( isItem ) out << (*item->GetTangentDer2()); @@ -621,7 +621,7 @@ void ReadMating( reader & in, PointMatingDataPtrVector & data ) if ( cnt > 0 ) { data.reserve( data.size() + cnt ); - SArray * dummyInds = c3d_null; + SArray * dummyInds = nullptr; for ( size_t k = 0; k < cnt && in.good(); k++ ) { // \ru наличие сопряжения \en presence of conjugation @@ -633,9 +633,9 @@ void ReadMating( reader & in, PointMatingDataPtrVector & data ) uint32 type = uint32(trt_None); in >> type; - MbVector3D * v1 = c3d_null; - MbVector3D * v2 = c3d_null; - MbVector3D * v3 = c3d_null; + MbVector3D * v1 = nullptr; + MbVector3D * v2 = nullptr; + MbVector3D * v3 = nullptr; // \ru касательный вектор \en tangent vector in >> isItem; @@ -670,7 +670,7 @@ void ReadMating( reader & in, PointMatingDataPtrVector & data ) ::DeleteMatItem( v3 ); } else { - data.push_back( c3d_null ); + data.push_back( nullptr ); } } } @@ -691,21 +691,21 @@ void CopyPntMatingData( const MbPntMatingData & srcData, MbPntMatingD size_t dim = std_min( SrcVector::GetDimension(), DstVector::GetDimension() ); - DstVector * tangent = c3d_null; - DstVector * tangentDer1 = c3d_null; - DstVector * tangentDer2 = c3d_null; + DstVector * tangent = nullptr; + DstVector * tangentDer1 = nullptr; + DstVector * tangentDer2 = nullptr; - if ( srcData.GetTangent() != c3d_null ) { + if ( srcData.GetTangent() != nullptr ) { tangent = new DstVector; for ( size_t k = 0; k < dim; k++ ) (*tangent)[k] = (*srcData.GetTangent())[k]; } - if ( srcData.GetTangentDer1() != c3d_null ) { + if ( srcData.GetTangentDer1() != nullptr ) { tangentDer1 = new DstVector; for ( size_t k = 0; k < dim; k++ ) (*tangentDer1)[k] = (*srcData.GetTangentDer1())[k]; } - if ( srcData.GetTangentDer2() != c3d_null ) { + if ( srcData.GetTangentDer2() != nullptr ) { tangentDer2 = new DstVector; for ( size_t k = 0; k < dim; k++ ) (*tangentDer2)[k] = (*srcData.GetTangentDer2())[k]; diff --git a/C3d/Include/mb_property.h b/C3d/Include/mb_property.h index 3e8529b..779c285 100644 --- a/C3d/Include/mb_property.h +++ b/C3d/Include/mb_property.h @@ -751,8 +751,8 @@ OBVIOUS_PRIVATE_COPY( VersionProperty ) template inline void GetCharValue( const PropType *, const FieldType *, uint32 n, TCHAR * v ) { - C3D_ASSERT( v != c3d_null ); - if ( v != c3d_null ) { + C3D_ASSERT( v != nullptr ); + if ( v != nullptr ) { if ( n == 0 ) { v[0] = _T(' '); v[1] = _T('\0'); @@ -774,8 +774,8 @@ inline void GetCharValue( const PropType *, const FieldType *, uint32 n, TCHAR * template inline void GetCharValue( const PropType *, const MbCartPoint * value, uint32 n, TCHAR * v ) { - C3D_ASSERT( value != c3d_null && v != c3d_null ); - if ( value != c3d_null && v != c3d_null ) { + C3D_ASSERT( value != nullptr && v != nullptr ); + if ( value != nullptr && v != nullptr ) { if ( n == 0 ) _sntprintf( v, 64, _T("%.3f\t%.3f"), value->x, value->y ); else @@ -795,8 +795,8 @@ inline void GetCharValue( const PropType *, const MbCartPoint * value, uint32 n, template inline void GetCharValue( const PropType *, const MbVector * value, uint32 n, TCHAR * v ) { - C3D_ASSERT( value != c3d_null && v != c3d_null ); - if ( value != c3d_null && v != c3d_null ) { + C3D_ASSERT( value != nullptr && v != nullptr ); + if ( value != nullptr && v != nullptr ) { if ( n == 0 ) _sntprintf( v, 64, _T("%.3f\t%.3f"), value->x, value->y ); else @@ -816,8 +816,8 @@ inline void GetCharValue( const PropType *, const MbVector * value, uint32 n, TC template inline void GetCharValue( const PropType *, const MbDirection * value, uint32 n, TCHAR * v ) { - C3D_ASSERT( value != c3d_null && v != c3d_null ); - if ( value != c3d_null && v != c3d_null ) { + C3D_ASSERT( value != nullptr && v != nullptr ); + if ( value != nullptr && v != nullptr ) { double angle(0.0); if ( value->ax==0 && value->ay==0 ) angle = 0.0; @@ -842,8 +842,8 @@ inline void GetCharValue( const PropType *, const MbDirection * value, uint32 n, template inline void GetCharValue( const PropType *, const MbCartPoint3D * value, uint32 n, TCHAR * v ) { - C3D_ASSERT( value != c3d_null && v != c3d_null ); - if ( value != c3d_null && v != c3d_null ) { + C3D_ASSERT( value != nullptr && v != nullptr ); + if ( value != nullptr && v != nullptr ) { if ( n == 0 ) _sntprintf( v, 64, _T("%.3f\t%.3f\t%.3f"), value->x, value->y, value->z ); else @@ -863,8 +863,8 @@ inline void GetCharValue( const PropType *, const MbCartPoint3D * value, uint32 template inline void GetCharValue( const PropType *, const MbVector3D * value, uint32 n, TCHAR * v ) { - C3D_ASSERT( value != c3d_null && v != c3d_null ); - if ( value != c3d_null && v != c3d_null ) { + C3D_ASSERT( value != nullptr && v != nullptr ); + if ( value != nullptr && v != nullptr ) { if ( n == 0 ) _sntprintf( v, 64, _T("%.3f\t%.3f\t%.3f"), value->x, value->y, value->z ); else @@ -884,9 +884,9 @@ inline void GetCharValue( const PropType *, const MbVector3D * value, uint32 n, template inline void GetCharValue( const PropType *, const MbName * value, uint32 n, TCHAR * v ) { - C3D_ASSERT( v != c3d_null ); - if ( v != c3d_null ) { - if ( value != c3d_null ) { + C3D_ASSERT( v != nullptr ); + if ( v != nullptr ) { + if ( value != nullptr ) { c3d::string_t str; value->ToString( str ); diff --git a/C3d/Include/mb_property_title.h b/C3d/Include/mb_property_title.h index 29df45b..c3e4719 100644 --- a/C3d/Include/mb_property_title.h +++ b/C3d/Include/mb_property_title.h @@ -157,6 +157,7 @@ enum MbePrompt IDS_ITEM_0261, ///< \ru Угол к хорде. \en Angle from Chord. IDS_ITEM_0262, ///< \ru Угол к касательной поверхности. \en Angle from Surface Tangent. IDS_ITEM_0263, ///< \ru Угол к нормали поверхности. \en Angle from Surface Normal. + IDS_ITEM_0264, ///< \ru Удлиненная кривая. \en Extended curve. // \ru Типы параметрических поверхностей. \en Types of parametric surfaces. @@ -237,6 +238,7 @@ enum MbePrompt IDS_ITEM_0515, ///< \ru Объединение оболочек. \en Shells union. IDS_ITEM_0516, ///< \ru Пересечение оболочек. \en Shells intersection. IDS_ITEM_0517, ///< \ru Разность оболочек. \en Shells subtraction. + IDS_ITEM_0518, ///< \ru Нормализация отверстия. \en Normalization of hole. IDS_ITEM_0520, ///< \ru Отверстие. \en Hole. IDS_ITEM_0521, ///< \ru Карман/Бобышка. \en Pocket/Boss. @@ -765,6 +767,9 @@ enum MbePrompt IDS_PROP_0424, ///< \ru Резка ребер. \en Edges cutting. IDS_PROP_0425, ///< \ru Резка поверхностей. \en Surfaces cutting. IDS_PROP_0426, ///< \ru Резка граней. \en Faces cutting. + IDS_PROP_0427, ///< \ru Способ продления. \en Extension way. + IDS_PROP_0428, ///< \ru Продлить в начале? \en Extend to start? + IDS_PROP_0429, ///< \ru Площадь. \en Area. IDS_PROP_0450, ///< \ru Начальный радиус (поверхность). \en Start radius (surface). IDS_PROP_0451, ///< \ru Конечный радиус (резьба). \en End radius (thread). @@ -1128,6 +1133,7 @@ enum MbePrompt IDS_PROP_0928, ///< \ru Упрощение граней. \en Faces simplification. IDS_PROP_0929, ///< \ru Разделять оболочку на грани. \en Divide the shell into faces. IDS_PROP_0930, ///< \ru Допустимое несовпадение. \en Permissible mismatch. + IDS_PROP_0931, ///< \ru Совпадение направлений. \en Directions matching. // \ru Конвертеры \en Converters diff --git a/C3d/Include/mb_rect1d.h b/C3d/Include/mb_rect1d.h index eb419de..48d4eda 100644 --- a/C3d/Include/mb_rect1d.h +++ b/C3d/Include/mb_rect1d.h @@ -2,7 +2,7 @@ /** \file \brief \ru Габаритные объекты. Одномерный куб. - \en Bounding box objects. One-dimensional cube. \~ + \en Bounding box objects. One-dimensional box. \~ */ //////////////////////////////////////////////////////////////////////////////// @@ -16,7 +16,7 @@ //------------------------------------------------------------------------------ -/// \ru Одномерный куб \en One-dimensional cube +/// \ru Одномерный куб \en One-dimensional box. /** \ingroup Mathematic_Base_3D */ @@ -36,26 +36,26 @@ public: /// \ru Инициализировать неустановленным. \en Initialize unspecified. void Init ( ); - /// \ru Инициализировать другим кубом. \en Initialize by another cube. + /// \ru Инициализировать другим кубом. \en Initialize by another box. void Init ( const MbRect1D & ); /// \ru Инициализировать заданными значениями границ. \en Initialize by given bounds. void Init ( double pmin, double pmax, bool equalize = true ); - /// \ru Создать вывернутый одномерный куб. \en Create reverted one-dimensional cube. + /// \ru Создать вывернутый одномерный куб. \en Create reverted one-dimensional box. void Invert (); - /// \ru Сократить одномерный куб на заданный коэффициент и расширить на дельта. \en Decrease one-dimensional cube by a given factor and increase by delta. + /// \ru Сократить одномерный куб на заданный коэффициент и расширить на дельта. \en Decrease one-dimensional box by a given factor and increase by delta. void Short ( double, bool bis = true, double delta = LENGTH_EPSILON ); - /// \ru Сократить одномерный куб на заданный коэффициент относительно точки и расширить на дельта. \en Decrease one-dimensional cube by a given factor relative to point and increase by delta. + /// \ru Сократить одномерный куб на заданный коэффициент относительно точки и расширить на дельта. \en Decrease one-dimensional box by a given factor relative to point and increase by delta. void Short ( double, double, bool bis = true, double delta = LENGTH_EPSILON ); /// \ru Включить точку. \en Include point. void Include ( double, bool bis = true, double delta = LENGTH_EPSILON ); - /// \ru Установить куб. \en Set cube. + /// \ru Установить куб. \en Set box. void Include ( const MbRect1D & , bool bis = true, double delta = LENGTH_EPSILON ); /// \ru Включить точку. \en Include point. void IncludeEx ( double ); - /// \ru Установить куб. \en Set cube. + /// \ru Установить куб. \en Set box. void IncludeEx ( const MbRect1D & ); ///< \ru Выровнять диапазон. \en Justify range. @@ -73,14 +73,14 @@ public: bool IsIntersect( double ) const; /// \ru Есть ли пересечение с другим прямоугольником. \en Is there intersection with another rectangle. bool IsIntersect( double, double ) const; - /// \ru Есть ли пересечение с пустым кубом. \en Is there intersection with empty cube. + /// \ru Есть ли пересечение с пустым кубом. \en Is there intersection with empty box. bool IsEmptyInt ( double ) const; - /// \ru Загнать одномерную точку в куб. \en Drive one-dimensional point to cube. + /// \ru Загнать одномерную точку в куб. \en Drive one-dimensional point to box. void SetInR ( double & ) const; - /// \ru Загнать одномерную точку в куб. \en Drive one-dimensional point to cube. + /// \ru Загнать одномерную точку в куб. \en Drive one-dimensional point to box. void SetInRect ( double & ) const; - /// \ru Загнать другую область в куб. \en Drive another region to cube. + /// \ru Загнать другую область в куб. \en Drive another region to box. void SetInRect ( MbRect1D & ) const; /// \ru Получить минимум. \en Get minimum. @@ -92,17 +92,17 @@ public: /// \ru Задать максимум. \en Set maximum. void SetMax( double v ) { zmax = v; } - /// \ru Получить характерный масштаб одномерного куба. \en Get characteristic scale of one-dimensional cube. + /// \ru Получить характерный масштаб одномерного куба. \en Get characteristic scale of one-dimensional box. double GetScale () const; - /// \ru Увеличить куб. \en Increase cube. + /// \ru Увеличить куб. \en Increase box. void Increase ( double ); /// \ru Проверить принадлежность границе первого параметра с точностью, заданной вторым. \en Check if first parameter belongs to bound with tolerance given by second parameter. bool IsBound ( double, double ) const; - /// \ru Cдвинуть куб. \en Move cube. + /// \ru Cдвинуть куб. \en Move box. void Move ( double ); - /// \ru Проверить два куба на равенство с заданной точностью. \en Check equality of two cubes with given tolerance. + /// \ru Проверить два куба на равенство с заданной точностью. \en Check equality of two boxs with given tolerance. bool IsEqual ( const MbRect1D &, double eps ) const; /// \ru Найти габарит пересечения двух габаритов. \en Find bounding box of two bounding boxes intersection. bool Intersection( const MbRect1D &, const MbRect1D &, double eps = LENGTH_EPSILON ); @@ -157,7 +157,7 @@ inline MbRect1D::MbRect1D( double ozmin, double ozmax, bool equalize ) , zmax( ozmax ) { if ( equalize ) - Equalize(); // \ru Выровнять куб \en Justify cube + Equalize(); // \ru Выровнять куб \en Justify box } @@ -189,7 +189,7 @@ inline void MbRect1D::Init( double ozmin, double ozmax, bool equalize ) zmin = ozmin; // \ru Присвоить значения \en Assign values zmax = ozmax; if ( equalize ) - Equalize(); // \ru Выровнять куб \en Justify cube + Equalize(); // \ru Выровнять куб \en Justify box } @@ -204,7 +204,7 @@ inline void MbRect1D::Init( const MbRect1D & other ) //------------------------------------------------------------------------------ -// \ru Сократить одномерный куб на заданный коэфициент \en Decrease one-dimensional cube by given factor +// \ru Сократить одномерный куб на заданный коэфициент \en Decrease one-dimensional box by given factor // --- inline void MbRect1D::Short( double ks, bool bis, double d ) { @@ -219,7 +219,7 @@ inline void MbRect1D::Short( double ks, bool bis, double d ) //------------------------------------------------------------------------------ -// \ru Сократить одномерный куб на заданный коэфициент относительно точки \en Decrease one-dimensional cube by given factor relative to point +// \ru Сократить одномерный куб на заданный коэфициент относительно точки \en Decrease one-dimensional box by given factor relative to point // --- inline void MbRect1D::Short( double ks, double cz, bool bis, double d ) { @@ -266,7 +266,7 @@ inline void MbRect1D::IncludeEx( double other ) //------------------------------------------------------------------------------- -// \ru Установить куб \en Set cube +// \ru Установить куб \en Set box // --- inline void MbRect1D::IncludeEx( const MbRect1D & other ) { @@ -324,7 +324,7 @@ inline bool MbRect1D::IsIntersect( const MbRect1D & other ) const //------------------------------------------------------------------------------ -// \ru Пересечение с пустым кубом \en Is there intersection with empty cube +// \ru Пересечение с пустым кубом \en Is there intersection with empty box // --- inline bool MbRect1D::IsEmptyInt( double other ) const { @@ -333,7 +333,7 @@ inline bool MbRect1D::IsEmptyInt( double other ) const //------------------------------------------------------------------------------ -// \ru Загнать одномерную точку в куб \en Drive one-dimensional point to cube +// \ru Загнать одномерную точку в куб \en Drive one-dimensional point to box // --- inline void MbRect1D::SetInR( double & z ) const { @@ -346,7 +346,7 @@ inline void MbRect1D::SetInR( double & z ) const //------------------------------------------------------------------------------ -// \ru Загнать одномерную точку в куб \en Drive one-dimensional point to cube +// \ru Загнать одномерную точку в куб \en Drive one-dimensional point to box // --- inline void MbRect1D::SetInRect( double & z ) const { @@ -361,7 +361,7 @@ inline void MbRect1D::SetInRect( double & z ) const //------------------------------------------------------------------------------ -// \ru Загнать другую область в куб \en Drive another region to cube +// \ru Загнать другую область в куб \en Drive another region to box // --- inline void MbRect1D::SetInRect( MbRect1D & other ) const { @@ -371,7 +371,7 @@ inline void MbRect1D::SetInRect( MbRect1D & other ) const //------------------------------------------------------------------------------ -// \ru Создать вывернутый одномерный куб \en Create reverted one-dimensional cube +// \ru Создать вывернутый одномерный куб \en Create reverted one-dimensional box // --- inline void MbRect1D::Invert() { @@ -382,7 +382,7 @@ inline void MbRect1D::Invert() //------------------------------------------------------------------------------ -// \ru Получить характерный масштаб одномерного куба \en Get characteristic scale of one-dimensional cube +// \ru Получить характерный масштаб одномерного куба \en Get characteristic scale of one-dimensional box // --- inline double MbRect1D::GetScale() const { @@ -391,7 +391,7 @@ inline double MbRect1D::GetScale() const //------------------------------------------------------------------------------ -// \ru Увеличить куб \en Increase cube +// \ru Увеличить куб \en Increase box // --- inline void MbRect1D::Increase( double delta ) { @@ -420,7 +420,7 @@ inline void MbRect1D::Move( double shift ) //------------------------------------------------------------------------------- -// \ru Равны ли двы куба \en Check if two cubes are equal +// \ru Равны ли двы куба \en Check if two boxes are equal // --- inline bool MbRect1D::IsEqual( const MbRect1D & other, double eps ) const { diff --git a/C3d/Include/mb_rect2d.h b/C3d/Include/mb_rect2d.h index 24a685f..96395ca 100644 --- a/C3d/Include/mb_rect2d.h +++ b/C3d/Include/mb_rect2d.h @@ -2,7 +2,7 @@ /** \file \brief \ru Габаритные объекты. Двумерный и трехмерный кубы. - \en Bounding box objects. Two-dimensional and three-dimensional cubes. \~ + \en Bounding box objects. Two-dimensional and three-dimensional boxs. \~ */ //////////////////////////////////////////////////////////////////////////////// @@ -19,13 +19,13 @@ //////////////////////////////////////////////////////////////////////////////// // -// \ru Двумерный куб \en A two-dimensional cube +// \ru Двумерный куб \en A two-dimensional box // //////////////////////////////////////////////////////////////////////////////// //------------------------------------------------------------------------------ -/// \ru Двумерный куб \en A two-dimensional cube +/// \ru Двумерный куб \en A two-dimensional box /** \ingroup Mathematic_Base_3D */ @@ -55,23 +55,23 @@ public: void Init ( const MbCartPoint &, const MbCartPoint & ); /// \ru Инизиализировать двумя диагональными трехмерными точками. \en Initialize by two diagonal three-dimensional points. void Init ( const MbCartPoint3D &, const MbCartPoint3D & ); - /// \ru Инициализировать другим кубом. \en Initialize by another cube. + /// \ru Инициализировать другим кубом. \en Initialize by another box. void Init ( const MbRect2D & ); - /// \ru Создать вывернутый двумерный куб. \en Create everted two-dimensional cube. + /// \ru Создать вывернутый двумерный куб. \en Create everted two-dimensional box. void Invert (); - /// \ru Сократить двумерный куб на заданный коэфициент. \en Decrease two-dimensional cube by given factor. + /// \ru Сократить двумерный куб на заданный коэфициент. \en Decrease two-dimensional box by given factor. void Short ( double, bool bis = true, double delta = Math::lengthEpsilon ); - /// \ru Сократить двумерный куб на заданный коэфициент. \en Decrease two-dimensional cube by given factor. + /// \ru Сократить двумерный куб на заданный коэфициент. \en Decrease two-dimensional box by given factor. void Short ( double, double, double, bool bis = true, double delta = Math::lengthEpsilon ); - /// \ru Сократить двумерный куб на заданный коэфициент. \en Decrease two-dimensional cube by given factor. + /// \ru Сократить двумерный куб на заданный коэфициент. \en Decrease two-dimensional box by given factor. void Short ( double, const MbCartPoint &, bool bis = true, double delta = Math::lengthEpsilon ); - /// \ru Сократить двумерный куб на заданный коэфициент. \en Decrease two-dimensional cube by given factor. + /// \ru Сократить двумерный куб на заданный коэфициент. \en Decrease two-dimensional box by given factor. void Short ( double, const MbVector &, bool bis = true, double delta = Math::lengthEpsilon ); - /// \ru Сократить двумерный куб на заданный коэфициент. \en Decrease two-dimensional cube by given factor. + /// \ru Сократить двумерный куб на заданный коэфициент. \en Decrease two-dimensional box by given factor. void Short ( double, const MbCartPoint3D &, bool bis = true, double delta = Math::lengthEpsilon ); - /// \ru Сократить двумерный куб на заданный коэфициент. \en Decrease two-dimensional cube by given factor. + /// \ru Сократить двумерный куб на заданный коэфициент. \en Decrease two-dimensional box by given factor. void Short ( double, const MbVector3D &, bool bis = true, double delta = Math::lengthEpsilon ); /// \ru Включить точку. \en Include point. @@ -84,9 +84,9 @@ public: void Include ( const MbCartPoint3D &, bool bis = true, double delta = Math::lengthEpsilon ); /// \ru Включить точку. \en Include point. void Include ( const MbVector3D &, bool bis = true, double delta = Math::lengthEpsilon ); - /// \ru Включить другой двумерный куб. \en Include another two-dimensional cube. + /// \ru Включить другой двумерный куб. \en Include another two-dimensional box. void Include ( const MbRect2D &, bool bis = true, double delta = Math::lengthEpsilon ); - /// \ru Установить двумерный куб. \en Set two-dimensional cube. + /// \ru Установить двумерный куб. \en Set two-dimensional box. void Include ( const MbCartPoint &, const MbCartPoint &, bool bis = true, double delta = Math::lengthEpsilon ); /// \ru Включить точку. \en Include point. @@ -99,9 +99,9 @@ public: void IncludeEx ( const MbCartPoint3D & ); /// \ru Включить точку. \en Include point. void IncludeEx ( const MbVector3D & ); - /// \ru Включить другой двумерный куб. \en Include another two-dimensional cube. + /// \ru Включить другой двумерный куб. \en Include another two-dimensional box. void IncludeEx ( const MbRect2D & ); - /// \ru Установить двумерный куб. \en Set two-dimensional cube. + /// \ru Установить двумерный куб. \en Set two-dimensional box. void IncludeEx ( const MbCartPoint &, const MbCartPoint & ); /// \ru Выровнять область. \en Justify the region. @@ -129,28 +129,28 @@ public: bool IsIntersect( const MbCartPoint3D &, const MbCartPoint3D & ) const; /// \ru Пересекаются ли прямоугольники. \en Check if rectangles intersect. bool IsIntersect( double, double, double, double ) const; - /// \ru Есть ли пересечение с пустым кубом. \en Is there intersection with empty cube. + /// \ru Есть ли пересечение с пустым кубом. \en Is there intersection with empty box. bool IsEmptyInt ( double, double ) const; - /// \ru Есть ли пересечение с пустым кубом. \en Is there intersection with empty cube. + /// \ru Есть ли пересечение с пустым кубом. \en Is there intersection with empty box. bool IsEmptyInt ( const MbVector & ) const; - ///< \ru Есть ли пересечение с пустым кубом. \en Is there intersection with empty cube. + ///< \ru Есть ли пересечение с пустым кубом. \en Is there intersection with empty box. bool IsEmptyInt ( const MbCartPoint & ) const; - /// \ru Есть ли пересечение с пустым кубом. \en Is there intersection with empty cube. + /// \ru Есть ли пересечение с пустым кубом. \en Is there intersection with empty box. bool IsEmptyInt ( const MbVector3D & ) const; - /// \ru Есть ли пересечение с пустым кубом. \en Is there intersection with empty cube. + /// \ru Есть ли пересечение с пустым кубом. \en Is there intersection with empty box. bool IsEmptyInt ( const MbCartPoint3D & ) const; - /// \ru Загнать трехмерную точку в куб. \en Drive three-dimensional point to cube. + /// \ru Загнать трехмерную точку в куб. \en Drive three-dimensional point to box. void SetInRect ( MbCartPoint3D & ) const; - /// \ru Загнать двумерную точку в куб. \en Drive two-dimensional point to cube. + /// \ru Загнать двумерную точку в куб. \en Drive two-dimensional point to box. void SetInRect ( MbCartPoint & ) const; - /// \ru Загнать другой куб в куб. \en Drive another cube to cube. + /// \ru Загнать другой куб в куб. \en Drive another box to box. void SetInRect ( MbRect2D & ) const; - /// \ru Загнать двумерную точку в куб. \en Drive two-dimensional point to cube. + /// \ru Загнать двумерную точку в куб. \en Drive two-dimensional point to box. void SetInRect ( double &, double & ) const; - /// \ru Загнать в куб. \en Drive to cube. + /// \ru Загнать в куб. \en Drive to box. void SetInRectX ( double & ) const; - /// \ru Загнать в куб. \en Drive to cube. + /// \ru Загнать в куб. \en Drive to box. void SetInRectY ( double & ) const; /// \ru Вернуть минимальное значение параметра u. \en Get the minimum value of u. @@ -162,18 +162,18 @@ public: /// \ru Вернуть максимальное значение параметра v. \en Get the maximum value of v. double GetYMax() const { return ry.GetMax(); } - /// \ru Получить характерный масштаб двумерного куба по x. \en Get characteristic scale of two-dimensional cube by x. + /// \ru Получить характерный масштаб двумерного куба по x. \en Get characteristic scale of two-dimensional box by x. double GetScaleX () const; - /// \ru Получить характерный масштаб двумерного куба по y. \en Get characteristic scale of two-dimensional cube by y. + /// \ru Получить характерный масштаб двумерного куба по y. \en Get characteristic scale of two-dimensional box by y. double GetScaleY () const; - /// \ru Получить характерный масштаб двумерного куба. \en Get characteristic scale of two-dimensional cube. + /// \ru Получить характерный масштаб двумерного куба. \en Get characteristic scale of two-dimensional box. double GetScale () const; - /// \ru Увеличить куб по x. \en Increase cube at x. + /// \ru Увеличить куб по x. \en Increase box at x. void IncreaseX ( double ); - /// \ru Увеличить куб по y. \en Increase cube at y. + /// \ru Увеличить куб по y. \en Increase box at y. void IncreaseY ( double ); - ///< \ru Увеличить куб. \en Increase cube. + ///< \ru Увеличить куб. \en Increase box. void Increase ( double ); /// \ru Принадлежит ли границе X первый параметр с точностью заданной вторым. \en Check if value given by the first parameter belongs to X bound with tolerance given by the second parameter. @@ -190,7 +190,7 @@ public: bool IsBound ( const MbCartPoint3D &, double ) const; /// \ru Принадлежит ли границе первый параметр с точностью заданной вторым. \en Check if value given by the first parameter belongs to bound with tolerance given by the second parameter. bool IsBound ( const MbVector3D &, double ) const; - /// \ru Cдвинуть куб. \en Move cube. + /// \ru Cдвинуть куб. \en Move box. void Move ( const MbVector & ); }; @@ -308,7 +308,7 @@ inline void MbRect2D::Init( const MbRect2D &other ) { //------------------------------------------------------------------------------ -// \ru Сократить двумерный куб на заданный коэфициент \en Decrease two-dimensional cube by given factor +// \ru Сократить двумерный куб на заданный коэфициент \en Decrease two-dimensional box by given factor // --- inline void MbRect2D::Short( double ks, bool bis, double d ) { rx.Short( ks, bis, d ); @@ -317,7 +317,7 @@ inline void MbRect2D::Short( double ks, bool bis, double d ) { //------------------------------------------------------------------------------ -// \ru Сократить двумерный куб на заданный коэфициент \en Decrease two-dimensional cube by given factor +// \ru Сократить двумерный куб на заданный коэфициент \en Decrease two-dimensional box by given factor // --- inline void MbRect2D::Short( double ks, double cx, double cy, bool bis, double d ) { rx.Short( ks, cx, bis, d ); @@ -326,7 +326,7 @@ inline void MbRect2D::Short( double ks, double cx, double cy, bool bis, double d //------------------------------------------------------------------------------ -// \ru Сократить двумерный куб на заданный коэфициент \en Decrease two-dimensional cube by given factor +// \ru Сократить двумерный куб на заданный коэфициент \en Decrease two-dimensional box by given factor // --- inline void MbRect2D::Short( double ks, const MbCartPoint &cp, bool bis, double d ) { Short( ks, cp.x, cp.y, bis, d ); @@ -334,7 +334,7 @@ inline void MbRect2D::Short( double ks, const MbCartPoint &cp, bool bis, double //------------------------------------------------------------------------------ -// \ru Сократить двумерный куб на заданный коэфициент \en Decrease two-dimensional cube by given factor +// \ru Сократить двумерный куб на заданный коэфициент \en Decrease two-dimensional box by given factor // --- inline void MbRect2D::Short( double ks, const MbVector &cp, bool bis, double d ) { Short( ks, cp.x, cp.y, bis, d ); @@ -342,7 +342,7 @@ inline void MbRect2D::Short( double ks, const MbVector &cp, bool bis, double d ) //------------------------------------------------------------------------------ -// \ru Сократить двумерный куб на заданный коэфициент \en Decrease two-dimensional cube by given factor +// \ru Сократить двумерный куб на заданный коэфициент \en Decrease two-dimensional box by given factor // --- inline void MbRect2D::Short( double ks, const MbCartPoint3D &cp, bool bis, double d ) { Short( ks, cp.x, cp.y, bis, d ); @@ -350,7 +350,7 @@ inline void MbRect2D::Short( double ks, const MbCartPoint3D &cp, bool bis, doubl //------------------------------------------------------------------------------ -// \ru Сократить двумерный куб на заданный коэфициент \en Decrease two-dimensional cube by given factor +// \ru Сократить двумерный куб на заданный коэфициент \en Decrease two-dimensional box by given factor // --- inline void MbRect2D::Short( double ks, const MbVector3D &cp, bool bis, double d ) { Short( ks, cp.x, cp.y, bis, d ); @@ -399,7 +399,7 @@ inline void MbRect2D::Include( const MbCartPoint3D &other, bool bis, double delt //------------------------------------------------------------------------------ -// \ru Установить двумерный куб \en Set two-dimensional cube +// \ru Установить двумерный куб \en Set two-dimensional box // --- inline void MbRect2D::Include( const MbCartPoint &opmin, const MbCartPoint &opmax, bool bis, double delta ) { Include( opmin, bis, delta ); @@ -408,7 +408,7 @@ inline void MbRect2D::Include( const MbCartPoint &opmin, const MbCartPoint &opma //------------------------------------------------------------------------------ -// \ru Включить другой двумерный куб \en Include another two-dimensional cube +// \ru Включить другой двумерный куб \en Include another two-dimensional box // --- inline void MbRect2D::Include( const MbRect2D &other, bool bis, double delta ) { rx.Include( other.rx, bis, delta ); @@ -458,7 +458,7 @@ inline void MbRect2D::IncludeEx( const MbVector3D &other ) { //------------------------------------------------------------------------------- -// \ru Установить двумерный куб \en Set two-dimensional cube +// \ru Установить двумерный куб \en Set two-dimensional box // --- inline void MbRect2D::IncludeEx( const MbCartPoint &opmin, const MbCartPoint &opmax ) { IncludeEx( opmin ); @@ -467,7 +467,7 @@ inline void MbRect2D::IncludeEx( const MbCartPoint &opmin, const MbCartPoint &op //------------------------------------------------------------------------------- -// \ru Включить другой двумерный куб \en Include another two-dimensional cube +// \ru Включить другой двумерный куб \en Include another two-dimensional box // --- inline void MbRect2D::IncludeEx( const MbRect2D &other ) { rx.IncludeEx( other.rx ); @@ -476,7 +476,7 @@ inline void MbRect2D::IncludeEx( const MbRect2D &other ) { //------------------------------------------------------------------------------ -// \ru Является ли двумерный куб пустым \en Check if two-dimensional cube is empty +// \ru Является ли двумерный куб пустым \en Check if two-dimensional box is empty // --- inline bool MbRect2D::IsEmpty() const { return rx.IsEmpty() || ry.IsEmpty(); @@ -548,7 +548,7 @@ inline bool MbRect2D::IsIntersect( const MbCartPoint3D &other ) const { //------------------------------------------------------------------------------ -// \ru Пересечение с пустым кубом \en Is there intersection with empty cube +// \ru Пересечение с пустым кубом \en Is there intersection with empty box // --- inline bool MbRect2D::IsEmptyInt( double x, double y ) const { return rx.IsEmptyInt( x ) || ry.IsEmptyInt( y ); @@ -556,7 +556,7 @@ inline bool MbRect2D::IsEmptyInt( double x, double y ) const { //------------------------------------------------------------------------------ -// \ru Пересечение с пустым кубом \en Is there intersection with empty cube +// \ru Пересечение с пустым кубом \en Is there intersection with empty box // --- inline bool MbRect2D::IsEmptyInt( const MbVector &p ) const { return IsEmptyInt( p.x, p.y ); @@ -564,7 +564,7 @@ inline bool MbRect2D::IsEmptyInt( const MbVector &p ) const { //------------------------------------------------------------------------------ -// \ru Пересечение с пустым кубом \en Is there intersection with empty cube +// \ru Пересечение с пустым кубом \en Is there intersection with empty box // --- inline bool MbRect2D::IsEmptyInt( const MbCartPoint &p ) const { return IsEmptyInt( p.x, p.y ); @@ -572,7 +572,7 @@ inline bool MbRect2D::IsEmptyInt( const MbCartPoint &p ) const { //------------------------------------------------------------------------------ -// \ru Пересечение с пустым кубом \en Is there intersection with empty cube +// \ru Пересечение с пустым кубом \en Is there intersection with empty box // --- inline bool MbRect2D::IsEmptyInt( const MbVector3D &p ) const { return IsEmptyInt( p.x, p.y ); @@ -580,7 +580,7 @@ inline bool MbRect2D::IsEmptyInt( const MbVector3D &p ) const { //------------------------------------------------------------------------------ -// \ru Пересечение с пустым кубом \en Is there intersection with empty cube +// \ru Пересечение с пустым кубом \en Is there intersection with empty box // --- inline bool MbRect2D::IsEmptyInt( const MbCartPoint3D &p ) const { return IsEmptyInt( p.x, p.y ); @@ -588,7 +588,7 @@ inline bool MbRect2D::IsEmptyInt( const MbCartPoint3D &p ) const { //------------------------------------------------------------------------------ -// \ru Загнать двумерную точку в куб \en Drive two-dimensional point to cube +// \ru Загнать двумерную точку в куб \en Drive two-dimensional point to box // --- inline void MbRect2D::SetInRectX( double &value ) const { rx.SetInRect( value ); @@ -596,7 +596,7 @@ inline void MbRect2D::SetInRectX( double &value ) const { //------------------------------------------------------------------------------ -// \ru Загнать двумерную точку в куб \en Drive two-dimensional point to cube +// \ru Загнать двумерную точку в куб \en Drive two-dimensional point to box // --- inline void MbRect2D::SetInRectY( double &value ) const { ry.SetInRect( value ); @@ -604,7 +604,7 @@ inline void MbRect2D::SetInRectY( double &value ) const { //------------------------------------------------------------------------------ -// \ru Загнать двумерную точку в куб \en Drive two-dimensional point to cube +// \ru Загнать двумерную точку в куб \en Drive two-dimensional point to box // --- inline void MbRect2D::SetInRect( double &x, double &y ) const { rx.SetInRect( x ); @@ -613,7 +613,7 @@ inline void MbRect2D::SetInRect( double &x, double &y ) const { //------------------------------------------------------------------------------ -// \ru Загнать двумерную точку в куб \en Drive two-dimensional point to cube +// \ru Загнать двумерную точку в куб \en Drive two-dimensional point to box // --- inline void MbRect2D::SetInRect( MbCartPoint &p ) const { rx.SetInRect( p.x ); @@ -622,7 +622,7 @@ inline void MbRect2D::SetInRect( MbCartPoint &p ) const { //------------------------------------------------------------------------------ -// \ru Загнать трехмерную точку в куб \en Drive three-dimensional point to cube +// \ru Загнать трехмерную точку в куб \en Drive three-dimensional point to box // --- inline void MbRect2D::SetInRect( MbCartPoint3D &p ) const { rx.SetInRect( p.x ); @@ -631,7 +631,7 @@ inline void MbRect2D::SetInRect( MbCartPoint3D &p ) const { //------------------------------------------------------------------------------ -// \ru Загнать другой куб в куб \en Drive another cube to cube +// \ru Загнать другой куб в куб \en Drive another box to box // --- inline void MbRect2D::SetInRect( MbRect2D &other ) const { rx.SetInRect( other.rx ); @@ -640,7 +640,7 @@ inline void MbRect2D::SetInRect( MbRect2D &other ) const { //------------------------------------------------------------------------------ -// \ru Создать вывернутый двумерный куб \en Create everted two-dimensional cube +// \ru Создать вывернутый двумерный куб \en Create everted two-dimensional box // --- inline void MbRect2D::Invert() { rx.Invert(); @@ -649,7 +649,7 @@ inline void MbRect2D::Invert() { //------------------------------------------------------------------------------ -// \ru Получить характерный масштаб двумрного куба \en Get characteristic scale of two-dimensional cube +// \ru Получить характерный масштаб двумрного куба \en Get characteristic scale of two-dimensional box // --- inline double MbRect2D::GetScaleX() const { return rx.GetScale(); @@ -657,7 +657,7 @@ inline double MbRect2D::GetScaleX() const { //------------------------------------------------------------------------------ -// \ru Получить характерный масштаб двумрного куба \en Get characteristic scale of two-dimensional cube +// \ru Получить характерный масштаб двумрного куба \en Get characteristic scale of two-dimensional box // --- inline double MbRect2D::GetScaleY() const { return ry.GetScale(); @@ -665,7 +665,7 @@ inline double MbRect2D::GetScaleY() const { //------------------------------------------------------------------------------ -// \ru Получить характерный масштаб двумрного куба \en Get characteristic scale of two-dimensional cube +// \ru Получить характерный масштаб двумрного куба \en Get characteristic scale of two-dimensional box // --- inline double MbRect2D::GetScale() const { return rx.GetScale() + ry.GetScale(); @@ -673,7 +673,7 @@ inline double MbRect2D::GetScale() const { //------------------------------------------------------------------------------ -// \ru Увеличить куб \en Increase cube +// \ru Увеличить куб \en Increase box // --- inline void MbRect2D::IncreaseX( double delta ) { rx.Increase( delta ); @@ -681,7 +681,7 @@ inline void MbRect2D::IncreaseX( double delta ) { //------------------------------------------------------------------------------ -// \ru Увеличить куб \en Increase cube +// \ru Увеличить куб \en Increase box // --- inline void MbRect2D::IncreaseY( double delta ) { ry.Increase( delta ); @@ -689,7 +689,7 @@ inline void MbRect2D::IncreaseY( double delta ) { //------------------------------------------------------------------------------ -// \ru Увеличить куб \en Increase cube +// \ru Увеличить куб \en Increase box // --- inline void MbRect2D::Increase( double delta ) { rx.Increase( delta ); @@ -768,13 +768,13 @@ inline void MbRect2D::Move( const MbVector & vShift ) { //////////////////////////////////////////////////////////////////////////////// // -// \ru Трехмерный куб \en Three-dimensional cube +// \ru Трехмерный куб \en Three-dimensional box // //////////////////////////////////////////////////////////////////////////////// //------------------------------------------------------------------------------ -/// \ru Трехмерный куб \en Three-dimensional cube +/// \ru Трехмерный куб \en Three-dimensional box /** \ingroup Mathematic_Base_3D */ diff --git a/C3d/Include/mb_rough.h b/C3d/Include/mb_rough.h index 87b1d0f..ef25c79 100644 --- a/C3d/Include/mb_rough.h +++ b/C3d/Include/mb_rough.h @@ -62,7 +62,7 @@ public: \en \name Common functions of a geometric object. \{ */ virtual MbeSpaceType IsA () const; - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const; + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const; virtual bool IsSame ( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const; virtual bool SetEqual ( const MbSpaceItem & ); @@ -133,12 +133,12 @@ public: \{ */ virtual MbeSpaceType IsA () const; - virtual MbSpaceItem & Duplicate ( MbRegDuplicate * = c3d_null ) const; + virtual MbSpaceItem & Duplicate ( MbRegDuplicate * = nullptr ) const; virtual bool IsSame ( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const; virtual bool SetEqual ( const MbSpaceItem & ); - virtual void Transform ( const MbMatrix3D &, MbRegTransform * = c3d_null ); - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); - virtual void Rotate ( const MbAxis3D &, double, MbRegTransform * = c3d_null ); + virtual void Transform ( const MbMatrix3D &, MbRegTransform * = nullptr ); + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); + virtual void Rotate ( const MbAxis3D &, double, MbRegTransform * = nullptr ); virtual void GetProperties( MbProperties & ); virtual void SetProperties( const MbProperties & ); diff --git a/C3d/Include/mb_symbol.h b/C3d/Include/mb_symbol.h index 4846a28..2a3667b 100644 --- a/C3d/Include/mb_symbol.h +++ b/C3d/Include/mb_symbol.h @@ -123,13 +123,13 @@ public: \{ */ virtual MbeSpaceType IsA() const = 0; virtual MbeSpaceType Type() const; - virtual MbSpaceItem & Duplicate ( MbRegDuplicate * = c3d_null ) const = 0; + virtual MbSpaceItem & Duplicate ( MbRegDuplicate * = nullptr ) const = 0; virtual bool IsSame ( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const = 0; virtual bool IsSimilar ( const MbSpaceItem & ) const; virtual bool SetEqual ( const MbSpaceItem & ) = 0; - virtual void Transform ( const MbMatrix3D &, MbRegTransform * = c3d_null ) = 0; - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ) = 0; - virtual void Rotate ( const MbAxis3D &, double, MbRegTransform * = c3d_null ) = 0; + virtual void Transform ( const MbMatrix3D &, MbRegTransform * = nullptr ) = 0; + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ) = 0; + virtual void Rotate ( const MbAxis3D &, double, MbRegTransform * = nullptr ) = 0; virtual double DistanceToPoint ( const MbCartPoint3D & ) const; virtual void AddYourGabaritTo ( MbCube & ) const {}; virtual void CalculateMesh ( const MbStepData & stepData, const MbFormNote & note, MbMesh & mesh ) const; @@ -239,12 +239,12 @@ public: \en \name Common functions of a geometric object. \{ */ virtual MbeSpaceType IsA () const; - virtual MbSpaceItem & Duplicate ( MbRegDuplicate * = c3d_null ) const; + virtual MbSpaceItem & Duplicate ( MbRegDuplicate * = nullptr ) const; virtual bool IsSame ( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const; virtual bool SetEqual ( const MbSpaceItem & ); - virtual void Transform ( const MbMatrix3D &, MbRegTransform * = c3d_null ); - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); - virtual void Rotate ( const MbAxis3D &, double, MbRegTransform * = c3d_null ); + virtual void Transform ( const MbMatrix3D &, MbRegTransform * = nullptr ); + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); + virtual void Rotate ( const MbAxis3D &, double, MbRegTransform * = nullptr ); virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта. \en Get properties of the object. virtual void SetProperties( const MbProperties & ); // \ru Записать свойства объекта. \en Set properties of the object. diff --git a/C3d/Include/mb_thread.h b/C3d/Include/mb_thread.h index 7d6d709..b822791 100644 --- a/C3d/Include/mb_thread.h +++ b/C3d/Include/mb_thread.h @@ -284,13 +284,13 @@ public: \{ */ virtual MbeSpaceType IsA() const; virtual MbeSpaceType Type() const; - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const; + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const; virtual bool IsSame ( const MbSpaceItem &, double accuracy = LENGTH_EPSILON ) const; virtual bool IsSimilar ( const MbSpaceItem & ) const; virtual bool SetEqual( const MbSpaceItem & ); - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); - virtual void Rotate ( const MbAxis3D &, double, MbRegTransform * = c3d_null ); + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); + virtual void Rotate ( const MbAxis3D &, double, MbRegTransform * = nullptr ); virtual double DistanceToPoint ( const MbCartPoint3D & ) const; virtual void AddYourGabaritTo( MbCube & ) const; virtual void Refresh(); @@ -379,7 +379,7 @@ public : \return \ru true, если имя есть и оно не пустое. \en True if there is name and it is not empty. \~ */ - bool IsName() const { return ((name != c3d_null) ? name->IsEmpty() : false); } + bool IsName() const { return ((name != nullptr) ? name->IsEmpty() : false); } /** \} */ /**\ru \name Функции работы с телами, на которых нарезана резьба. @@ -562,7 +562,7 @@ public : */ bool IsMatedTo( const MbThread & otherThread, const MbThreadedJointCheckParameters & checkParams, - ThreadedJointErrors * thrJointErrors = c3d_null ) const; + ThreadedJointErrors * thrJointErrors = nullptr ) const; /// \ru Принадлежит ли резьба грани. \en Check if thread belongs to face. bool IsFaceThread( const MbFace *, const MbMatrix3D & ) const; @@ -583,8 +583,8 @@ public : \en True if thread belongs to one of solid faces. \~ */ bool IsBodyThread( const MbSolid & solid, const MbMatrix3D & matrix, - c3d::IndicesVector * simObjNumbers = c3d_null, - c3d::IndicesVector * intObjNumbers = c3d_null ) const; + c3d::IndicesVector * simObjNumbers = nullptr, + c3d::IndicesVector * intObjNumbers = nullptr ) const; /** \brief \ru Принадлежит ли резьба телу. \en Check if thread belongs to solid. \~ @@ -612,7 +612,7 @@ public : \return \ru true в случае успеха операции. \en True if the operation is successful. \~ */ - bool AdaptToBody( const MbSolid & solid, const MbMatrix3D & matrix, MbeThrAdapt thrAdapt, const ThreadLimiters * limiters = c3d_null ); + bool AdaptToBody( const MbSolid & solid, const MbMatrix3D & matrix, MbeThrAdapt thrAdapt, const ThreadLimiters * limiters = nullptr ); /** \brief \ru Выдать начало и конец изменённой резьбы относительно исходной. \en Get limit positions of the modified thread in regard to an initial thread. \~ @@ -737,7 +737,7 @@ bool MbThread::FindThreadBodies( const SolidsVector & solids, const MatricesVect MbCube solidCube; for ( size_t i = 0; i < solidsCnt; ++i ) { const MbSolid * solid = solids[i]; - if ( solid != c3d_null && solid->GetShell() != c3d_null ) { + if ( solid != nullptr && solid->GetShell() != nullptr ) { solidCube.SetEmpty(); solid->AddYourGabaritTo( solidCube ); if ( cube.Intersect( solidCube ) && IsBodyThread( *solid, matrices[i] ) ) @@ -788,32 +788,32 @@ bool CheckThreads( ThreadsVector & threads, const MbPlacement3D * placeSec, bool for ( size_t i = threads.size(); i--; ) { MbThread * thr = threads[i]; - if ( (thr == c3d_null) || !thr->IsValid() ) { + if ( (thr == nullptr) || !thr->IsValid() ) { threads.erase( threads.begin() + i ); - thr = c3d_null; + thr = nullptr; } - else if ( checkThreadNames && (thr->GetName() == c3d_null) ) { // C3D-695 : KOMPAS-25125 + else if ( checkThreadNames && (thr->GetName() == nullptr) ) { // C3D-695 : KOMPAS-25125 threads.erase( threads.begin() + i ); - thr = c3d_null; + thr = nullptr; } else { if ( threads.size() > 1 ) { for ( ptrdiff_t j = i - 1; j >= 0; j-- ) { if ( thr == threads[j] ) { - threads[i] = c3d_null; + threads[i] = nullptr; threads.erase( threads.begin() + i ); C3D_ASSERT_UNCONDITIONAL( false ); // Error case! - thr = c3d_null; + thr = nullptr; break; } } } } - if ( thr != c3d_null ) // KOMPAS-37171 + if ( thr != nullptr ) // KOMPAS-37171 thr->DetachWrongBodies(); } - if ( !threads.empty() && (placeSec != c3d_null) ) { + if ( !threads.empty() && (placeSec != nullptr) ) { const MbVector3D & axisZsec = placeSec->GetAxisZ(); for ( size_t i = threads.size(); i--; ) { const MbThread * thr = threads[i]; diff --git a/C3d/Include/mb_variables.h b/C3d/Include/mb_variables.h index 04d8563..3633691 100644 --- a/C3d/Include/mb_variables.h +++ b/C3d/Include/mb_variables.h @@ -648,8 +648,8 @@ extern "C" \en Pointer to the beginning of the buffer. \~ \param[in] bufferSize - \ru Размер буфера, в символах. \en The size of the buffer in characters. \~ - \return \ru Возвращает количество скопированных символов, без учета null-символа. Если buffer == c3d_null возвращается необходимый размер буфера без учета null-символа. - \en Returns the number of copied characters, excluding the null character. If buffer = = c3d_null returns the required buffer size without the null character. \~ + \return \ru Возвращает количество скопированных символов, без учета null-символа. Если buffer == nullptr возвращается необходимый размер буфера без учета null-символа. + \en Returns the number of copied characters, excluding the null character. If buffer = = nullptr returns the required buffer size without the null character. \~ */ extern MATH_FUNC(size_t) GetC3dVersionInfo( char * const buffer, size_t bufferSize ); ///< \ru Информация о версии c3d.dll \en c3d.dll version information @@ -662,8 +662,8 @@ extern "C" \en Pointer to the beginning of the buffer. \~ \param[in] bufferSize - \ru Размер буфера, в символах. \en The size of the buffer in characters. \~ - \return \ru Возвращает количество скопированных символов, без учета null-символа. Если buffer == c3d_null возвращается необходимый размер буфера без учета null-символа. - \en Returns the number of copied characters, excluding the null character. If buffer = = c3d_null returns the required buffer size without the null character. \~ + \return \ru Возвращает количество скопированных символов, без учета null-символа. Если buffer == nullptr возвращается необходимый размер буфера без учета null-символа. + \en Returns the number of copied characters, excluding the null character. If buffer = = nullptr returns the required buffer size without the null character. \~ */ extern MATH_FUNC(size_t) GetC3dBuildInfo( char * const buffer, size_t bufferSize ); ///< \ru Информация о сборке c3d.dll \en c3d.dll building information @@ -684,7 +684,7 @@ inline std::string GetC3dLibInfo( bool needVersionInfo = true ) size_t( *GetLibInfo )( char * const buffer, size_t bufferSize ); GetLibInfo = ( needVersionInfo ) ? GetC3dVersionInfo : GetC3dBuildInfo; - std::vector buffer( GetLibInfo( c3d_null, 1 ) ); + std::vector buffer( GetLibInfo( nullptr, 1 ) ); GetLibInfo( &buffer[0], buffer.size() ); diff --git a/C3d/Include/mesh.h b/C3d/Include/mesh.h index 45f19b0..e9754cd 100644 --- a/C3d/Include/mesh.h +++ b/C3d/Include/mesh.h @@ -43,8 +43,7 @@ typedef std::vector ConstMeshesSPtrVector; узлами (вершинами) в таких структурах данных: множество указателей на триангуляции MbGrid (наборы стыкующихса треугольных и четырёхугольных пластин), множество указателей на полигоны MbPolygon3D (наборы точек, описывающих ломаные линии), - множество указателей на апексы MbApex3D (точки, описывающие положение вершин или объектов-точек).\n - + множество указателей на апексы MbApex3D (точки, описывающие положение вершин или объектов-точек). \en Mesh is an object of geometric model (subclass MbItem) which is the set of primitives #MbPrimitive which approximate some geometric object for speed up rendering, calculation of inertial @@ -55,7 +54,7 @@ typedef std::vector ConstMeshesSPtrVector; nodes (vertices) in the data structures: a set of pointers to triangulations MbGrid (sets of mating triangular and quadrangular plates), a set of pointers to polygons MbPolygon3D (sets of points which describe the polylines), - a set of pointers to apexes MbApex3D (points wich describe the position of vertices or objects-points). \n \~ + a set of pointers to apexes MbApex3D (points wich describe the position of vertices or objects-points). \~ \par \ru Применение Полигональный объект используется для представления геометрических объектов в упрощенном виде, \n @@ -112,10 +111,10 @@ public: // \ru Общие функции геометрического объекта. \en Common functions of a geometric object. virtual MbeSpaceType IsA() const; // \ru Тип объекта. \en Type of the object. - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Создать копию. \en Create a copy. - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать согласно матрице. \en Transform according to the matrix. - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвинуть вдоль вектора. \en Translate along a vector. - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси. \en Rotate around an axis. + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Создать копию. \en Create a copy. + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать согласно матрице. \en Transform according to the matrix. + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвинуть вдоль вектора. \en Translate along a vector. + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси. \en Rotate around an axis. virtual bool IsSame ( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const; // \ru Являются ли объекты равными? \en Determine whether objects are equal. virtual bool SetEqual ( const MbSpaceItem & init ); // \ru Сделать объекты равным. \en Make equal objects. virtual double DistanceToPoint ( const MbCartPoint3D & ) const; // \ru Вычислить расстояние до точки. \en Calculate the distance to a point. @@ -182,21 +181,19 @@ public: gridsVector.reserve( gridsVector.size() + grids.size() ); for( size_t i = 0, iCount = grids.size(); i < iCount; ++i ) { MbGrid * gr = grids[i]; - if ( gr != c3d_null ) { + if ( gr != nullptr ) { gr->DecRef(); gridsVector.push_back( gr ); } } grids.clear(); -#ifdef C3D_STANDARD_CXX_11_PARTIAL grids.shrink_to_fit(); -#endif cube.SetEmpty(); } /// \ru Вернуть указатель на триангуляцию по её номеру. \en Return pointer to triangulation by it number. - const MbGrid * GetGrid( size_t i ) const { return ( (i < grids.size()) ? grids[i]: c3d_null ); } + const MbGrid * GetGrid( size_t i ) const { return ( (i < grids.size()) ? grids[i]: nullptr ); } /// \ru Вернуть указатель на триангуляцию по её номеру для модификации. \en Return the pointer to triangulation by its number to be modified. - MbGrid * SetGrid( size_t i ) { return ( (i < grids.size()) ? grids[i]: c3d_null ); } + MbGrid * SetGrid( size_t i ) { return ( (i < grids.size()) ? grids[i]: nullptr ); } /// \ru Получить указатели на триангуляции. \en Get pointers to triangulations. template void GetGrids( GridsVector & gridsVector ) const @@ -218,14 +215,14 @@ public: for ( k = 0; k < gridsCnt; ++k ) { const MbGrid * grid = grids[k]; - if ( grid != c3d_null ) + if ( grid != nullptr ) addPointsCnt += grid->PointsCount(); } points.reserve( points.size() + addPointsCnt ); for ( k = 0; k < gridsCnt; ++k ) { const MbGrid * grid = grids[k]; - if ( grid != c3d_null ) + if ( grid != nullptr ) grid->GetPoints( points ); } } @@ -243,21 +240,19 @@ public: polyVector.reserve( polyVector.size() + wires.size() ); for( size_t i = 0, iCount = wires.size(); i < iCount; ++i ) { MbPolygon3D * pl = wires[i]; - if ( pl != c3d_null ) { + if ( pl != nullptr ) { pl->DecRef(); polyVector.push_back( pl ); } } wires.clear(); -#ifdef C3D_STANDARD_CXX_11_PARTIAL wires.shrink_to_fit(); -#endif cube.SetEmpty(); } /// \ru Вернуть указатель на полигон по его номеру. \en Return the pointer to polygon by its number. - const MbPolygon3D * GetPolygon( size_t i ) const { return ( (i < wires.size()) ? wires[i]: c3d_null ); } + const MbPolygon3D * GetPolygon( size_t i ) const { return ( (i < wires.size()) ? wires[i]: nullptr ); } /// \ru Вернуть указатель на полигон по его номеру. \en Return the pointer to polygon by its number. - MbPolygon3D * SetPolygon( size_t i ) { return ( (i < wires.size()) ? wires[i]: c3d_null ); } + MbPolygon3D * SetPolygon( size_t i ) { return ( (i < wires.size()) ? wires[i]: nullptr ); } /// \ru Получить указатели на полигоны. \en Get pointers to polygons. template void GetPolygons( PolygonsVector & polyVector ) const { @@ -282,21 +277,19 @@ public: peakVector.reserve( peakVector.size() + peaks.size() ); for( size_t i = 0, iCount = peaks.size(); i < iCount; ++i ) { MbApex3D * peak = peaks[i]; - if ( peak != c3d_null ) { + if ( peak != nullptr ) { peak->DecRef(); peakVector.push_back( peak ); } } peaks.clear(); -#ifdef C3D_STANDARD_CXX_11_PARTIAL peaks.shrink_to_fit(); -#endif cube.SetEmpty(); } /// \ru Вернуть указатель на апекс по его номеру. \en Return the pointer to apex by its number. - const MbApex3D * GetApex( size_t i ) const { return ( (i < peaks.size()) ? peaks[i]: c3d_null ); } + const MbApex3D * GetApex( size_t i ) const { return ( (i < peaks.size()) ? peaks[i]: nullptr ); } /// \ru Вернуть указатель на апекс по его номеру для модификации. \en Return the pointer to apex by its number to be modified. - MbApex3D * SetApex( size_t i ) { return ( (i < peaks.size()) ? peaks[i]: c3d_null ); } + MbApex3D * SetApex( size_t i ) { return ( (i < peaks.size()) ? peaks[i]: nullptr ); } /// \ru Получить указатели на вершины. \en Get pointers to apexes. template void GetApexes( ApexesVector & peakVector ) const { @@ -317,14 +310,14 @@ public: bool AddMesh( const MbMesh &, bool checkSamePointers ); /// \ru Получить пространственный объект, для которого построен полигональный объект. \en Get a spatial object for which a polygonal object is constructed. - const MbSpaceItem * SpaceItem() const { return ((item != c3d_null && item->RefType() == rt_SpaceItem) ? (const MbSpaceItem *)item : c3d_null); } + const MbSpaceItem * SpaceItem() const { return ((item != nullptr && item->RefType() == rt_SpaceItem) ? (const MbSpaceItem *)item : nullptr); } /// \ru Получить двумерный объект, для которого построен полигональный объект. \en Get a two-dimensional object for which a polygonal object is constructed. - const MbPlaneItem * PlaneItem() const { return ((item != c3d_null && item->RefType() == rt_PlaneItem) ? (const MbPlaneItem *)item : c3d_null); } + const MbPlaneItem * PlaneItem() const { return ((item != nullptr && item->RefType() == rt_PlaneItem) ? (const MbPlaneItem *)item : nullptr); } /// \ru Получить объект геометрической модели, для которого построен полигональный объект. \en Get a model geometric object for which a polygonal object is constructed. const MbItem * Item() const { - const MbItem * modelItem = c3d_null; - if ( item != c3d_null ) { + const MbItem * modelItem = nullptr; + if ( item != nullptr ) { MbeRefType refType = item->RefType(); if ( refType == rt_SpaceItem ) { if ( static_cast(item)->Family() == st_Item ) @@ -450,7 +443,7 @@ public: { for ( size_t k = grids.size(); k--; ) { const MbGrid * grid = grids[k]; - if ( c3d_null != grid ) { + if ( nullptr != grid ) { if ( forcedNew || !grid->IsSearchTreeReady() ) grid->CreateSearchTree(); } @@ -465,7 +458,7 @@ public: { for ( size_t k = grids.size(); k--; ) { const MbGrid * grid = grids[k]; - if ( c3d_null != grid ) + if ( nullptr != grid ) grid->DeleteSearchTree(); } } diff --git a/C3d/Include/mesh_grid.h b/C3d/Include/mesh_grid.h index 815f86f..0f5879b 100644 --- a/C3d/Include/mesh_grid.h +++ b/C3d/Include/mesh_grid.h @@ -58,7 +58,7 @@ public: // \ru \name Общие функции примитива. \en \name Common functions of primitive. virtual MbePrimitiveType IsA() const; // \ru Тип объекта. \en A type of an object. - virtual MbExactGrid & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Создать копию объекта. \en Create a copy of the object. + virtual MbExactGrid & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Создать копию объекта. \en Create a copy of the object. virtual void Transform( const MbMatrix3D & ); // \ru Преобразовать сетку согласно матрице. \en Transform mesh according to the matrix. virtual void Move ( const MbVector3D & ); // \ru Сдвиг сетки. \en Move mesh. virtual void Rotate ( const MbAxis3D &, double angle ); // \ru Поворот сетки вокруг оси. \en Rotation of mesh about an axis. @@ -247,17 +247,13 @@ public: // \ru Удалить всю триангуляцию и освободить память. \en Delete all triangulation and free the memory. virtual void HardFlush() { params.clear(); points.clear(); normals.clear(); escorts.clear(); triangles.clear(); quadrangles.clear(); LoopsDelete(); - #ifdef C3D_STANDARD_CXX_11_PARTIAL points.shrink_to_fit(); normals.shrink_to_fit(); params.shrink_to_fit(); escorts.shrink_to_fit(); triangles.shrink_to_fit(); quadrangles.shrink_to_fit(); loops.shrink_to_fit(); - #endif cube.SetEmpty(); DeleteSearchTree(); } // \ru Освободить лишнюю память. \en Free the unnecessary memory. virtual void Adjust() { - #ifdef C3D_STANDARD_CXX_11_PARTIAL points.shrink_to_fit(); normals.shrink_to_fit(); params.shrink_to_fit(); escorts.shrink_to_fit(); triangles.shrink_to_fit(); quadrangles.shrink_to_fit(); loops.shrink_to_fit(); - #endif } // \ru Выдать размер триангуляции в байтах. \en Get size of triangulation in bytes. @@ -277,11 +273,11 @@ public: /// \ru Выдать адрес начала массива. \en Get the address of the beginning of the array. virtual const MbCartPoint * GetExactParamsAddr() const { return &(params[0]); } /// \ru Выдать адрес начала массива. \en Get the address of the beginning of the array. - virtual const MbFloatPoint3D * GetFloatPointsAddr() const { return c3d_null; } + virtual const MbFloatPoint3D * GetFloatPointsAddr() const { return nullptr; } /// \ru Выдать адрес начала массива. \en Get the address of the beginning of the array. - virtual const MbFloatVector3D * GetFloatNormalsAddr() const { return c3d_null; } + virtual const MbFloatVector3D * GetFloatNormalsAddr() const { return nullptr; } /// \ru Выдать адрес начала массива. \en Get the address of the beginning of the array. - virtual const MbFloatPoint * GetFloatParamsAddr() const { return c3d_null; } + virtual const MbFloatPoint * GetFloatParamsAddr() const { return nullptr; } private : // \ru Объявление оператора присваивания без реализации, чтобы не было присваивания по умолчанию. \en The declaration of the assignment operator without implementation, to prevent an assignment by default. @@ -327,7 +323,7 @@ public: // \ru \name Общие функции примитива. \en \name Common functions of primitive. virtual MbePrimitiveType IsA() const; // \ru Тип объекта. \en A type of an object. - virtual MbFloatGrid & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Создать копию объекта. \en Create a copy of the object. + virtual MbFloatGrid & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Создать копию объекта. \en Create a copy of the object. virtual void Transform( const MbMatrix3D & ); // \ru Преобразовать сетку согласно матрице. \en Transform mesh according to the matrix. virtual void Move ( const MbVector3D & ); // \ru Сдвиг сетки. \en Move mesh. virtual void Rotate ( const MbAxis3D &, double angle ); // \ru Поворот сетки вокруг оси. \en Rotation of mesh about an axis. @@ -516,17 +512,13 @@ public: // \ru Удалить всю триангуляцию и освободить память. \en Delete all triangulation and free the memory. virtual void HardFlush() { params.clear(); points.clear(); normals.clear(); escorts.clear(); triangles.clear(); quadrangles.clear(); LoopsDelete(); - #ifdef C3D_STANDARD_CXX_11_PARTIAL points.shrink_to_fit(); normals.shrink_to_fit(); params.shrink_to_fit(); escorts.shrink_to_fit(); triangles.shrink_to_fit(); quadrangles.shrink_to_fit(); loops.shrink_to_fit(); - #endif cube.SetEmpty(); DeleteSearchTree(); } // \ru Освободить лишнюю память. \en Free the unnecessary memory. virtual void Adjust() { - #ifdef C3D_STANDARD_CXX_11_PARTIAL points.shrink_to_fit(); normals.shrink_to_fit(); params.shrink_to_fit(); escorts.shrink_to_fit(); triangles.shrink_to_fit(); quadrangles.shrink_to_fit(); loops.shrink_to_fit(); - #endif } // \ru Выдать размер триангуляции в байтах. \en Get size of triangulation in bytes. @@ -540,11 +532,11 @@ public: virtual void Init( const MbGrid & grid ); /// \ru Выдать адрес начала массива. \en Get the address of the beginning of the array. - virtual const MbCartPoint3D * GetExactPointsAddr() const { return c3d_null; } + virtual const MbCartPoint3D * GetExactPointsAddr() const { return nullptr; } /// \ru Выдать адрес начала массива. \en Get the address of the beginning of the array. - virtual const MbVector3D * GetExactNormalsAddr() const { return c3d_null; } + virtual const MbVector3D * GetExactNormalsAddr() const { return nullptr; } /// \ru Выдать адрес начала массива. \en Get the address of the beginning of the array. - virtual const MbCartPoint * GetExactParamsAddr() const { return c3d_null; } + virtual const MbCartPoint * GetExactParamsAddr() const { return nullptr; } /// \ru Выдать адрес начала массива. \en Get the address of the beginning of the array. virtual const MbFloatPoint3D * GetFloatPointsAddr() const { return &(points[0]); } /// \ru Выдать адрес начала массива. \en Get the address of the beginning of the array. diff --git a/C3d/Include/mesh_plane_grid.h b/C3d/Include/mesh_plane_grid.h index ab1b445..58c967a 100644 --- a/C3d/Include/mesh_plane_grid.h +++ b/C3d/Include/mesh_plane_grid.h @@ -215,7 +215,7 @@ private: intptr_t size; ///< \ru Количество вершин. \en Count of vertices. public: - TriPoly() : vertex( c3d_null ), size( 0 ) {} + TriPoly() : vertex( nullptr ), size( 0 ) {} TriPoly( TriVertex * vert ) : vertex( vert ), size( 0 ) { Resize(); } public: @@ -223,7 +223,7 @@ public: public: intptr_t Size() const { return size; } ///< \ru Размер цепочки вершин \en Size of vertex chain - size_t Index() const { return (vertex != c3d_null) ? vertex->Index() : SYS_MAX_T; } ///< \ru Индекс вершины \en Index of vertex + size_t Index() const { return (vertex != nullptr) ? vertex->Index() : SYS_MAX_T; } ///< \ru Индекс вершины \en Index of vertex TriVertex * This() const { return vertex; } ///< \ru Текущая вершина \en Current vertex TriVertex * Next() const; ///< \ru Следующая вершина \en Next vertex @@ -242,6 +242,8 @@ public: template bool CalculateGab( const SArray & pnts, Gab & rect ) const; + TriPoly * DeleteDegeneratedBridge( MbPlanarGrid & grid ); ///< \ru Удалить вырожденный мостик от текущей вершины. \en Remove the degenerate bridge from the current vertex. + private: void Resize(); ///< \ru Обновление размера \en Set size to zero @@ -301,7 +303,7 @@ protected: // \ru 2 - смедный через ребра на вершинах 2,0 \en 2 - adjacent at edge with vertices 2,0 public: - MbLinkedTri() : MbTri() { neighbors[0] = neighbors[1] = neighbors[2] = c3d_null; }; + MbLinkedTri() : MbTri() { neighbors[0] = neighbors[1] = neighbors[2] = nullptr; }; ~MbLinkedTri() {}; public: MbTri * GetNeighbor( size_t n ) const { return neighbors[n % 3]; } @@ -317,9 +319,9 @@ OBVIOUS_PRIVATE_COPY( MbLinkedTri ) // --- inline bool MbLinkedTri::IsBoundary() const { - bool isBoundary = (neighbors[0] == c3d_null) || - (neighbors[1] == c3d_null) || - (neighbors[2] == c3d_null); + bool isBoundary = (neighbors[0] == nullptr) || + (neighbors[1] == nullptr) || + (neighbors[2] == nullptr); return isBoundary; } // */ diff --git a/C3d/Include/mesh_polygon.h b/C3d/Include/mesh_polygon.h index 84ad5cf..1e6a7a8 100644 --- a/C3d/Include/mesh_polygon.h +++ b/C3d/Include/mesh_polygon.h @@ -51,7 +51,7 @@ public: // \ru Общие функции примитива. \en Common functions of the primitive. virtual MbePrimitiveType IsA() const; // \ru Вернуть тип объекта \en Get the object type. - virtual MbExactPolygon3D & Duplicate( MbRegDuplicate * iReg = c3d_null ) const; // \ru Создать копию объекта \en Create a copy of the object + virtual MbExactPolygon3D & Duplicate( MbRegDuplicate * iReg = nullptr ) const; // \ru Создать копию объекта \en Create a copy of the object virtual void Transform( const MbMatrix3D & ); // \ru Преобразовать полигон согласно матрице \en Transform polygon according to the matrix virtual void Move ( const MbVector3D & ); // \ru Сдвиг полигона \en Translation of the polygon. virtual void Rotate ( const MbAxis3D &, double angle ); // \ru Поворот полигона вокруг оси \en Rotation of the polygon around an axis @@ -69,9 +69,7 @@ public: virtual void Reserve( size_t cnt ) { points.reserve( points.size() + cnt ); } // \ru Удалить лишнюю память. \en Free the unnecessary memory. virtual void Adjust() { - #ifdef C3D_STANDARD_CXX_11_PARTIAL points.shrink_to_fit(); - #endif } // \ru Очистить полигон удалив все точки. \en Clear the polygon by deleting all the points. virtual void Flush(); @@ -177,7 +175,7 @@ public: // \ru Общие функции примитива. \en Common functions of the primitive. virtual MbePrimitiveType IsA() const; // \ru Вернуть тип объекта \en Get the object type. - virtual MbFloatPolygon3D & Duplicate( MbRegDuplicate * iReg = c3d_null ) const; // \ru Создать копию объекта \en Create a copy of the object + virtual MbFloatPolygon3D & Duplicate( MbRegDuplicate * iReg = nullptr ) const; // \ru Создать копию объекта \en Create a copy of the object virtual void Transform( const MbMatrix3D & ); // \ru Преобразовать полигон согласно матрице \en Transform polygon according to the matrix virtual void Move ( const MbVector3D & ); // \ru Сдвиг полигона \en Translation of the polygon. virtual void Rotate ( const MbAxis3D &, double angle ); // \ru Поворот полигона вокруг оси \en Rotation of the polygon around an axis @@ -195,9 +193,7 @@ public: virtual void Reserve( size_t cnt ) { points.reserve( points.size() + cnt ); } // \ru Удалить лишнюю память. \en Free the unnecessary memory. virtual void Adjust() { - #ifdef C3D_STANDARD_CXX_11_PARTIAL points.shrink_to_fit(); - #endif } // \ru Очистить полигон удалив все точки. \en Clear the polygon by deleting all the points. virtual void Flush(); diff --git a/C3d/Include/mesh_primitive.h b/C3d/Include/mesh_primitive.h index 2f7e1c1..d20a0f1 100644 --- a/C3d/Include/mesh_primitive.h +++ b/C3d/Include/mesh_primitive.h @@ -13,6 +13,7 @@ #include #include +#include #include #include #include @@ -30,6 +31,7 @@ class MATH_CLASS MbPolygon; class MATH_CLASS MbFloatAxis3D; class MATH_CLASS MbFloatPoint3D; class MATH_CLASS MbGrid; +class MbGridTopology; struct MbGridSearchTree; @@ -62,6 +64,8 @@ typedef std::vector ConstGridsVector; typedef std::vector GridsSPtrVector; typedef std::vector ConstGridsSPtrVector; + +typedef DPtr GridTopologyPtr; } @@ -149,7 +153,7 @@ public: \return \ru Копия объекта. \en The object copy. \~ */ - virtual MbPrimitive & Duplicate( MbRegDuplicate * iReg = c3d_null ) const = 0; + virtual MbPrimitive & Duplicate( MbRegDuplicate * iReg = nullptr ) const = 0; /** \brief \ru Преобразовать примитив согласно матрице. \en Transform primitive according to the matrix. \~ @@ -246,13 +250,13 @@ public: bool NearestType( MbeSpaceType sType, MbeTopologyType tType, MbePlaneType pType ) const; /// \ru Получить пространственный объект, для которого построен примитив. \en Get spatial object for which the primitive is constructed. - const MbSpaceItem * SpaceItem() const { return ((parentItem != c3d_null && parentItem->RefType() == rt_SpaceItem) ? (const MbSpaceItem *)parentItem : c3d_null); } + const MbSpaceItem * SpaceItem() const { return ((parentItem != nullptr && parentItem->RefType() == rt_SpaceItem) ? (const MbSpaceItem *)parentItem : nullptr); } /// \ru Получить двумерный объект, для которого построен примитив. \en Get two-dimensional object for which the primitive is constructed. - const MbPlaneItem * PlaneItem() const { return ((parentItem != c3d_null && parentItem->RefType() == rt_PlaneItem) ? (const MbPlaneItem *)parentItem : c3d_null); } + const MbPlaneItem * PlaneItem() const { return ((parentItem != nullptr && parentItem->RefType() == rt_PlaneItem) ? (const MbPlaneItem *)parentItem : nullptr); } /// \ru Получить топологический объект, для которого построен примитив. \en Get the topological object for which the primitive is constructed. - const MbTopItem * TopItem() const { return ((parentItem != c3d_null && parentItem->RefType() == rt_TopItem) ? (const MbTopItem *)parentItem : c3d_null); } + const MbTopItem * TopItem() const { return ((parentItem != nullptr && parentItem->RefType() == rt_TopItem) ? (const MbTopItem *)parentItem : nullptr); } /// \ru Получить объект геометрической модели, для которого построен примитив. \en Get geometric model object for which the primitive is constructed. - const MbItem * Item() const { return ((parentItem != c3d_null && parentItem->RefType() == rt_SpaceItem) ? (static_cast(parentItem)) : c3d_null); } + const MbItem * Item() const { return ((parentItem != nullptr && parentItem->RefType() == rt_SpaceItem) ? (static_cast(parentItem)) : nullptr); } /// \ru Чтение примитива из потока. \en Reading of primitive from the stream. void PrimitiveRead ( reader & ); @@ -291,7 +295,7 @@ public: // \ru Общие функции примитива. \en Common functions of the primitive. virtual MbePrimitiveType Type() const; // \ru Тип объекта. \en A type of an object. virtual MbePrimitiveType IsA() const = 0; // \ru Тип объекта. \en A type of an object. - virtual MbApex3D & Duplicate( MbRegDuplicate * = c3d_null ) const = 0; // \ru Создать копию объекта. \en Create a copy of the object. + virtual MbApex3D & Duplicate( MbRegDuplicate * = nullptr ) const = 0; // \ru Создать копию объекта. \en Create a copy of the object. virtual void Transform( const MbMatrix3D & ) = 0; // \ru Преобразовать согласно матрице. \en Transform according to the matrix. virtual void Move ( const MbVector3D & ) = 0; // \ru Сдвинуть вдоль вектора. \en Translate along a vector. virtual void Rotate ( const MbAxis3D &, double angle ) = 0; // \ru Повернуть вокруг оси на угол. \en Rotate about an axis by an angle. @@ -356,7 +360,7 @@ public: // \ru Общие функции примитива. \en Common functions of the primitive. virtual MbePrimitiveType IsA() const; // \ru Тип объекта. \en A type of an object. - virtual MbExactApex3D & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Создать копию объекта. \en Create a copy of the object. + virtual MbExactApex3D & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Создать копию объекта. \en Create a copy of the object. virtual void Transform( const MbMatrix3D & ); // \ru Преобразовать согласно матрице. \en Transform according to the matrix. virtual void Move ( const MbVector3D & ); // \ru Сдвинуть вдоль вектора. \en Translate along a vector. virtual void Rotate ( const MbAxis3D &, double angle ); // \ru Повернуть вокруг оси на угол. \en Rotate about an axis by an angle. @@ -422,7 +426,7 @@ public: // \ru Общие функции примитива. \en Common functions of the primitive. virtual MbePrimitiveType IsA() const; // \ru Тип объекта. \en A type of an object. - virtual MbFloatApex3D & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Создать копию объекта. \en Create a copy of the object. + virtual MbFloatApex3D & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Создать копию объекта. \en Create a copy of the object. virtual void Transform( const MbMatrix3D & ); // \ru Преобразовать согласно матрице. \en Transform according to the matrix. virtual void Move ( const MbVector3D & ); // \ru Сдвинуть вдоль вектора. \en Translate along a vector. virtual void Rotate ( const MbAxis3D &, double angle ); // \ru Повернуть вокруг оси на угол. \en Rotate about an axis by an angle. @@ -493,7 +497,7 @@ public: // \ru Общие функции примитива. \en Common functions of the primitive. virtual MbePrimitiveType Type() const; // \ru Вернуть тип объекта \en Get the object type. virtual MbePrimitiveType IsA() const = 0; // \ru Вернуть тип объекта \en Get the object type. - virtual MbPolygon3D & Duplicate( MbRegDuplicate * = c3d_null ) const = 0; // \ru Создать копию объекта \en Create a copy of the object + virtual MbPolygon3D & Duplicate( MbRegDuplicate * = nullptr ) const = 0; // \ru Создать копию объекта \en Create a copy of the object virtual void Transform( const MbMatrix3D & ) = 0; // \ru Преобразовать полигон согласно матрице \en Transform polygon according to the matrix virtual void Move ( const MbVector3D & ) = 0; // \ru Сдвиг полигона \en Translation of the polygon. virtual void Rotate ( const MbAxis3D &, double angle ) = 0; // \ru Поворот полигона вокруг оси \en Rotation of the polygon around an axis @@ -645,14 +649,15 @@ protected: std::vector triangles; ///< \ru Индексное множество треугольных пластин содержит номера элементов множества params и/или множеств points и normals. \en Set of triangular plates contains numbers of elements of 'params' set and/or of 'points' and 'normals' sets. std::vector quadrangles; ///< \ru Индексное множество четырёхугольных пластин содержит номера элементов множества params и/или множеств points и normals. \en Set of quadrangular plates contains numbers of elements of 'params' set and/or of 'points' and 'normals' sets. std::vector loops; ///< \ru Индексное множество граничных циклов триангуляции содержит номера элементов множества points и/или params. Объект владеет элементами множества. \en Set of bounding loops contains numbers of elements of 'points' set and/or of 'params' set. Ownership of elements of set. - MbStepData stepData; ///< \ru Параметр расчета триангуляции. \en Parameter of triangulation calculation. + MbStepData stepData; ///< \ru Параметр расчета триангуляции. \en Parameter of triangulation calculation. /** \brief \ru Габаритный куб объекта. \en Bounding box of object. \~ \details \ru Габаритный куб объекта рассчитывается только при запросе габарита объекта. Габаритный куб в конструкторе объекта и после модификации объекта принимает неопределенное значение. \en Bounding box of object is calculated only at the request. Bounding box of object is undefined after object constructor and after object modifications \n \~ */ mutable MbCube cube; - mutable MbGridSearchTree * searchTree; ///< \ru Дерево поиска элементов. \en Elements search tree. + mutable MbGridSearchTree * searchTree; ///< \ru Дерево поиска элементов. \en Elements search tree. + mutable c3d::GridTopologyPtr topo; ///< \ru Дополнительная информация о топологии триангуляции. \en Additional information about a topology of the triangulation. protected: // \ru Объявление конструктора копирования без реализации, чтобы не было копирования по умолчанию. \en The copy constructor without implementation prevents from copying by default. @@ -672,7 +677,7 @@ public: \{ */ virtual MbePrimitiveType Type() const; // \ru Тип объекта. \en A type of an object. virtual MbePrimitiveType IsA() const = 0; // \ru Тип объекта. \en A type of an object. - virtual MbGrid & Duplicate( MbRegDuplicate * = c3d_null ) const = 0; // \ru Создать копию объекта. \en Create a copy of the object. + virtual MbGrid & Duplicate( MbRegDuplicate * = nullptr ) const = 0; // \ru Создать копию объекта. \en Create a copy of the object. virtual void Transform( const MbMatrix3D & ) = 0; // \ru Преобразовать сетку согласно матрице. \en Transform mesh according to the matrix. virtual void Move ( const MbVector3D & ) = 0; // \ru Сдвиг сетки. \en Move mesh. virtual void Rotate ( const MbAxis3D &, double angle ) = 0; // \ru Поворот сетки вокруг оси. \en Rotation of mesh about an axis. @@ -746,6 +751,7 @@ public: AddPoint( pnts[k] ); } DeleteSearchTree(); + ResetGridTopology(); cube.SetEmpty(); } /// \ru Добавить в триангуляцию нормали. \en Add normals to triangulation. @@ -777,6 +783,7 @@ public: for ( size_t k = 0; k < addCnt; ++k ) triangles.push_back( trngs[k] ); DeleteSearchTree(); + ResetGridTopology(); } /// \ru Добавить в триангуляцию объекты. \en Add objects to triangulation. template @@ -787,6 +794,7 @@ public: for ( size_t k = 0; k < addCnt; ++k ) quadrangles.push_back( qrngs[k] ); DeleteSearchTree(); + ResetGridTopology(); } /// \ru Добавить в коллекцию данных. \en Add scores to collection. @@ -857,14 +865,14 @@ public: virtual void NormalsInvert() = 0; // \ru Добавить треугольник. \en Add a triangle. - void AddTriangle ( const MbTriangle & triangle ) { triangles.push_back( triangle ); DeleteSearchTree(); } + void AddTriangle ( const MbTriangle & triangle ) { triangles.push_back( triangle ); DeleteSearchTree(); ResetGridTopology(); } // \ru Добавить треугольник с заданными номерами вершин. \en Add a triangle by the given indices of vertices - void AddTriangle ( uint j0, uint j1, uint j2, bool o ) { MbTriangle t(j0,j1,j2,o); triangles.push_back( t ); DeleteSearchTree(); } + void AddTriangle ( uint j0, uint j1, uint j2, bool o ) { MbTriangle t(j0,j1,j2,o); triangles.push_back( t ); DeleteSearchTree(); ResetGridTopology(); } // \ru Добавить четырёхугольник. \en Add a quadrangle. - void AddQuadrangle( const MbQuadrangle & quadrangle ) { quadrangles.push_back( quadrangle ); DeleteSearchTree(); } + void AddQuadrangle( const MbQuadrangle & quadrangle ) { quadrangles.push_back( quadrangle ); DeleteSearchTree(); ResetGridTopology(); } // \ru Добавить четырёхугольник с заданными номерами вершин. \en Add a quadrangle by the given indices of vertices. - void AddQuadrangle( uint j0, uint j1, uint j2, uint j3, bool o ) { MbQuadrangle t(j0,j1,j2,j3,o); quadrangles.push_back( t ); DeleteSearchTree(); } + void AddQuadrangle( uint j0, uint j1, uint j2, uint j3, bool o ) { MbQuadrangle t(j0,j1,j2,j3,o); quadrangles.push_back( t ); DeleteSearchTree(); ResetGridTopology(); } // \ru Добавить полигон. \en Add a polygon. void AddGridLoop ( MbGridLoop & poly ) { loops.push_back( &poly ); } @@ -974,6 +982,9 @@ public: /// \ru Преобразовать все объекты в треугольники и уравнять число точек и нормалей. \en Convert all objects to triangles and equalize count of points and count of normals. void ConvertAllToTriangles(); + // \ru Вывернуть треугольник относительно заданного ребра. \en Flip triangle around given edge. + bool FlipTriangle( size_t triIndex, size_t edgeIndex ); + /// \ru Определить, пересекается ли проекция на глобальную плоскость XY треугольника с заданным номером с присланным прямоугольником. \en Determine whether the projection of triangle with a given index to the global XY-plane intersects the given rectangle. virtual bool TriangleIntersectRect( size_t i, MbRect & rect ) const = 0; /// \ru Рассчитать габаритный прямоугольник проекции на глобальную плоскость XY треугольника с заданным номером. \en Determine bounding box of the projection of triangle with given index to the global XY-plane. @@ -1086,9 +1097,9 @@ public: virtual void Init( const MbGrid & grid ) = 0; /// \ru Выдать адрес начала массива. \en Get the address of the beginning of the array. - const MbTriangle * GetTrianglesAddr() const { return (!triangles.empty() ? &(triangles[0]) : c3d_null); } + const MbTriangle * GetTrianglesAddr() const { return (!triangles.empty() ? &(triangles[0]) : nullptr); } /// \ru Выдать адрес начала массива. \en Get the address of the beginning of the array. - const MbQuadrangle * GetQuadranglesAddr() const { return (!quadrangles.empty() ? &(quadrangles[0]) : c3d_null); } + const MbQuadrangle * GetQuadranglesAddr() const { return (!quadrangles.empty() ? &(quadrangles[0]) : nullptr); } /// \ru Выдать адрес начала массива. \en Get the address of the beginning of the array. virtual const MbCartPoint3D * GetExactPointsAddr() const = 0; /// \ru Выдать адрес начала массива. \en Get the address of the beginning of the array. @@ -1113,7 +1124,7 @@ public: bool FindTrianglesByPoint( uint ind, c3d::IndicesVector & ) const; /// \ru Дать объекты, содержащие указанный индекс точки. \ en Get all quadrangles with point index ind. bool FindQuadranglesByPoint( uint ind, c3d::IndicesVector & ) const; - /// \ru Сделать триангуляцию односвязной. \ en Make simply connected triangulation (make cuts from outer loop to iner loops with duplicated points of cuts). + /// \ru Сделать триангуляцию односвязной. \ en Make simply connected triangulation (make cuts from outer loop to inner loops with duplicated points of cuts). bool MakeSimplyConnected(); public: @@ -1125,6 +1136,12 @@ public: void DeleteSearchTree() const; /// \ru Найти индексы треугольников и четырехугольников, потенциально пересекающихся с лучом. \en Find indices of triangles and quadrangles potentially intersecting with a ray. bool FindIntersectElements( const MbAxis3D & ray, c3d::IndicesVector & triIndices, c3d::IndicesVector & quadIndices, double eps = METRIC_EPSILON ) const; + /// \ru Готова ли топология триангуляции. \en Whether information about triangulation topology is ready. + bool IsGridTopologyReady() const { return topo != nullptr; } + /// \ru Создать новый временный объект информации о топологии. \en Create new temporary maintenance object information about triangulation topology. + const MbGridTopology * CreateGridTopology( bool keepExisting ) const; + /// \ru Удалить информацию о топологии. \en Delete a information about triangulation topology. + void ResetGridTopology() const; protected: /// \ru Переместить дерево поиска элементов. \en Move elements search tree. void MoveSearchTree( const MbVector3D & ) const; diff --git a/C3d/Include/mesh_triangle.h b/C3d/Include/mesh_triangle.h index 2d2e1a0..adf1946 100644 --- a/C3d/Include/mesh_triangle.h +++ b/C3d/Include/mesh_triangle.h @@ -81,6 +81,8 @@ public : uint GetIndex( size_t n ) const { return pIndex[n % 3]; } /// \ru Инвертировать последовательность вершин. \en Reverse the sequence of vertices. void Reverse(); + /// \ru Инвертировать последовательность вершин в заданном номером ребра порядке. \en Reverse the sequence of vertices with given by edge order. + bool FlipByEdge( size_t edgeIndex ); /// \ru Определить, пересекается ли проекция на глобальную плоскость XY треугольника с присланным прямоугольником. \en Determine whether the projection of the triangle to the global XY-plane intersects the given rectangle. template @@ -179,6 +181,18 @@ inline void MbTriangle::Reverse() } +//------------------------------------------------------------------------------ +// \ru Инвертировать последовательность вершин в заданном номером ребра порядке. \en Reverse the sequence of vertices with given by edge order. +// --- +inline bool MbTriangle::FlipByEdge( size_t edgeIndex ) { + if ( edgeIndex < 3 ) { + std::swap( pIndex[edgeIndex], pIndex[(edgeIndex + 1) % 3] ); + return true; + } + return false; +} + + //////////////////////////////////////////////////////////////////////////////// /** \brief \ru Четырёхугольник. \en Quadrangle. \~ diff --git a/C3d/Include/mip_solid_mass_inertia.h b/C3d/Include/mip_solid_mass_inertia.h index f1b360a..ff5eedf 100644 --- a/C3d/Include/mip_solid_mass_inertia.h +++ b/C3d/Include/mip_solid_mass_inertia.h @@ -332,7 +332,7 @@ private : const MbSolid & solid; ///< \ru Тело. \en A solid. double density; ///< \ru Плотность или удельная масса на единицу площади. \en Density or mass per unit square. MbMatrix3D matrix; ///< \ru Матрица преобразования тела в систему ближайшей сборки (хозяина). \en A matrix of solid transformation to the coordinate system of nearest assembly (owner). - InertiaProperties * properties; ///< \ru Характеристики тела (может быть c3d_null). \en Solid properties (can be c3d_null). + InertiaProperties * properties; ///< \ru Характеристики тела (может быть nullptr). \en Solid properties (can be nullptr). bool ready; ///< \ru Флаг, показывающий, что характеристики не требуется считать. \en Flag of already calculated properties. public: @@ -395,7 +395,7 @@ public: \en A run progress indicator. For termination of slow computations. \~ */ void CalculateAdditiveValues( double deviateAngle, InertiaProperties & mp, - IfProgressIndicator * progress = c3d_null ) const; + IfProgressIndicator * progress = nullptr ) const; /** \} */ // \ru Объявление конструктора копирования и оператора присваивания без реализации, чтобы не было присваивания по умолчанию. \en The declaration without Implementation of the copy constructor and assignment operator to prevent an assignment by default. @@ -416,7 +416,7 @@ private : RPArray assemblies; ///< \ru Подсборки. \en Subassemblies. RPArray solids; ///< \ru Тела сборки. \en Solids in an assembly. MbMatrix3D matrix; ///< \ru Матрица преобразования сборки в систему ближайшей сборки (хозяина). \en A matrix of assembly transformation to the coordinate system of nearest assembly (owner). - InertiaProperties * properties; ///< \ru Характеристики сборки (может быть c3d_null). \en Assembly properties (can be c3d_null). + InertiaProperties * properties; ///< \ru Характеристики сборки (может быть nullptr). \en Assembly properties (can be nullptr). bool ready; ///< \ru Характеристики не требуется считать. \en Properties already calculated. public: @@ -488,7 +488,7 @@ public: \en A run progress indicator. For termination of slow computations. \~ */ void CalculateAdditiveValues( double deviateAngle, InertiaProperties & mp, - IfProgressIndicator * progress = c3d_null ) const; + IfProgressIndicator * progress = nullptr ) const; /** \} */ // \ru Объявление конструктора копирования и оператора присваивания без реализации, чтобы не было присваивания по умолчанию. \en The declaration without Implementation of the copy constructor and assignment operator to prevent an assignment by default. @@ -520,7 +520,7 @@ MATH_FUNC (void) MassInertiaProperties( const MbSolid * solid, double density, double deviateAngle, // (0.35 - 0.01) InertiaProperties & mp, - IfProgressIndicator * progress = c3d_null ); + IfProgressIndicator * progress = nullptr ); //------------------------------------------------------------------------------ @@ -540,9 +540,9 @@ MATH_FUNC (void) MassInertiaProperties( const MbSolid * solid, Количество элементов в массиве должно совпадать с количеством тел. \en Matrices of solids transformation to global coordinate system.\n Count of elements in array must be equal to count of solids. \~ - \param[in] mpSolids - \ru Имеющиеся характеристики тел. Может содержать c3d_null.\n + \param[in] mpSolids - \ru Имеющиеся характеристики тел. Может содержать nullptr.\n Количество элементов в массиве должно совпадать с количеством тел. - \en Calculated properties of solids. Can contain c3d_null.\n + \en Calculated properties of solids. Can contain nullptr.\n Count of elements in array must be equal to count of solids. \~ \param[in] deviateAngle - \ru Параметр управления точностью расчёта - угловое отклонение нормали поверхности или касательных кривой на участке численного интегрирования. \en Tolerance - the angular deviation of surface or curve in the neighboring points on the region of numerical integration. \~ @@ -559,7 +559,7 @@ MATH_FUNC (void) MassInertiaProperties( const RPArray & solid const RPArray & mpSolids, double deviateAngle, // (0.35 - 0.01) InertiaProperties & mp, - IfProgressIndicator * progress = c3d_null ); + IfProgressIndicator * progress = nullptr ); //------------------------------------------------------------------------------ @@ -583,7 +583,7 @@ MATH_FUNC (void) MassInertiaProperties( const RPArray & solid MATH_FUNC (void) MassInertiaProperties( const AssemblyMIAttire & assembly, double deviateAngle, // (0.35 - 0.01) InertiaProperties & mp, - IfProgressIndicator * progress = c3d_null ); + IfProgressIndicator * progress = nullptr ); //------------------------------------------------------------------------------ diff --git a/C3d/Include/model.h b/C3d/Include/model.h index 655ef74..becdfc9 100644 --- a/C3d/Include/model.h +++ b/C3d/Include/model.h @@ -83,13 +83,13 @@ public : virtual MbeImplicationType ImplicationType() const; /// \ru Создать копию. \en Create a copy. - MbModel & Duplicate( MbRegDuplicate * = c3d_null ) const; + MbModel & Duplicate( MbRegDuplicate * = nullptr ) const; /// \ru Преобразовать согласно матрице. \en Transform according to the matrix. - void Transform( const MbMatrix3D &, MbRegTransform * iReg = c3d_null ); + void Transform( const MbMatrix3D &, MbRegTransform * iReg = nullptr ); /// \ru Сдвинуть вдоль вектора. \en Translate along a vector. - void Move ( const MbVector3D &, MbRegTransform * iReg = c3d_null ); + void Move ( const MbVector3D &, MbRegTransform * iReg = nullptr ); /// \ru Повернуть вокруг оси. \en Rotate about an axis. - void Rotate ( const MbAxis3D &, double angle, MbRegTransform * iReg = c3d_null ); + void Rotate ( const MbAxis3D &, double angle, MbRegTransform * iReg = nullptr ); /// \ru Вычислить расстояние до точки. \en Calculate the distance to a point. double DistanceToPoint ( const MbCartPoint3D & ) const; /// \ru Добавь свой габарит в габаритный куб. \en Include your own bounding box into bounding box. @@ -459,11 +459,11 @@ public : \en General-purpose algorithm traversing the model graph in depth. */ void Traverse( ItModelVisitor & ) const; /// \ru Преобразовать селектирование объекты по матрице. \en Transform selected objects by matrix. - void TransformSelected( const MbMatrix3D &, MbRegTransform * = c3d_null ); + void TransformSelected( const MbMatrix3D &, MbRegTransform * = nullptr ); /// \ru Сдвинуть выбранные объекты. \en Move selected objects. - void MoveSelected( const MbVector3D &, MbRegTransform * = c3d_null ); + void MoveSelected( const MbVector3D &, MbRegTransform * = nullptr ); /// \ru Повернуть выбранные объекты вокруг оси. \en Rotate selected objects around an axis. - void RotateSelected( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); + void RotateSelected( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); /** \brief \ru Отцепить все выбранные объекты. \en Detach all selected objects. \~ @@ -592,7 +592,7 @@ void MbModel::GetItems( Items & items ) const { items.reserve( modelItems.size() ); for ( NameItemArray::const_iterator iter = modelItems.begin(); iter != modelItems.end(); ++iter ) { - if ( iter->second != c3d_null ) + if ( iter->second != nullptr ) items.push_back( iter->second ); } } @@ -608,7 +608,7 @@ void MbModel::DetachItems( Items & items ) NameItemArray::const_iterator endItem = modelItems.end(); for ( ; iter != endItem; ++iter ) { MbItem * item = iter->second; - if ( item != c3d_null ) { + if ( item != nullptr ) { item->DecRef(); items.push_back( item ); } diff --git a/C3d/Include/model_item.h b/C3d/Include/model_item.h index b97b564..75fc8f1 100644 --- a/C3d/Include/model_item.h +++ b/C3d/Include/model_item.h @@ -118,10 +118,10 @@ public : virtual MbeSpaceType Type() const; // \ru Групповой тип объекта. \en Group type of object. virtual MbeSpaceType Family() const; // \ru Семейство объекта. \en Family of object. virtual MbeImplicationType ImplicationType() const; // \ru Тип контейнера атрибутов - классификатор наследников. \en Type of an attribute container is a classifier of inheritors. - virtual MbSpaceItem & Duplicate ( MbRegDuplicate * = c3d_null ) const = 0; // \ru Создать копию. \en Create a copy. - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ) = 0; // \ru Преобразовать согласно матрице. \en Transform according to the matrix. - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ) = 0; // \ru Сдвинуть вдоль вектора. \en Translate along a vector. - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ) = 0; // \ru Повернуть вокруг оси. \en Rotate about an axis. + virtual MbSpaceItem & Duplicate ( MbRegDuplicate * = nullptr ) const = 0; // \ru Создать копию. \en Create a copy. + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ) = 0; // \ru Преобразовать согласно матрице. \en Transform according to the matrix. + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ) = 0; // \ru Сдвинуть вдоль вектора. \en Translate along a vector. + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ) = 0; // \ru Повернуть вокруг оси. \en Rotate about an axis. virtual bool IsSame ( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const = 0; // \ru Являются ли объекты равными? \en Are the objects equal? virtual bool SetEqual ( const MbSpaceItem & init ) = 0; // \ru Сделать объекты равными. \en Make the objects equal. virtual double DistanceToPoint ( const MbCartPoint3D & ) const = 0; // \ru Вычислить расстояние до точки. \en Calculate the distance to a point. @@ -171,8 +171,8 @@ public : \en Create object by the history tree. \~ \param[in] sameShell - \ru Полнота копирования элементов. \en Whether to perform complete copying of elements while constructing. \~ - \param[out] items - \ru Контейнер для складывания элементов невыполненных построений (может быть c3d_null). - \en Container for the elements of not performed constructions (can be c3d_null). \~ + \param[out] items - \ru Контейнер для складывания элементов невыполненных построений (может быть nullptr). + \en Container for the elements of not performed constructions (can be nullptr). \~ \return \ru Перестроен ли объект. \en Whether an object is constructed. \~ \ingroup Model_Items @@ -437,7 +437,7 @@ public : \en Registrator. \~ \ingroup Model_Items */ - virtual void TransformSelected( const MbMatrix3D & matr, MbRegTransform * iReg = c3d_null ); + virtual void TransformSelected( const MbMatrix3D & matr, MbRegTransform * iReg = nullptr ); /** \brief \ru Сдвинуть выбранный объект вдоль вектора. \en Move selected object along a vector. \~ @@ -451,7 +451,7 @@ public : \en Registrator. \~ \ingroup Model_Items */ - virtual void MoveSelected( const MbVector3D & to, MbRegTransform * iReg = c3d_null ); + virtual void MoveSelected( const MbVector3D & to, MbRegTransform * iReg = nullptr ); /** \brief \ru Повернуть выбранный объект вокруг оси на заданный угол. \en Rotate selected object by a given angle about an axis. \~ @@ -467,7 +467,7 @@ public : \en Registrator. \~ \ingroup Model_Items */ - virtual void RotateSelected( const MbAxis3D & axis, double angle, MbRegTransform * iReg = c3d_null ); + virtual void RotateSelected( const MbAxis3D & axis, double angle, MbRegTransform * iReg = nullptr ); /// \ru Дать матрицу преобразования из локальной системы объекта. \en Get transform matrix from local coordinate system of object. virtual bool GetMatrixFrom( MbMatrix3D & from ) const; @@ -558,7 +558,7 @@ bool DeleteCreatorsCopies( ItemsVector & items, double eps = LENGTH_EPSILON ) if ( itemsCnt > 1 ) { for ( size_t i = 0; i < itemsCnt; ++i ) { MbItem * item1 = items[i]; - if ( item1 == c3d_null ) + if ( item1 == nullptr ) continue; creators1.clear(); item1->GetCreators( creators1 ); @@ -567,7 +567,7 @@ bool DeleteCreatorsCopies( ItemsVector & items, double eps = LENGTH_EPSILON ) if ( creatorsCnt1 > 0 ) { for ( size_t j = i + 1; j < itemsCnt; ++j ) { MbItem * item2 = items[j]; - if ( item2 == c3d_null ) + if ( item2 == nullptr ) continue; creators2.clear(); item2->GetCreators( creators2 ); @@ -577,11 +577,11 @@ bool DeleteCreatorsCopies( ItemsVector & items, double eps = LENGTH_EPSILON ) bool replace = false; for ( size_t k1 = 0; k1 < creatorsCnt1; ++k1 ) { MbCreator * creator1 = creators1[k1]; - if ( creator1 == c3d_null ) + if ( creator1 == nullptr ) continue; for ( size_t k2 = k1 + 1; k2 < creatorsCnt2; ++k2 ) { MbCreator * creator2 = creators2[k2]; - if ( creator2 == c3d_null ) + if ( creator2 == nullptr ) continue; if ( (creator1 != creator2) && creator1->IsSame( *creator2, eps ) ) { creators2[k2] = creators1[k1]; diff --git a/C3d/Include/model_tree.h b/C3d/Include/model_tree.h index 8eb3674..10296a9 100644 --- a/C3d/Include/model_tree.h +++ b/C3d/Include/model_tree.h @@ -140,11 +140,11 @@ public: virtual const IModelTreeNode * GetModelTreeNode() const { return m_subtree; } // \ru Доступ к информации об исполнении. \en Access to the embodiment info. - virtual const MbItemData& GetEmbodimentData() const { C3D_ASSERT( m_subtree != c3d_null ); return m_subtree->GetData(); } + virtual const MbItemData& GetEmbodimentData() const { C3D_ASSERT( m_subtree != nullptr ); return m_subtree->GetData(); } // \ru Построить дерево модели, которое содержится в данном исполнении. // \en Build a tree of a model which is contained in a given embodiment. - virtual std_unique_ptr GetEmbodiment() const; + virtual std::unique_ptr GetEmbodiment() const; private: MbEmbodimentNode(); @@ -195,15 +195,15 @@ public: // \ru Построить дерево из узлов, выбранных по фильтрам. В случае дерева исполнений, функция работает с первым исполнением. // \en Build a tree with nodes, selected by filters. In case of embodiment tree, the function works with the first embodiment. - virtual std_unique_ptr GetFilteredTree ( const std::vector& filters ) const; + virtual std::unique_ptr GetFilteredTree ( const std::vector& filters ) const; - // \ru Построить дерево по заданным узлам. Не применимо для дерева исполнений (в этом случае возвращает c3d_null). - // \en Build a tree for given nodes. Not applicable to embodiment tree (in this case, returns c3d_null). - virtual std_unique_ptr GetFilteredTree ( std::vector& nodes ) const; + // \ru Построить дерево по заданным узлам. Не применимо для дерева исполнений (в этом случае возвращает nullptr). + // \en Build a tree for given nodes. Not applicable to embodiment tree (in this case, returns nullptr). + virtual std::unique_ptr GetFilteredTree ( std::vector& nodes ) const; - // \ru Выдать указатель на дерево исполнений. Выдает c3d_null, если не применимо (нет исполнений). - // \en Get pointer to embodiments tree. Return c3d_null if not applicable (no embodiments). - virtual const IEmbodimentTree* GetEmbodimentsTree() const { return GetType() == mtt_Embodiment ? &m_embTree : c3d_null; } + // \ru Выдать указатель на дерево исполнений. Выдает nullptr, если не применимо (нет исполнений). + // \en Get pointer to embodiments tree. Return nullptr if not applicable (no embodiments). + virtual const IEmbodimentTree* GetEmbodimentsTree() const { return GetType() == mtt_Embodiment ? &m_embTree : nullptr; } /// \ru Версия дерева. \en Tree version. virtual VERSION GetVersion() { return m_currentVersion; } @@ -225,7 +225,7 @@ public: /// \param node - a node with data. /// \param added - filled if non-null (true - if a node added, false - a node already exists). /// \return - a pointer to the tree node. - MbTreeNode* AddNode ( const MbTreeNode& node, bool* added = c3d_null ); + MbTreeNode* AddNode ( const MbTreeNode& node, bool* added = nullptr ); /// \ru Добавить узел с указанными данными, если узел с такими данными не существует. /// \param node - данные. @@ -235,7 +235,7 @@ public: /// \param node - a data. /// \param added - filled if non-null (true - if a node added, false - a node already exists). /// \return - a pointer to the tree node. - MbTreeNode* AddNode ( const MbItemData& data, bool* added = c3d_null ); + MbTreeNode* AddNode ( const MbItemData& data, bool* added = nullptr ); /// \ru Доступ к узлам дерева, упорядоченным по данным. /// \en Access to nodes of the tree, ordered by data. diff --git a/C3d/Include/model_tree_data.h b/C3d/Include/model_tree_data.h index b4d4657..783df6f 100644 --- a/C3d/Include/model_tree_data.h +++ b/C3d/Include/model_tree_data.h @@ -151,8 +151,8 @@ public: //---------------------------------------------------------------------------------------- -/// \ru Создать объект пользовательских данных для атрибута. Возвращает c3d_null, если данный атрибут не поддерживается деревом модели. -/// \en Create user data object for the attribute. Return c3d_null if this attribute is not supported in the model tree. +/// \ru Создать объект пользовательских данных для атрибута. Возвращает nullptr, если данный атрибут не поддерживается деревом модели. +/// \en Create user data object for the attribute. Return nullptr if this attribute is not supported in the model tree. //--- MATH_FUNC( ItemDataBase* ) CreateAttributeData( MbAttribute* attr ); @@ -160,7 +160,7 @@ MATH_FUNC( ItemDataBase* ) CreateAttributeData( MbAttribute* attr ); /// \ru Прочитать атрибуты для узла дерева. /// \en Read attributes for the model tree node. //--- -MATH_FUNC( std_unique_ptr ) GetTreeNodeAttributes( const IModelTreeNode * node, reader& in ); +MATH_FUNC( std::unique_ptr ) GetTreeNodeAttributes( const IModelTreeNode * node, reader& in ); //---------------------------------------------------------------------------------------- @@ -818,8 +818,8 @@ inline writer& operator << ( writer & out, const UserDataMap& itemmap ) while ( !curIter.Empty() ) { MbeItemDataType type = curIter.Key(); ItemDataBase* item = curIter.Value(); - C3D_ASSERT( type < idtCount && item != c3d_null ); - if ( type < idtCount && item != c3d_null ) { + C3D_ASSERT( type < idtCount && item != nullptr ); + if ( type < idtCount && item != nullptr ) { out << (int)type; // \ru Тип данных. \en A data type. size_t dataSize = item->Size( out ); ::WriteCOUNT( out, dataSize );// \ru Размер данных. \en Data size. diff --git a/C3d/Include/mt_ref_item.h b/C3d/Include/mt_ref_item.h index 9be60c4..1c4fed5 100644 --- a/C3d/Include/mt_ref_item.h +++ b/C3d/Include/mt_ref_item.h @@ -61,7 +61,8 @@ inline refcount_t MtRefItem::Release() const { if ( !useCount || (--useCount == 0) ) { - delete this; // \ru Вызов виртуального деструктора \en Call of virtual destructor + // \ru Вызов виртуального деструктора. \en Call of virtual destructor. + delete this; // SKIP_SA return 0; } diff --git a/C3d/Include/multiline.h b/C3d/Include/multiline.h index d3f646e..b9c8e3a 100644 --- a/C3d/Include/multiline.h +++ b/C3d/Include/multiline.h @@ -441,7 +441,7 @@ public: // --- class MATH_CLASS MbMultiline : public MbPlaneItem { private: - MbContour * basisCurve; ///< \ru Базовая кривая (БК) (всегда не c3d_null). \en Base curve (BC) (always not c3d_null). + MbContour * basisCurve; ///< \ru Базовая кривая (БК) (всегда не nullptr). \en Base curve (BC) (always not nullptr). SArray vertices; ///< \ru Массив вершин мультилинии (согласован с вершинами БК). \en Array of vertices of a multiline (agreed with the vertices of the base curve). CSSArray equidRadii; ///< \ru Сортированный массив радиусов эквидистантных кривых. \en Sorted array of radii of equidistant curves. StMLTipParams begTipParams; ///< \ru Параметры законцовки в начале мультилинии (начале БК). \en Parameters of a tip at the beginning of a multiline ( the beginning of base curve). @@ -450,7 +450,7 @@ private: bool isTransparent; ///< \ru "Прозрачная" ли мультилиния. \en Whether the multiline is "transparent". // \ru Объекты, которые составляют мультилинию (рекомендовали не делать их mutable, а писать и читать) \en Objects which constitute a multiline (recommended to read and write and not to make them mutable) // \ru ЭТИ ОБЪЕКТЫ НЕЛЬЗЯ МЕНЯТЬ СНАРУЖИ!!! \en THESE OBJECTS CAN'T BE CHANGED OUTSIDE!!! - PArray curves; ///< \ru Кривые мультилинии (согласован с equidRadii) (всегда не c3d_null). \en Curves of a multiline (agreed with the 'equidRadii') (always not c3d_null). + PArray curves; ///< \ru Кривые мультилинии (согласован с equidRadii) (всегда не nullptr). \en Curves of a multiline (agreed with the 'equidRadii') (always not nullptr). PArray tipCurves; ///< \ru Законцовки в вершинах мультилинии (согласован с vertices). \en Tips at vertices of a multiline (agreed with 'vertices'). MbContour * begTipCurve; ///< \ru Законцовка в начале мультилинии (начале БК). \en Tip at the beginning of a multiline (beginning of the base curve). MbContour * endTipCurve; ///< \ru Законцовка в конце мультилинии (конце БК). \en Tip at the end of a multiline (end of the base curve). @@ -513,10 +513,10 @@ public: virtual bool IsSame ( const MbPlaneItem & other, double accuracy = LENGTH_EPSILON ) const; // \ru Являются ли объекты равными. \en Determine whether objects are equal. virtual bool IsSimilar ( const MbPlaneItem & item ) const; // \ru Являются ли объекты подобными. \en Determine whether the objects are similar. virtual bool SetEqual ( const MbPlaneItem & item ); // \ru Сделать объекты равными. \en Make the objects equal. - virtual void Transform ( const MbMatrix & matr, MbRegTransform * = c3d_null, const MbSurface * newSurface = c3d_null );// \ru Преобразовать объект согласно матрице. \en Transform an object according to the matrix. - virtual void Move ( const MbVector & to, MbRegTransform * = c3d_null, const MbSurface * newSurface = c3d_null );// \ru Сдвинуть объект вдоль вектора. \en Move an object along a vector. - virtual void Rotate ( const MbCartPoint & pnt, const MbDirection & angle, MbRegTransform * = c3d_null, const MbSurface * newSurface = c3d_null ); // \ru Повернуть вокруг точки на угол. \en Rotate at angle around a point. - virtual MbPlaneItem & Duplicate ( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию объекта. \en Create a copy of the object. + virtual void Transform ( const MbMatrix & matr, MbRegTransform * = nullptr, const MbSurface * newSurface = nullptr );// \ru Преобразовать объект согласно матрице. \en Transform an object according to the matrix. + virtual void Move ( const MbVector & to, MbRegTransform * = nullptr, const MbSurface * newSurface = nullptr );// \ru Сдвинуть объект вдоль вектора. \en Move an object along a vector. + virtual void Rotate ( const MbCartPoint & pnt, const MbDirection & angle, MbRegTransform * = nullptr, const MbSurface * newSurface = nullptr ); // \ru Повернуть вокруг точки на угол. \en Rotate at angle around a point. + virtual MbPlaneItem & Duplicate ( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию объекта. \en Create a copy of the object. virtual void AddYourGabaritTo( MbRect & r ) const; // \ru Добавить свой габарит в присланный габарит. \en Add your own bounding box into the given bounding box. virtual bool IsVisibleInRect ( const MbRect & r, bool exact = false ) const; // \ru Виден ли объект в заданном прям-ке. \en Whether the object is visible in the given rectangle. @@ -1319,7 +1319,7 @@ private: /// \ru Насчитать все кривые и все законцовки в вершинах. \en Calculate all curves and all tips at vertices. void CalculateCurvesAndTipCurves(); /// \ru Насчитать законцовку в начале. \en Calculate tip at the beginning. - void CalculateBegTipCurve ( SArray * changeCurvesNumbers = c3d_null ); + void CalculateBegTipCurve ( SArray * changeCurvesNumbers = nullptr ); /// \ru Насчитать законцовку в конце. \en Calculate tip at the end. void CalculateEndTipCurve (); @@ -1576,7 +1576,7 @@ MATH_FUNC (bool) BreakMultilineNParts( const MbMultiline & multiline, size_t par // --- inline bool MbMultiline::IsDegenerate( double lenEps ) const { return ( (minNotDegInd == SYS_MAX_T) || // \ru Значит, и maxNotDegInd == SYS_MAX_T \en So maxNotDegInd == SYS_MAX_T - (basisCurve != c3d_null && basisCurve->IsDegenerate(lenEps)) ); + (basisCurve != nullptr && basisCurve->IsDegenerate(lenEps)) ); } diff --git a/C3d/Include/name_check.h b/C3d/Include/name_check.h index c270156..227ea3f 100644 --- a/C3d/Include/name_check.h +++ b/C3d/Include/name_check.h @@ -155,7 +155,7 @@ struct NameIntersectionInfo { const MbName * name; ///< \ru Имя объектов. \en A name of objects. size_t intersections; ///< \ru Количество совпадений. \en The count of coincidences. - NameIntersectionInfo() : name( c3d_null ), intersections( 0 ) {} + NameIntersectionInfo() : name( nullptr ), intersections( 0 ) {} }; diff --git a/C3d/Include/name_contour_tree.h b/C3d/Include/name_contour_tree.h index ffcad24..ea221af 100644 --- a/C3d/Include/name_contour_tree.h +++ b/C3d/Include/name_contour_tree.h @@ -31,7 +31,7 @@ private: bool intersectChildren; // \ru Пересекаются ли внутренние контуры \en Are inner contours intersect public: /// \ru Конструктор. \en Constructor. - MbNamedContoursTree( const MbContour * con = c3d_null, bool o = true ); + MbNamedContoursTree( const MbContour * con = nullptr, bool o = true ); /// \ru Деструктор. \en Destructor. ~MbNamedContoursTree(); public: @@ -40,7 +40,7 @@ public: /// \ru Получить количество деревьев. \en Get count of trees. size_t GetChildrenCount() const { return children.Count(); } /// \ru Получить дерево контуров по индексу. \en Get contour tree by an index. - const MbNamedContoursTree * GetTreeContour( size_t index ) const { return (GetChildrenCount() >= index) ? children[index] : c3d_null; } + const MbNamedContoursTree * GetTreeContour( size_t index ) const { return (GetChildrenCount() >= index) ? children[index] : nullptr; } /// \ru Проверить группы контуров на не пересечение. \en Check groups of contours for absence of intersection. MbResultType CheckProfiles( bool base ) const; /// \ru Получить указатель на внешний контур. \en Get the pointer to the external contour. @@ -64,8 +64,8 @@ private: \en Get the biggest contour. \~ \details \ru Выдать самый большой контур по длине диагонали габарита. \en Get the biggest contour by bounding box diagonal length. \~ - \return \ru Возвращает указатель на найденный контур или c3d_null. - \en Returns pointer to the found contour or c3d_null. \~ + \return \ru Возвращает указатель на найденный контур или nullptr. + \en Returns pointer to the found contour or nullptr. \~ \ingroup Names */ // --- diff --git a/C3d/Include/name_item.h b/C3d/Include/name_item.h index 45628f3..8669a1c 100644 --- a/C3d/Include/name_item.h +++ b/C3d/Include/name_item.h @@ -334,7 +334,7 @@ void MbIdArr::operator += ( const MbIdArr & other ) */ // --- class MATH_CLASS MbName { public: - typedef std_unique_ptr UniqueNamePtr; + typedef std::unique_ptr UniqueNamePtr; public : /// \ru Индекс имени. \en A name index. @@ -789,7 +789,7 @@ public: \param[in] copy - \ru Имя копии. \en The name of the copy. \~ */ - MbNamePair( const MbName * copy ) : gageName( c3d_null ), copyName( copy ), copyHash( c3d::SIMPLENAME_MAX ) {} + MbNamePair( const MbName * copy ) : gageName( nullptr ), copyName( copy ), copyHash( c3d::SIMPLENAME_MAX ) {} /// \ru . \en . /** \brief \ru Конструктор. \en Constructor. \~ @@ -798,13 +798,13 @@ public: \param[in] copy - \ru Хэш имени копии. \en The hash of the name of the copy. \~ */ - MbNamePair( SimpleName copy ) : gageName( c3d_null ), copyName( c3d_null ), copyHash( copy ) {} + MbNamePair( SimpleName copy ) : gageName( nullptr ), copyName( nullptr ), copyHash( copy ) {} /// \ru Деструктор. \en Destructor. ~MbNamePair() {} public: /// \ru Обнулить имя оригинала и имя копии. \en Set name of original and of its duplicate to null. - void SetNull() { gageName = c3d_null; copyName = c3d_null; copyHash = c3d::SIMPLENAME_MAX; } + void SetNull() { gageName = nullptr; copyName = nullptr; copyHash = c3d::SIMPLENAME_MAX; } /// \ru Оператор сравнения. \en Comparison operator. bool operator == ( const MbNamePair & other ) const; /// \ru Оператор меньше. \en "Less than" operator. @@ -814,7 +814,7 @@ public: { if ( copyName ) copyHash = Prepare(*copyName).Hash(); - return copyHash; + return copyHash; // SKIP_SA } /** \brief \ru Правило приготовления имен. \en Names prepare rules. \~ @@ -829,8 +829,8 @@ public: { MbName ret( name ); ret.SetMainName( c3d::SIMPLENAME_MAX ); - return ret; - } + return ret; // SKIP_SA + } // SKIP_SA }; @@ -871,8 +871,8 @@ public: */ bool AddNameData( const MbName * orig, const MbName * copy ) { - C3D_ASSERT( (orig != c3d_null) && (copy != c3d_null) ); - if ( (orig != c3d_null) && (copy != c3d_null) ) { + C3D_ASSERT( (orig != nullptr) && (copy != nullptr) ); + if ( (orig != nullptr) && (copy != nullptr) ) { size_t cnt = checkList.size(); checkList.Add( MbNamePair( orig, copy ) ); if ( checkList.size() > cnt ) @@ -977,7 +977,7 @@ public: , version() #ifdef ORIGINAL_MAIN_NAME , original( c3d::SIMPLENAME_MAX ) - , nameList( c3d_null ) + , nameList( nullptr ) #endif // ORIGINAL_MAIN_NAME { defName.SetMainName( mn ); @@ -996,7 +996,7 @@ public: , version() #ifdef ORIGINAL_MAIN_NAME , original( c3d::SIMPLENAME_MAX ) - , nameList( c3d_null ) + , nameList( nullptr ) #endif // ORIGINAL_MAIN_NAME { defName.MakeTemplate(); @@ -1181,11 +1181,11 @@ public: MbNameMaker GetOriginalNameMaker() const; /// \ru Удалить ненужные элементы по именам копий. \en Clean up unnecessary pairs by name copies. bool CleanNameList( c3d::ConstNamesVector & delNamesCopies ) const { - return ((nameList != c3d_null) ? nameList->Clean( delNamesCopies ) : false); + return ((nameList != nullptr) ? nameList->Clean( delNamesCopies ) : false); } /// \ru Заменить имена копий. \en Replace names copies. bool ReplaceNameList( const MbName & newNameCopies, const c3d::ConstNamesVector & oldNamesCopies ) const { - return ((nameList != c3d_null) ? nameList->Replace( newNameCopies, oldNamesCopies ) : false); + return ((nameList != nullptr) ? nameList->Replace( newNameCopies, oldNamesCopies ) : false); } #endif // ORIGINAL_MAIN_NAME @@ -1524,7 +1524,7 @@ reader & operator >> ( reader & in, MbPath & ref ) if ( in.good() && count ) { ref.SetSize( count, true/*clear*/ ); - if ( (ref.GetAddr() == c3d_null) && (count >= SYS_MAX_UINT32) ) // We could not allocate the required amount of memory + if ( (ref.GetAddr() == nullptr) && (count >= SYS_MAX_UINT32) ) // We could not allocate the required amount of memory in.setState( io::outOfMemory ); else { for ( size_t i = 0; i < count && in.good(); ++i ) { diff --git a/C3d/Include/op_binding_data.h b/C3d/Include/op_binding_data.h index 53b8ec4..1cd02c1 100644 --- a/C3d/Include/op_binding_data.h +++ b/C3d/Include/op_binding_data.h @@ -22,17 +22,102 @@ class MATH_CLASS MbFace; class MATH_CLASS MbFaceShell; +//------------------------------------------------------------------------------ +/** \brief \ru Точность построения объектов. + \en The accuracy of object construction. \~ + \details \ru Класс содержит заданную точность и достигнутую точность построения граней, рёбер и вершин. \n + \en The class contains the specified accuracy and the achieved accuracy of the construction of faces, edges and vertices. \n \~ + \ingroup Build_Parameters +*/ +// --- +class MATH_CLASS MbAccuracy { +protected: + double precision; ///< \ru Заданная точность построения объектов. \en The specified accuracy of the construction of objects. + double faceAccuracy; ///< \ru Точность построенных граней (поверхностей). \en The accuracy of the constructed faces (surfaces). + double edgeAccuracy; ///< \ru Точность построенных рёбер (кривых). \en The accuracy of the constructed edges (curves). + double vertexAccuracy; ///< \ru Точность построенных вершин (точек). \en The accuracy of the constructed vertices (points). + +public: + /// \ru Конструктор по умолчанию. \en Default constructor. + MbAccuracy() + : precision( METRIC_PRECISION ) + , faceAccuracy( METRIC_EPSILON ) + , edgeAccuracy( METRIC_EPSILON ) + , vertexAccuracy( METRIC_EPSILON ) + {} + /// \ru Конструктор по заданной точности. \en Constructor by the specified accuracy. + MbAccuracy( double _precision ) + : precision( _precision ) + , faceAccuracy( METRIC_EPSILON ) + , edgeAccuracy( METRIC_EPSILON ) + , vertexAccuracy( METRIC_EPSILON ) + {} + /// \ru Конструктор копирования. \en Copy-constructor. + MbAccuracy( const MbAccuracy & other ) + : precision( other.precision ) + , faceAccuracy( other.faceAccuracy ) + , edgeAccuracy( other.edgeAccuracy ) + , vertexAccuracy( other.vertexAccuracy ) + {} + /// \ru Деструктор. \en Destructor. + ~MbAccuracy() {} + +public: + /// \ru Функция инициализации. \en Initialization function. + void Init( const MbAccuracy & other ) { + precision = other.precision; + faceAccuracy = other.faceAccuracy; + edgeAccuracy = other.edgeAccuracy; + vertexAccuracy = other.vertexAccuracy; + } + /// \ru Функция инициализации. \en Initialization function. + void Init( double _precision ) { + precision = _precision; + faceAccuracy = METRIC_EPSILON; + edgeAccuracy = METRIC_EPSILON; + vertexAccuracy = METRIC_EPSILON; + } + /// \ru Оператор присваивания. \en Assignment operator. + MbAccuracy & operator = ( const MbAccuracy & other ) { + precision = other.precision; + faceAccuracy = other.faceAccuracy; + edgeAccuracy = other.edgeAccuracy; + vertexAccuracy = other.vertexAccuracy; + return *this; + } + /// \ru Являются ли объекты равными? \en Determine whether an object is equal? + bool IsSame( const MbAccuracy & other, double accuracy ) const; + + /// \ru Получить точность. \en Get accuracy. + double GetPrecision() const { return precision; } + double GetFaceAccuracy() const { return faceAccuracy; } + double GetEdgeAccuracy() const { return edgeAccuracy; } + double GetVertexAccuracy() const { return vertexAccuracy; } + + /// \ru Установить точность. \en Set accuracy. + void SetPrecision( double a ) { precision = a; } + void SetFaceAccuracy( double a ) { faceAccuracy = a; } + void SetEdgeAccuracy( double a ) { edgeAccuracy = a; } + void SetVertexAccuracy( double a ) { vertexAccuracy = a; } + void SetAccuracy( double fa, double ea, double va ) { + faceAccuracy = fa; + edgeAccuracy = ea; + vertexAccuracy = va; + } + + KNOWN_OBJECTS_RW_REF_OPERATORS( MbAccuracy ) // \ru Для работы со ссылками и объектами класса. \en For working with references and objects of the class. + DECLARE_NEW_DELETE_CLASS( MbAccuracy ) + DECLARE_NEW_DELETE_CLASS_EX( MbAccuracy ) +}; + + //------------------------------------------------------------------------------ /** \brief \ru Индекс идентификации объекта. \en Index of object identification. \~ - \details \ru Индекс содержит имя, номер в теле и контрольную точку и - служит для поиска объекта (грани, ребра, вершины) в оболочке. - Поиск объекта производится по имени, в случае неудаче - по номеру, - и проверяется по контрольной точке \n - \en Index contains the name, the index in the solid and the control point, it - is used to search for object (face, edge, vertex) in the shell. - Object searching is performed by name. In failure case - by index, - and checked by the control point \n \~ + \details \ru Индекс содержит имя, номер в теле и контрольную точку и служит для поиска объекта (грани, ребра, вершины) в оболочке. + Поиск объекта производится по имени, в случае неудачи - по номеру, и проверяется по контрольной точке. \n + \en Index contains the name, the index in the solid and the control point, it is used to search for object (face, edge, vertex) in the shell. + Object searching is performed by name. In failure case - by index, and checked by the control point. \n \~ \ingroup Build_Parameters */ // --- @@ -173,6 +258,7 @@ public: DECLARE_NEW_DELETE_CLASS_EX( MbItemIndex ) }; + namespace c3d // namespace C3D { typedef std::pair ItemIndexPair; @@ -185,10 +271,10 @@ typedef std::vector ItemIndices; \en Extended index of object identification. \~ \details \ru Расширенный индекс содержит имя, номер в теле и контрольную точку и служит для поиска объекта (например, грани а теле для построения тонкой стенки). - Поиск объекта производится по имени, в случае неудаче - по номеру, и проверяется по контрольной точке \n + Поиск объекта производится по имени, в случае неудачи - по номеру, и проверяется по контрольной точке. \n \en Extended index contains the name, the index in the solid and the control point and is used to search object (or example: face in the solid, for construction of thin wall). - Object searching is performed by name. In failure case - by index, and checked by the control point \n \~ + Object searching is performed by name. In failure case - by index, and checked by the control point. \n \~ \ingroup Build_Parameters */ // --- @@ -272,10 +358,10 @@ public: \en Index of edge identification. \~ \details \ru Индекс содержит имя, номер ребра, номера соединяемых ребром граней в теле и контрольную точку и служит для поиска ребра для скругления или фаски. - Поиск ребра производится по имени, в случае неудаче - по номерам, и проверяется по контрольной точке \n + Поиск ребра производится по имени, в случае неудачи - по номерам, и проверяется по контрольной точке. \n \en Index contains the name, the index of the edge, indices of faces in the solid connected by edge and control point and is used to search the edge for fillet or chamfer. - Edge searching is performed by name. In failure case - by indices, and checked by the control point \n \~ + Edge searching is performed by name. In failure case - by indices, and checked by the control point. \n \~ \ingroup Build_Parameters */ // --- @@ -356,9 +442,9 @@ public: /** \brief \ru Индекс грани и её ребер. \en Index of face and it edges. \~ \details \ru Индекс грани и её ребер, предназначенных для обработки. Индекс служит для поиска грани и ребра в оболочке. - Поиск объекта производится по имени, в случае неудаче - по номеру, и проверяется по контрольной точке \n + Поиск объекта производится по имени, в случае неудачи - по номеру, и проверяется по контрольной точке. \n \en Index of face and it edges for process. Index is used to search for face end edges in the shell. - The face searching is performed by name. In failure case - by index, and checked by the control point \n \~ + The face searching is performed by name. In failure case - by index, and checked by the control point. \n \~ \ingroup Build_Parameters */ // --- @@ -434,7 +520,7 @@ public: //------------------------------------------------------------------------------ /// \ru Сортировка по возрастанию номера. \en Sorting in ascending order of index. // --- -template // Indices - MbItemIndex vector +template // Indices - MbItemIndex vector. void SortItemIndices( Indices & indices ) { if ( indices.size() > 1 ) { @@ -446,7 +532,7 @@ void SortItemIndices( Indices & indices ) //------------------------------------------------------------------------------ /// \ru Сортировка по возрастанию номера. \en Sorting in ascending order of index. // --- -template // Indices - MbEdgeFacesIndexes vector +template // Indices - MbEdgeFacesIndexes vector. void SortEdgeFacesIndices( Indices & indices ) { if ( indices.size() > 1 ) { @@ -455,5 +541,4 @@ void SortEdgeFacesIndices( Indices & indices ) } - #endif // __OP_BINDING_DATA_H diff --git a/C3d/Include/op_curve_parameter.h b/C3d/Include/op_curve_parameter.h index 5195156..129ae48 100644 --- a/C3d/Include/op_curve_parameter.h +++ b/C3d/Include/op_curve_parameter.h @@ -119,21 +119,21 @@ public: , bluntAngle ( false ) , fromBeg ( true ) , useSurfaceNormal( false ) - , surface ( c3d_null ) + , surface ( nullptr ) , snMaker ( nm ) {} public: /// \ru Установка режима по поверхности, переносится ли эквидистантная точка согласованно с нормалью к поверхности. \en Setting the mode whether offset point is moved according to surface normal or not. - void SetBySurfaceNormal( bool set, c3d::ConstSurfaceSPtr * s = c3d_null ) + void SetBySurfaceNormal( bool set, c3d::ConstSurfaceSPtr * s = nullptr ) { if ( set ) { useSurfaceNormal = set; - if ( s != c3d_null ) + if ( s != nullptr ) surface = *s; } else { useSurfaceNormal = false; - surface = c3d_null; + surface = nullptr; } } /// \ru Получить поверхность. \en Get surface. @@ -177,4 +177,79 @@ public: OBVIOUS_PRIVATE_COPY( MbSurfaceOffsetCurveParams ) }; + +//------------------------------------------------------------------------------- +/** \brief \ru Параметры продления кривой. + \en Parameters of the curve extension. \~ + \details \ru Параметры продления кривой. \n + \en Parameters of the curve extension. \n \~ + \ingroup Data_Structures + \warning \ru В разработке. + \en Under development. \~ +*/ +// --- +class MATH_CLASS MbCurveExtensionParameters +{ +private: + bool startBoundary; ///< \ru Расширяемая граница (true - начало кривой, false - ее конец). По умолчанию false. \en The boundary to extend (it is the start point if the value is true and the end point if the value is false). The default value is false. \~ + MbeCurveExtensionWays extensionWay; ///< \ru Способ продления. По умолчанию не определен. \en The way to extend. The default value is Undefined. \~ + double extensionLength; ///< \ru Длина продления (в метрическом диапазоне). Всегда неотрицательна. По умолчанию 0.0. \en The length to extend (in metric range). It is always not negative. The default value is 0.0. \~ + +public: + /** \brief \ru Конструктор. + \en Constructor. \~ + \details \ru Конструктор по умолчанию. + \en Default constructor. \~ + */ + MbCurveExtensionParameters() + { + Clear(); + } + + /// \ru Возврат к параметрам по умолчанию. \en Coming back to the default parameters. \~ + void Clear() + { + startBoundary = false; + extensionWay = MbeCurveExtensionWays::cew_Undefined; + extensionLength = 0.0; + } + /// \ru Вернуть true, если *this == other. \en Return true if *this == other. \~ + bool IsEqual( const MbCurveExtensionParameters & other, const double accuracy = Math::metricEpsilon ) const + { + if ( (startBoundary == other.startBoundary) && + (extensionWay == other.extensionWay) && + ::fabs(extensionLength - other.extensionLength) < accuracy ) { + return true; + } + + return false; + } + /// \ru Оператор присваивания. \en Assignment operator. \~ + MbCurveExtensionParameters & operator=( const MbCurveExtensionParameters & other ) + { + startBoundary = other.startBoundary; + extensionWay = other.extensionWay; + extensionLength = other.extensionLength; + return *this; + } + /// \ru Задать удлиняемую часть: начало кривой (toStart = true) или ее конец (toStart = false)? \en Set the extended part: begin of the curve (toStart = true) or its end (toStart = false). \~ + void SetExtendToStart( const bool toStart ) { startBoundary = toStart; } + /// \ru Вернуть true, если удлиняемая часть в начале кривой или false, если в конце. \en Return true if the extended part is in the curve begin or false if it is in the curve end. \~ + bool GetExtendToStart() const { return startBoundary; } + + /// \ru Задать способ продления кривой. \en Set the way to extend the curve. \~ + void SetWayToExtend( const MbeCurveExtensionWays newValue ) { extensionWay = newValue; } + /// \ru Текущий способ продления кривой. \en The Current way to extend the curve. \~ + MbeCurveExtensionWays GetWayToExtend() const { return extensionWay; } + + /// \ru Задать длину (в метрическом пространстве), на которую продлевается кривая. \en Set the length (in metric space) the curve extended to. \~ + void SetExtensionLength( const double newLength ) { extensionLength = ::fabs( newLength ); } + /// \ru Текущая длина (в метрическом пространстве), на которую продлевается кривая. \en Current length (in metric space) the curve extended to. \~ + double GetExtensionLength() const { return extensionLength; } + + /// \ru Проверить корректность параметров. Вернуть код ошибки или rt_Success, если все хорошо. \en Check the parameters validity. Return the error code or rt_Success if all is OK. \~ + MbResultType CheckValid() const; +}; + + #endif // __OP_CURVE_PARAMETERS_H diff --git a/C3d/Include/op_duplication_parameter.h b/C3d/Include/op_duplication_parameter.h index 4604831..2930a09 100644 --- a/C3d/Include/op_duplication_parameter.h +++ b/C3d/Include/op_duplication_parameter.h @@ -110,21 +110,21 @@ public: /** \brief \ru Преобразовать параметры согласно матрице. \en Transform parameters according to the matrix. \~ */ - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ) = 0; + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ) = 0; /** \brief \ru Сдвинуть параметры вдоль вектора. \en Move parameters along a vector. \~ \details \ru Сдвинуть параметры вдоль вектора. \en Move parameters along a vector. \n \~ */ - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ) = 0; + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ) = 0; /** \brief \ru Повернуть параметры вокруг оси на заданный угол. \en Rotate parameters at a given angle around an axis. \~ \details \ru Повернуть параметры вокруг оси на заданный угол. \en Rotate parameters at a given angle around an axis. \n \~ */ - virtual void Rotate ( const MbAxis3D &, double ang, MbRegTransform * = c3d_null ) = 0; + virtual void Rotate ( const MbAxis3D &, double ang, MbRegTransform * = nullptr ) = 0; /** \brief \ru Выдать свойства объекта. \en Get properties of the object. \~ @@ -152,7 +152,7 @@ public: \details \ru Построить копию объекта. \n \en Create a copy of the object. \n \~ */ - virtual DuplicationValues & Duplicate( MbRegDuplicate * = c3d_null ) const = 0; + virtual DuplicationValues & Duplicate( MbRegDuplicate * = nullptr ) const = 0; /** \brief \ru Сгенерировать матрицы трансформаций. \en Generate matrices of transformations. \~ @@ -236,7 +236,7 @@ public: */ DuplicationMeshValues( bool isPolar, const MbVector3D & dir1, const double step1, const uint num1, const MbVector3D & dir2, const double step2, const uint num2, - const MbCartPoint3D * center = c3d_null, bool isAlongAxis = false ); + const MbCartPoint3D * center = nullptr, bool isAlongAxis = false ); /// \ru Деструктор. \en Destructor. virtual ~DuplicationMeshValues(); @@ -248,11 +248,11 @@ public: /// \ru Тип параметров. \en Type of parameters. virtual MbeDuplicatesType Type() const; /// \ru Преобразовать сетку согласно матрице. \en Transform grid according to the matrix. - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); /// \ru Сдвинуть сетку вдоль вектора. \en Move grid along a vector. - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); /// \ru Повернуть сетку вокруг оси на заданный угол. \en Rotate grid at a given angle around an axis. - virtual void Rotate ( const MbAxis3D &, double ang, MbRegTransform * = c3d_null ); + virtual void Rotate ( const MbAxis3D &, double ang, MbRegTransform * = nullptr ); /// \ru Выдать свойства объекта \en Get properties of the object virtual void GetProperties( MbProperties & ); @@ -263,7 +263,7 @@ public: virtual bool IsSame( const DuplicationValues &, double accuracy ) const; /// \ru Построить копию объекта. \en Create a copy of the object. - virtual DuplicationValues & Duplicate( MbRegDuplicate * = c3d_null ) const; + virtual DuplicationValues & Duplicate( MbRegDuplicate * = nullptr ) const; /// \ru Сгенерировать матрицы трансформации. \en Generate matrix of transformation by. virtual void GenerateTransformMatrices( std::vector & ) const; @@ -385,11 +385,11 @@ public: /// \ru Тип параметров. \en Type of parameters. virtual MbeDuplicatesType Type() const; /// \ru Преобразовать объект согласно матрице. \en Transform an object according to the matrix. - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); /// \ru Сдвинуть объект вдоль вектора. \en Move an object along a vector. - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); /// \ru Повернуть объект вокруг оси на заданный угол. \en Rotate an object at a given angle around an axis. - virtual void Rotate ( const MbAxis3D &, double ang, MbRegTransform * = c3d_null ); + virtual void Rotate ( const MbAxis3D &, double ang, MbRegTransform * = nullptr ); /// \ru Выдать свойства объекта \en Get properties of the object virtual void GetProperties( MbProperties & ); @@ -400,7 +400,7 @@ public: virtual bool IsSame( const DuplicationValues &, double accuracy ) const; /// \ru Построить копию объекта. \en Create a copy of the object. - virtual DuplicationValues & Duplicate( MbRegDuplicate * = c3d_null ) const; + virtual DuplicationValues & Duplicate( MbRegDuplicate * = nullptr ) const; /// \ru Сгенерировать матрицы трансформации. \en Generate matrix of transformation. virtual void GenerateTransformMatrices( std::vector & ) const; diff --git a/C3d/Include/op_shell_parameter.h b/C3d/Include/op_shell_parameter.h index b1955b5..19cacfe 100644 --- a/C3d/Include/op_shell_parameter.h +++ b/C3d/Include/op_shell_parameter.h @@ -137,7 +137,7 @@ public: } /// \ru Конструктор копирования. \en Copy-constructor. - SmoothValues( const SmoothValues & other, MbRegDuplicate * iReg = c3d_null ); + SmoothValues( const SmoothValues & other, MbRegDuplicate * iReg = nullptr ); /// \ru Деструктор. \en Destructor. virtual ~SmoothValues(){} @@ -145,11 +145,11 @@ public: void Init( const SmoothValues & other ); public: /// \ru Преобразовать объект согласно матрице. \en Transform an object according to the matrix. - virtual void Transform( const MbMatrix3D &, MbRegTransform * ireg = c3d_null ); + virtual void Transform( const MbMatrix3D &, MbRegTransform * ireg = nullptr ); /// \ru Сдвинуть объект вдоль вектора. \en Move an object along a vector. - virtual void Move ( const MbVector3D &, MbRegTransform * /*ireg*/ = c3d_null ){} + virtual void Move ( const MbVector3D &, MbRegTransform * /*ireg*/ = nullptr ){} /// \ru Повернуть объект вокруг оси на заданный угол. \en Rotate an object at a given angle around an axis. - virtual void Rotate ( const MbAxis3D &, double ang, MbRegTransform * ireg = c3d_null ); + virtual void Rotate ( const MbAxis3D &, double ang, MbRegTransform * ireg = nullptr ); /// \ru Установить плоскость, параллельно которой будет выполнена остановка скругления в начале цепочки. \en Set the plane by which parallel will be carry out stop of the fillet at the begin. bool SetStopObjectAtBeg( const MbSurface * object, bool byObject = true ); @@ -163,6 +163,10 @@ public: void GetBegVector( MbVector3D & vect ) const { vect.Init( vector1 ); } /// \ru Получить вектор нормали к плоскости остановки в конце скругления. \en Get normal vector to the bound plane at the end of the fillet. void GetEndVector( MbVector3D & vect ) const { vect.Init( vector2 ); } + ///< \ru Установить радиус кривизны/катет на первой поверхности. \en Set radius of curvature/leg on the first surface. + void SetDdistance1 ( double d ) { distance1 = d; } + ///< \ru Установить радиус кривизны/катет на второй поверхности. \en Set radius of curvature/leg on the second surface. + void SetDdistance2 ( double d ) { distance2 = d; } /// \ru Оператор присваивания. \en Assignment operator. SmoothValues & operator = ( const SmoothValues & other ) { @@ -201,7 +205,7 @@ public: {} /// \ru Конструктор копирования. \en Copy-constructor. - FullFilletValues( const FullFilletValues & other, MbRegDuplicate * iReg = c3d_null ); + FullFilletValues( const FullFilletValues & other, MbRegDuplicate * iReg = nullptr ); /// \ru Деструктор. \en Destructor. ~FullFilletValues(){} @@ -209,11 +213,11 @@ public: /// \ru Функция инициализации. \en Initialization function. void Init( const FullFilletValues & other ); /// \ru Преобразовать объект согласно матрице. \en Transform an object according to the matrix. - void Transform( const MbMatrix3D &, MbRegTransform * ireg = c3d_null ); + void Transform( const MbMatrix3D &, MbRegTransform * ireg = nullptr ); /// \ru Сдвинуть объект вдоль вектора. \en Move an object along a vector. - void Move ( const MbVector3D &, MbRegTransform * /*ireg*/ = c3d_null ){} + void Move ( const MbVector3D &, MbRegTransform * /*ireg*/ = nullptr ){} /// \ru Повернуть объект вокруг оси на заданный угол. \en Rotate an object at a given angle around an axis. - void Rotate ( const MbAxis3D &, double ang, MbRegTransform * ireg = c3d_null ); + void Rotate ( const MbAxis3D &, double ang, MbRegTransform * ireg = nullptr ); /// \ru Оператор присваивания. \en Assignment operator. FullFilletValues & operator = ( const FullFilletValues & other ) { @@ -340,7 +344,7 @@ public: double placeAngle; ///< \ru Угол между осью и нормалью к поверхности (0 <= placeAngle <= M_PI_2). \en Angle between axis and normal to the surface (0 <= placeAngle <= M_PI_2). double azimuthAngle; ///< \ru Угол поворота оси вокруг нормали поверхности (-M_PI2 <= azimuthAngle <= M_PI2). \en Angle of rotation around the surface normal (-M_PI2 <= azimuthAngle <= M_PI2). protected: - MbSurface * surface; ///< \ru Обрабатываемая поверхность (если c3d_null, то считается плоской). \en Processing surface (if c3d_null, then is considered planar). + MbSurface * surface; ///< \ru Обрабатываемая поверхность (если nullptr, то считается плоской). \en Processing surface (if nullptr, then is considered planar). bool doPhantom; ///< \ru Создавать фантом результата операции. \en Create the phantom of the operation. protected: @@ -364,13 +368,13 @@ public: /// \ru Тип выемки. \en Type of notch. virtual MbeHoleType Type() const = 0; /// \ru Построить копию объекта. \en Create a copy of the object. - virtual HoleValues & Duplicate( MbRegDuplicate * ireg = c3d_null ) const = 0; + virtual HoleValues & Duplicate( MbRegDuplicate * ireg = nullptr ) const = 0; /// \ru Преобразовать объект согласно матрице. \en Transform an object according to the matrix. - virtual void Transform( const MbMatrix3D &, MbRegTransform * ireg = c3d_null ) = 0; + virtual void Transform( const MbMatrix3D &, MbRegTransform * ireg = nullptr ) = 0; /// \ru Сдвинуть объект вдоль вектора. \en Move an object along a vector. - virtual void Move ( const MbVector3D &, MbRegTransform * ireg = c3d_null ); + virtual void Move ( const MbVector3D &, MbRegTransform * ireg = nullptr ); /// \ru Повернуть объект вокруг оси на заданный угол. \en Rotate an object at a given angle around an axis. - virtual void Rotate ( const MbAxis3D &, double ang, MbRegTransform * ireg = c3d_null ); + virtual void Rotate ( const MbAxis3D &, double ang, MbRegTransform * ireg = nullptr ); /// \ru Являются ли объекты равными? \en Determine whether an object is equal? virtual bool IsSame( const HoleValues &, double accuracy ) const; @@ -497,8 +501,8 @@ public: public: virtual MbeHoleType Type() const; // \ru Тип выемки. \en Type of notch. - virtual HoleValues & Duplicate( MbRegDuplicate * ireg = c3d_null ) const; // \ru Построить копию. \en Create a copy. - virtual void Transform( const MbMatrix3D & matr, MbRegTransform * ireg = c3d_null ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. + virtual HoleValues & Duplicate( MbRegDuplicate * ireg = nullptr ) const; // \ru Построить копию. \en Create a copy. + virtual void Transform( const MbMatrix3D & matr, MbRegTransform * ireg = nullptr ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. virtual bool IsSame( const HoleValues &, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal? virtual void operator = ( const HoleValues & other ); // \ru Оператор присваивания. \en Assignment operator. private: @@ -564,8 +568,8 @@ public: public: virtual MbeHoleType Type() const; // \ru Тип выемки. \en Type of notch. - virtual HoleValues & Duplicate( MbRegDuplicate * ireg = c3d_null ) const; // \ru Построить копию. \en Create a copy. - virtual void Transform( const MbMatrix3D & matr, MbRegTransform * ireg = c3d_null ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. + virtual HoleValues & Duplicate( MbRegDuplicate * ireg = nullptr ) const; // \ru Построить копию. \en Create a copy. + virtual void Transform( const MbMatrix3D & matr, MbRegTransform * ireg = nullptr ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. virtual bool IsSame( const HoleValues &, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal? virtual void operator = ( const HoleValues & other ); // \ru Оператор присваивания. \en Assignment operator. private: @@ -675,8 +679,8 @@ public: public: virtual MbeHoleType Type() const; // \ru Тип выемки. \en Type of notch. - virtual HoleValues & Duplicate( MbRegDuplicate * ireg = c3d_null ) const; // \ru Построить копию. \en Create a copy. - virtual void Transform( const MbMatrix3D & matr, MbRegTransform * ireg = c3d_null ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. + virtual HoleValues & Duplicate( MbRegDuplicate * ireg = nullptr ) const; // \ru Построить копию. \en Create a copy. + virtual void Transform( const MbMatrix3D & matr, MbRegTransform * ireg = nullptr ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. virtual bool IsSame( const HoleValues &, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal? virtual void operator = ( const HoleValues & other ); // \ru Оператор присваивания. \en Assignment operator. private: @@ -1105,7 +1109,6 @@ public: */ // --- struct MATH_CLASS TransformValues { - protected: MbMatrix3D matrix; ///< \ru Матрица преобразования . \en A transformation matrix. // \ru Остальные параметры не обязательны (нужны для расчета matrix по деформации габаритного куба функцией MbCube::CalculateMatrix) \en Other parameters are optional (they are necessary for the calculation of matrix by deformation of bounding box by the function MbCube::CalculateMatrix) @@ -1231,7 +1234,6 @@ enum MbeModifyingType { */ // --- struct MATH_CLASS ModifyValues { - public: MbeModifyingType way; ///< \ru Тип модификации. \en Type of modification. MbVector3D direction; ///< \ru Перемещение при модификации. \en Moving when modifying. @@ -1446,6 +1448,7 @@ public: */ // --- struct MATH_CLASS NurbsSurfaceValues { +public: friend class MbNurbsSurfacesSolid; private: ptrdiff_t udegree; ///< \ru Порядок В-сплайна по U. \en Spline degree along U. @@ -1454,7 +1457,7 @@ private: bool vclosed; ///< \ru Признак замкнутости по V. \en Attribute of closedness along V. Array2 points; ///< \ru Множество точек. \en Set of points. double weight; ///< \ru Вес точек в случае одинаковости весов. \en Points weight in the case of equal weights. - Array2 * weights; ///< \ru Веса точек (может быть c3d_null). \en Weights of points (can be c3d_null). + Array2 * weights; ///< \ru Веса точек (может быть nullptr). \en Weights of points (can be nullptr). bool throughPoints; ///< \ru Строить поверхность, проходящую через точки. \en Build surface passing through points. bool pointsCloud; ///< \ru Облако точек (массив не упорядочен). \en Point cloud (disordered array). MbPlane * cloudPlane; ///< \ru Опорная плоскость облака точек. \en Support plane of point cloud. @@ -1627,11 +1630,11 @@ public: /// \ru Получить массив точек. \en Get array of points. bool GetPoints ( Array2 & pnts ) const { return pnts.Init( points ); } /// \ru Если ли веса? \en Is there weights? - bool IsWeighted() const { return (weights != c3d_null); } + bool IsWeighted() const { return (weights != nullptr); } /// \ru Получить массив весов. \en Get array of weights. bool GetWeights( Array2 & wts ) const; /// \ru Получить плоскость проецирования. \en Get the plane of projection. - const MbPlane * GetCloudPlane() const { return (pointsCloud ? cloudPlane : c3d_null);} + const MbPlane * GetCloudPlane() const { return (pointsCloud ? cloudPlane : nullptr);} /** \brief \ru Минимально возможный порядок сплайнов в случае облака точек. \en The smallest possible order of splines in the case of point cloud. \~ @@ -1669,7 +1672,7 @@ public: // --- inline bool NurbsSurfaceValues::GetWeights( Array2 & wts ) const { - if ( weights != c3d_null ) { + if ( weights != nullptr ) { if ( wts.Init( *weights ) ) return true; } @@ -1743,7 +1746,7 @@ inline bool NurbsSurfaceValues::SetUVPoint( size_t ui, size_t vi, const MbCartPo // --- inline bool NurbsSurfaceValues::GetUVWeight( size_t ui, size_t vi, double & wt ) const { - if ( weights != c3d_null && ui < GetUCount() && vi < GetVCount() ) { + if ( weights != nullptr && ui < GetUCount() && vi < GetVCount() ) { wt = (*weights)( vi, ui ); return (wt != UNDEFINED_DBL); //-V550 } @@ -1757,7 +1760,7 @@ inline bool NurbsSurfaceValues::GetUVWeight( size_t ui, size_t vi, double & wt ) // --- inline bool NurbsSurfaceValues::GetCommonWeight( double & wt ) const { - if ( weights == c3d_null && weight != UNDEFINED_DBL ) { //-V550 + if ( weights == nullptr && weight != UNDEFINED_DBL ) { //-V550 wt = weight; return true; } @@ -1776,7 +1779,7 @@ inline void NurbsSurfaceValues::SetThroughPoints( bool tp ) DeleteWeights(); weight = 1.0; } - if ( weights == c3d_null && weight == UNDEFINED_DBL ) //-V550 + if ( weights == nullptr && weight == UNDEFINED_DBL ) //-V550 weight = 1.0; } @@ -1790,6 +1793,7 @@ inline void NurbsSurfaceValues::SetThroughPoints( bool tp ) */ //--- struct MATH_CLASS MeshSurfaceValues { +public: friend class MbMeshShell; private: @@ -1861,15 +1865,15 @@ public: const RPArray & curvesV, bool vClosed, bool checkSelfInt, bool tess = false, - const RPArray * chainsU = c3d_null, - const RPArray * chainsV = c3d_null, + const RPArray * chainsU = nullptr, + const RPArray * chainsV = nullptr, MbeMatingType type0 = trt_Position, MbeMatingType type1 = trt_Position, MbeMatingType type2 = trt_Position, MbeMatingType type3 = trt_Position, - const c3d::ConstSurfacesVector * surf0 = c3d_null, // \ru Сопрягаемые поверхности через curvesU[0] \en Mating surfaces through curvesU[0] - const c3d::ConstSurfacesVector * surf1 = c3d_null, // \ru Сопрягаемые поверхности через curvesV[0] \en Mating surfaces through curvesV[0] - const c3d::ConstSurfacesVector * surf2 = c3d_null, // \ru Сопрягаемые поверхности через curvesU[maxU] \en Mating surfaces through curvesU[maxU] - const c3d::ConstSurfacesVector * surf3 = c3d_null, // \ru Сопрягаемые поверхности через curvesV[maxV] \en Mating surfaces through curvesV[maxV] - const MbPoint3D * pnt = c3d_null, + const c3d::ConstSurfacesVector * surf0 = nullptr, // \ru Сопрягаемые поверхности через curvesU[0] \en Mating surfaces through curvesU[0] + const c3d::ConstSurfacesVector * surf1 = nullptr, // \ru Сопрягаемые поверхности через curvesV[0] \en Mating surfaces through curvesV[0] + const c3d::ConstSurfacesVector * surf2 = nullptr, // \ru Сопрягаемые поверхности через curvesU[maxU] \en Mating surfaces through curvesU[maxU] + const c3d::ConstSurfacesVector * surf3 = nullptr, // \ru Сопрягаемые поверхности через curvesV[maxV] \en Mating surfaces through curvesV[maxV] + const MbPoint3D * pnt = nullptr, bool modify = true, bool direct0 = true, bool direct1 = true, bool direct2 = true, bool direct3 = true ); @@ -2014,9 +2018,9 @@ public: /// \ru Максимальный индекс в массиве кривых по U. \en The maximum index in the array of curves along U. ptrdiff_t GetCurvesUMaxIndex() const { return curvesU.MaxIndex(); } /// \ru Получить кривую по индексу. \en Get the curve by the index. - const MbCurve3D * GetCurveU( size_t k ) const { return ((k < curvesU.Count()) ? curvesU[k] : c3d_null); } + const MbCurve3D * GetCurveU( size_t k ) const { return ((k < curvesU.Count()) ? curvesU[k] : nullptr); } /// \ru Получить кривую по индексу. \en Get the curve by the index. - MbCurve3D * SetCurveU( size_t k ) { return ((k < curvesU.Count()) ? curvesU[k] : c3d_null); } + MbCurve3D * SetCurveU( size_t k ) { return ((k < curvesU.Count()) ? curvesU[k] : nullptr); } /// \ru Получить кривые по U. \en Get curves along U. void GetCurvesU( RPArray & curves ) const { curves.AddArray(curvesU); } /// \ru Установить кривые по U. \en Set curves along U. @@ -2031,9 +2035,9 @@ public: /// \ru Максимальный индекс в массиве кривых по V. \en The maximum index in the array of curves along V. ptrdiff_t GetCurvesVMaxIndex() const { return curvesV.MaxIndex(); } /// \ru Получить кривую по индексу. \en Get the curve by the index. - const MbCurve3D * GetCurveV( size_t k ) const { return ((k < curvesV.Count()) ? curvesV[k] : c3d_null); } + const MbCurve3D * GetCurveV( size_t k ) const { return ((k < curvesV.Count()) ? curvesV[k] : nullptr); } /// \ru Получить кривую по индексу. \en Get the curve by the index. - MbCurve3D * SetCurveV( size_t k ) const { return ((k < curvesV.Count()) ? curvesV[k] : c3d_null); } + MbCurve3D * SetCurveV( size_t k ) const { return ((k < curvesV.Count()) ? curvesV[k] : nullptr); } /// \ru Получить кривые по V. \en Get curves along V. void GetCurvesV( RPArray & curves ) const { curves.AddArray(curvesV); } /// \ru Установить кривые по V. \en Set curves along V. @@ -2048,9 +2052,9 @@ public: /// \ru Максимальный индекс в массиве цепочек по U. \en The maximum index in the array of chains along U. ptrdiff_t GetChainsUMaxIndex() const { return chainsU.MaxIndex(); } /// \ru Получить цепочку по индексу. \en Get the chain by the index. - const MbPolyline3D * GetChainU( size_t k ) const { return ( ( k < chainsU.Count() ) ? chainsU[k] : c3d_null ); } + const MbPolyline3D * GetChainU( size_t k ) const { return ( ( k < chainsU.Count() ) ? chainsU[k] : nullptr ); } /// \ru Получить цепочку по индексу. \en Get the chain by the index. - MbPolyline3D * SetChainU( size_t k ) { return ( ( k < chainsU.Count() ) ? chainsU[k] : c3d_null ); } + MbPolyline3D * SetChainU( size_t k ) { return ( ( k < chainsU.Count() ) ? chainsU[k] : nullptr ); } /// \ru Получить цепочки по U. \en Get chains along U. void GetChainsU( RPArray & chains ) const { chains.AddArray( chainsU ); } /// \ru Установить цепочки по U. \en Set chains along U. @@ -2065,9 +2069,9 @@ public: /// \ru Максимальный индекс в массиве цепочек по V. \en The maximum index in the array of chains along V. ptrdiff_t GetChainsVMaxIndex() const { return chainsV.MaxIndex(); } /// \ru Получить цепочку по индексу. \en Get the chain by the index. - const MbPolyline3D * GetChainV( size_t k ) const { return ( ( k < chainsV.Count() ) ? chainsV[k] : c3d_null ); } + const MbPolyline3D * GetChainV( size_t k ) const { return ( ( k < chainsV.Count() ) ? chainsV[k] : nullptr ); } /// \ru Получить цепочку по индексу. \en Get the chain by the index. - MbPolyline3D * SetChainV( size_t k ) { return ( ( k < chainsV.Count() ) ? chainsV[k] : c3d_null ); } + MbPolyline3D * SetChainV( size_t k ) { return ( ( k < chainsV.Count() ) ? chainsV[k] : nullptr ); } /// \ru Получить цепочки по V. \en Get chains along V. void GetChainsV( RPArray & chains ) const { chains.AddArray( chainsV ); } /// \ru Установить цепочки по V. \en Set chains along V. @@ -2180,7 +2184,6 @@ MbeMatingType MeshSurfaceValues::GetTransitType( ptrdiff_t i ) const */ //--- struct MATH_CLASS RuledSurfaceValues { - private: MbCurve3D * curve0; ///< \ru Первая кривая \en The first curve. MbCurve3D * curve1; ///< \ru Вторая кривая. \en The second curve. @@ -2439,11 +2442,11 @@ public: void InitByShell ( ExtensionType t, LateralKind k, const MbFace * f, const MbSolid * s ); /// \ru Преобразовать объект согласно матрице. \en Transform an object according to the matrix. - void Transform( const MbMatrix3D & matr, MbRegTransform * ireg = c3d_null ); + void Transform( const MbMatrix3D & matr, MbRegTransform * ireg = nullptr ); /// \ru Сдвинуть объект вдоль вектора. \en Move an object along a vector. - void Move ( const MbVector3D & to, MbRegTransform * ireg = c3d_null ); + void Move ( const MbVector3D & to, MbRegTransform * ireg = nullptr ); /// \ru Повернуть объект вокруг оси на заданный угол. \en Rotate an object at a given angle around an axis. - void Rotate ( const MbAxis3D & axis, double ang, MbRegTransform * ireg = c3d_null ); + void Rotate ( const MbAxis3D & axis, double ang, MbRegTransform * ireg = nullptr ); /// \ru Получить оболочку. \en Get the shell. const MbFaceShell * GetShell() const { return shell; } @@ -2512,10 +2515,10 @@ public: , checkSelfInt ( false ) , edgeConnType1 ( false ) , edgeConnType2 ( false ) - , boundDirection11 ( c3d_null ) - , boundDirection12 ( c3d_null ) - , boundDirection21 ( c3d_null ) - , boundDirection22 ( c3d_null ) + , boundDirection11 ( nullptr ) + , boundDirection12 ( nullptr ) + , boundDirection21 ( nullptr ) + , boundDirection22 ( nullptr ) {} /// \ru Конструктор по параметрам. \en Constructor by parameters. JoinSurfaceValues( JoinConnType t1, JoinConnType t2, double tens1, double tens2, bool selfInt = false ) @@ -2528,10 +2531,10 @@ public: , checkSelfInt ( selfInt ) , edgeConnType1 ( false ) , edgeConnType2 ( false ) - , boundDirection11 ( c3d_null ) - , boundDirection12 ( c3d_null ) - , boundDirection21 ( c3d_null ) - , boundDirection22 ( c3d_null ) + , boundDirection11 ( nullptr ) + , boundDirection12 ( nullptr ) + , boundDirection21 ( nullptr ) + , boundDirection22 ( nullptr ) {} /// \ru Конструктор копирования. \en Copy-constructor. JoinSurfaceValues( const JoinSurfaceValues & other ); @@ -2651,10 +2654,10 @@ public: } } if ( isSame ) { - bool isBoundDir11 = ((other.boundDirection11 != c3d_null) && (boundDirection11 != c3d_null)); - bool isBoundDir12 = ((other.boundDirection12 != c3d_null) && (boundDirection12 != c3d_null)); - bool isBoundDir21 = ((other.boundDirection21 != c3d_null) && (boundDirection21 != c3d_null)); - bool isBoundDir22 = ((other.boundDirection22 != c3d_null) && (boundDirection22 != c3d_null)); + bool isBoundDir11 = ((other.boundDirection11 != nullptr) && (boundDirection11 != nullptr)); + bool isBoundDir12 = ((other.boundDirection12 != nullptr) && (boundDirection12 != nullptr)); + bool isBoundDir21 = ((other.boundDirection21 != nullptr) && (boundDirection21 != nullptr)); + bool isBoundDir22 = ((other.boundDirection22 != nullptr) && (boundDirection22 != nullptr)); if ( isSame && isBoundDir11 ) isSame = c3d::EqualVectors( *other.boundDirection11, *boundDirection11, accuracy ); @@ -2690,24 +2693,35 @@ public: bool sewGrids; ///< \ru Сшивать наборы граней от разных сеток триангуляции. \en Sew together faces of grids. bool mergeFaces; ///< \ru Сливать подобные грани (true). \en Whether to merge similar faces (true). bool useGridSurface; ///< \ru Использовать поверхность на базе триангуляции. \en Use the surface based on triangulation. + bool copyAttributes; ///< \ru Копировать атрибуты. \en Copy attributes. public: /// \ru Конструктор по умолчанию. \en Default constructor. GridsToShellValues() : sewGrids ( true ) , mergeFaces ( false ) , useGridSurface( false ) + , copyAttributes( false ) {} /// \ru Конструктор копирования. \en Copy-constructor. GridsToShellValues( const GridsToShellValues & other ) : sewGrids ( other.sewGrids ) , mergeFaces ( other.mergeFaces ) , useGridSurface( other.useGridSurface ) + , copyAttributes( other.copyAttributes ) {} /// \ru Конструктор по параметрам. \en Constructor by parameters. GridsToShellValues( bool sg, bool mf, bool ugs = false ) - : sewGrids ( sg ) - , mergeFaces ( mf ) + : sewGrids ( sg ) + , mergeFaces ( mf ) + , useGridSurface( ugs ) + , copyAttributes( false ) + {} + /// \ru Конструктор по параметрам. \en Constructor by parameters. + GridsToShellValues( bool sg, bool mf, bool ugs, bool ca ) + : sewGrids ( sg ) + , mergeFaces ( mf ) , useGridSurface( ugs ) + , copyAttributes( ca ) {} /// \ru Оператор присваивания. \en Assignment operator. GridsToShellValues & operator = ( const GridsToShellValues & other ) @@ -2715,6 +2729,7 @@ public: sewGrids = other.sewGrids; mergeFaces = other.mergeFaces; useGridSurface = other.useGridSurface; + copyAttributes = other.copyAttributes; return *this; } }; @@ -2733,7 +2748,7 @@ public: */ // --- struct MATH_CLASS MedianShellValues { - public: +public: /** \brief \ru Тип расчета радиуса скругления между гранями срединной оболочки. \en Type of fillet radius calculation between faces of median shell. \~ \details \ru Флаг можно установить через вызов MedianShellValues::SetType(). @@ -2974,15 +2989,18 @@ OBVIOUS_PRIVATE_COPY ( MbShellStitchParams ) /// \ru Типы продления секущих объектов (поверхностей, контура). \en Prolongation types of cutter objects (surfaces, contour). // --- enum MbeSurfaceProlongType { - cspt_None = 0x00, // 000000 ///< \ru Не продлевать. \en Don't prolong. - cspt_Planar = 0x01, // 000001 ///< \ru Плоские поверхности. \en Planar surfaces. - cspt_RevolutionAxis = 0x02, // 000010 ///< \ru Поверхности вращения (вдоль оси). \en Revolution surfaces (along axis). - cspt_RevolutionAngle = 0x04, // 000100 ///< \ru Поверхности вращения (по углу). \en Revolution surfaces (by angle). - cspt_Revolution = 0x06, // 000110 ///< \ru Поверхности вращения. \en Revolution surfaces. - cspt_ExtrusionGeneratrix = 0x08, // 001000 ///< \ru Поверхности выдавливания (по образующей). \en Extrusion surfaces (by generatrix). - cspt_ExtrusionDistance = 0x10, // 010000 ///< \ru Поверхности выдавливания (по расстоянию). \en Extrusion surfaces (by distance). - cspt_Extrusion = 0x18, // 011000 ///< \ru Поверхности выдавливания. \en Extrusion surfaces. - cspt_Contour = 0x20, // 100000 ///< \ru Продление секущего контура. \en Extension of the cutter contour. + cspt_None = 0x00, // 00000000 ///< \ru Не продлевать. \en Don't prolong. + cspt_Planar = 0x01, // 00000001 ///< \ru Плоские поверхности. \en Planar surfaces. + cspt_RevolutionAxis = 0x02, // 00000010 ///< \ru Поверхности вращения (вдоль оси). \en Revolution surfaces (along axis). + cspt_RevolutionAngle = 0x04, // 00000100 ///< \ru Поверхности вращения (по углу). \en Revolution surfaces (by angle). + cspt_Revolution = 0x06, // 00000110 ///< \ru Поверхности вращения. \en Revolution surfaces. + cspt_ExtrusionGeneratrix = 0x08, // 00001000 ///< \ru Поверхности выдавливания (по образующей). \en Extrusion surfaces (by generatrix). + cspt_ExtrusionDistance = 0x10, // 00010000 ///< \ru Поверхности выдавливания (по расстоянию). \en Extrusion surfaces (by distance). + cspt_Extrusion = 0x18, // 00011000 ///< \ru Поверхности выдавливания. \en Extrusion surfaces. + cspt_Contour = 0x20, // 00100000 ///< \ru Продление секущего контура. \en Extension of the cutter contour. + cspt_RuledAlongGeneratrix = 0x40, // 01000000 ///< \ru Линейчатая поверхность (вдоль образующей). \en Ruled Surface (along generatrix). + cspt_RuledAcrossGeneratrix = 0x80, // 10000000 ///< \ru Линейчатая поверхность (поперек образующей). \en Ruled Surface (across generatrix). + cspt_Ruled = 0xC0, // 11000000 ///< \ru Линейчатая поверхность. \en Ruled Surface. }; @@ -3000,9 +3018,12 @@ enum MbeSurfaceProlongType { причем возможно раздельное управление : \n #cspt_ExtrusionGeneratrix - продлить вдоль образующей для включения габарита тела или замкнуть, если образующая периодична (дуга), \n #cspt_ExtrusionDistance - продлить поверхность вдоль направления выдавливания так, чтобы включить габарит тела, если это возможно; \n - 4. #cspt_Contour - продлить режущий контур, чтобы включить габарит тела, если это возможно. \n - \en Shell cutting operation parameters. \n - + 4. #cspt_Contour - продлить режущий контур, чтобы включить габарит тела, если это возможно; \n + 5. #cspt_Ruled - продлить линейчатую поверхность, \n + возможно раздельное управление:\n + #cspt_RuledAlongGeneratrix - продлить линейчатую поверхность вдоль образующих, \n + #cspt_RuledAcrossGeneratrix - продлить линейчатую поверхность поперек образующих. \n + \en Shell cutting operation parameters. \n The mutually exclusive state of flags is assumed when they are active in #MbShellCuttingParams: \n 1. #cspt_Planar - extend or not the face based on the plane; \n 2. #cspt_Revolution - extend or not surfaces having a rotation axis (for which the GetCylinderAxis surface function returns true), @@ -3013,7 +3034,11 @@ enum MbeSurfaceProlongType { moreover, separate control is possible: \n #cspt_ExtrusionGeneratrix - extend along the generatrix to cover the body or close if the generatrix is ​​periodic (like an arc), \n #cspt_ExtrusionDistance - extend the surface along the extrusion direction so as to embrace the body, if it's possible; \n - 4. #cspt_Contour - extend cutter contour so as to embrace the body, if it's possible. \n \~ + 4. #cspt_Contour - extend cutter contour so as to embrace the body, if it's possible; \n + 5. #cspt_Ruled - extend the ruled surface, \n + separate control possible: \n + #cspt_RuledAlongGeneratrix - extend the ruled surface along the generatrix, \n + #cspt_RuledAcrossGeneratrix - extend the ruled surface across the generatrices. \n \~ \ingroup Build_Parameters */ // --- @@ -3419,11 +3444,11 @@ public: } public: /// \ru Это резка плоским контуром? \en Is cutting by planar contour? - bool IsCuttingByPlanarContour() const { return (cutterData.GetSketchCurvesCount() > 0 && cutterData.GetSketchCurve(0) != c3d_null); } + bool IsCuttingByPlanarContour() const { return (cutterData.GetSketchCurvesCount() > 0 && cutterData.GetSketchCurve(0) != nullptr); } /// \ru Это резка поверхностью? \en Is cutting by surface? - bool IsCuttingBySurface() const { return (cutterData.GetSurfacesCount() > 0 && cutterData.GetSurface(0) != c3d_null); } + bool IsCuttingBySurface() const { return (cutterData.GetSurfacesCount() > 0 && cutterData.GetSurface(0) != nullptr); } /// \ru Это резка оболочкой? \en Is cutting by shell? - bool IsCuttingBySolid() const { return (cutterData.GetCreatorsCount() > 0 && cutterData.GetCreator(0) != c3d_null) || (cutterData.GetSolidShell() != c3d_null); } + bool IsCuttingBySolid() const { return (cutterData.GetCreatorsCount() > 0 && cutterData.GetCreator(0) != nullptr) || (cutterData.GetSolidShell() != nullptr); } /// \ru Получить данные секущего объекта. \en Get cutter object(s) data. const MbSplitData & GetCutterData() const { return cutterData; } @@ -3496,7 +3521,6 @@ void MbShellCuttingParams::SetRetainedPart( int part ) */ // --- struct MATH_CLASS RectifyValues { - protected : MbPlacement3D place; ///< \ru Локальная система координат развернутой поверхности грани. \en The local coordinat system for result surface. \~ MbCartPoint init; ///< \ru Параметры поверхности, которые будут соответствовать начальной точке place. \en The parameters of the surface, which will correspond to the origin of the place. \~ diff --git a/C3d/Include/op_swept_parameter.h b/C3d/Include/op_swept_parameter.h index bdfc61c..8a6eca6 100644 --- a/C3d/Include/op_swept_parameter.h +++ b/C3d/Include/op_swept_parameter.h @@ -92,7 +92,7 @@ public: /// \ru Конструктор по умолчанию. \en Default constructor. MbSweptData(); /// \ru Конструктор копирования. \en Copy-constructor. - MbSweptData( const MbSweptData &, MbRegDuplicate * ireg = c3d_null ); + MbSweptData( const MbSweptData &, MbRegDuplicate * ireg = nullptr ); public: @@ -174,7 +174,7 @@ public: \param[in] _newMainName - \ru Новое главное имя для топологических элементов тела. \en New main name for names of solid's topological elements. \~ */ - MbSweptData( MbSolid & _solid, const MbSNameMaker * newNameMaker = c3d_null ); + MbSweptData( MbSolid & _solid, const MbSNameMaker * newNameMaker = nullptr ); /** \brief \ru Конструктор. \en Constructor. \~ @@ -237,11 +237,11 @@ public: SPtr GetCurve3D( size_t i ) const; /// \ru Есть данные о двумерных кривых на поверхности? \en Is there data of two-dimensional curves on the surface? - bool IsSurfaceCurvesData() const { return ((surface != c3d_null) && !contours.empty()); } + bool IsSurfaceCurvesData() const { return ((surface != nullptr) && !contours.empty()); } /// \ru Есть данные о пространственных кривых? \en Is there data of spatial curves? bool IsSpaceCurvesData() const { return !contours3D.empty(); } /// \ru Есть данные о теле? \en Is there data about the solid? - bool IsSolidData() const { return (solid != c3d_null); } + bool IsSolidData() const { return (solid != nullptr); } /// \ru Выдать поверхность. \en Get the surface. const MbSurface * GetSurface() const { return surface; } @@ -277,7 +277,7 @@ public: \param[in] iReg - \ru Регистратор. \en Registrator. \~ */ - void Transform( const MbMatrix3D & matr, MbRegTransform * iReg = c3d_null ); + void Transform( const MbMatrix3D & matr, MbRegTransform * iReg = nullptr ); /** \brief \ru Сдвинуть объект. \en Move the object. \~ \details \ru Сдвинуть геометрический объект вдоль вектора с использованием регистратора. @@ -287,7 +287,7 @@ public: \param[in] iReg - \ru Регистратор. \en Registrator. \~ */ - void Move ( const MbVector3D & to, MbRegTransform * iReg = c3d_null ); + void Move ( const MbVector3D & to, MbRegTransform * iReg = nullptr ); /** \brief \ru Повернуть объект. \en Rotate the object. \~ \details \ru Повернуть объект вокруг оси на заданный угол с использованием регистратора. @@ -299,7 +299,7 @@ public: \param[in] iReg - \ru Регистратор. \en Registrator. \~ */ - void Rotate ( const MbAxis3D & axis, double angle, MbRegTransform * iReg = c3d_null ); + void Rotate ( const MbAxis3D & axis, double angle, MbRegTransform * iReg = nullptr ); /** \brief \ru Определить, являются ли объекты равными. \en Determine whether the objects are equal. \~ \details \ru Определить, являются ли объекты равными с заданной точностью. @@ -450,7 +450,7 @@ public: , scalarValue( 0.0 ) , distance ( 0.0 ) , rake ( 0.0 ) - , surface ( c3d_null ) + , surface ( nullptr ) , sameSense ( orient_BOTH ) {} @@ -466,7 +466,7 @@ public: , scalarValue( sVal ) , distance ( 0.0 ) , rake ( 0.0 ) - , surface ( c3d_null ) + , surface ( nullptr ) , sameSense ( orient_BOTH ) {} @@ -539,8 +539,8 @@ public: (::fabs(other.distance - distance) < accuracy) && (::fabs(other.rake - rake) < accuracy) ) { - bool isSurf1 = (surface != c3d_null); - bool isSurf2 = (other.surface != c3d_null); + bool isSurf1 = (surface != nullptr); + bool isSurf2 = (other.surface != nullptr); if ( isSurf1 == isSurf2 ) { if ( isSurf1 && isSurf2 ) { @@ -569,7 +569,6 @@ public: // --- struct MATH_CLASS SweptValues { public: - /** \brief \ru Толщина стенки (величина эквидистанты) в прямом направлении. \en Wall thickness (offset distance) along the forward direction. \~ \details \ru Толщина стенки (величина эквидистанты) в положительном направлении нормали объекта @@ -751,7 +750,7 @@ public: virtual bool IsSame( const SweptValues & other, double accuracy ) const { const SweptValuesAndSides * obj = dynamic_cast( &other ); - if ( obj != c3d_null ) { + if ( obj != nullptr ) { if ( side1.IsSame( obj->side1, accuracy ) && side2.IsSame( obj->side2, accuracy ) ) { if ( obj->SweptValues::IsSame( *this, accuracy ) ) { return true; @@ -778,7 +777,7 @@ public: \param[in] iReg - \ru Регистратор. \en Registrator. \~ */ - void Transform( const MbMatrix3D & matr, MbRegTransform * iReg = c3d_null ); + void Transform( const MbMatrix3D & matr, MbRegTransform * iReg = nullptr ); /** \brief \ru Сдвинуть вдоль вектора. \en Move along a vector. \~ \details \ru Сдвинуть вдоль вектора поверхности в прямом и обратном направлении. @@ -788,7 +787,7 @@ public: \param[in] iReg - \ru Регистратор. \en Registrator. \~ */ - void Move ( const MbVector3D & to, MbRegTransform * iReg = c3d_null ); + void Move ( const MbVector3D & to, MbRegTransform * iReg = nullptr ); /** \brief \ru Повернуть вокруг оси. \en Rotate around an axis. \~ \details \ru Повернуть вокруг оси поверхности в прямом и обратном направлении. @@ -800,7 +799,7 @@ public: \param[in] iReg - \ru Регистратор. \en Registrator. \~ */ - void Rotate ( const MbAxis3D & axis, double angle, MbRegTransform * iReg = c3d_null ); + void Rotate ( const MbAxis3D & axis, double angle, MbRegTransform * iReg = nullptr ); /** \brief \ru Сделать копии поверхностей. \en Make copies of surfaces. \~ @@ -811,7 +810,7 @@ public: \return \ru true, если хотя бы одна поверхность имелась и сдублирована. \en True if at least one surface is had and copied. \~ */ - bool DuplicateSurfaces( MbRegDuplicate * ireg = c3d_null ); + bool DuplicateSurfaces( MbRegDuplicate * ireg = nullptr ); public: /// \ru Получить поверхность в положительном направлении. \en Get the surface along the positive direction. @@ -881,7 +880,7 @@ public: virtual bool IsSame( const SweptValues & other, double accuracy ) const { const ExtrusionValues * obj = dynamic_cast( &other ); - if ( obj != c3d_null ) { + if ( obj != nullptr ) { if ( obj->SweptValuesAndSides::IsSame( *this, accuracy ) ) return true; } @@ -970,7 +969,7 @@ public: virtual bool IsSame( const SweptValues & other, double accuracy ) const { const RevolutionValues * obj = dynamic_cast( &other ); - if ( obj != c3d_null ) { + if ( obj != nullptr ) { if ( obj->shape == shape ) { if ( obj->SweptValuesAndSides::IsSame( *this, accuracy ) ) return true; @@ -1000,7 +999,7 @@ public: */ // --- struct MATH_CLASS EvolutionValues : public SweptValues { - +public: /// \ru Способы переноса образующего объекта вдоль направляющей. \en Moving method of generating object along the spine curve. enum ModesList { eom_Parallel = 0x00, // 00000 ///< \ru Образующая переносится параллельно самой себе. \en Generating curve is moved parallel to itself. @@ -1025,7 +1024,7 @@ protected: */ int mode; // "mode" or "parallel" on documentation pictures. public: - // \ru Данные о функциях изменения образующих кривых вдоль направляющей кривой (могут быть c3d_null). \en Data about changes of generating curves along the guide curve (can be c3d_null). + // \ru Данные о функциях изменения образующих кривых вдоль направляющей кривой (могут быть nullptr). \en Data about changes of generating curves along the guide curve (can be nullptr). double range; ///< \ru Эквидистантное смещение точек образующей кривой в конце траектории. \en The offset range of generating curve on the end of spine curve. SPtr scaling; ///< \ru Функция масштабирования образующей кривой. \en The function of curve scale. SPtr winding; ///< \ru Функция вращения образующей кривой. \en The function of curve rotation. @@ -1044,9 +1043,9 @@ public: : SweptValues( ) , mode ( eom_KeepingAngle ) , range ( 0.0 ) - , scaling ( c3d_null ) - , winding ( c3d_null ) - , surface ( c3d_null ) + , scaling ( nullptr ) + , winding ( nullptr ) + , surface ( nullptr ) {} /// \ru Конструктор копирования. \en Copy-constructor. EvolutionValues( const EvolutionValues & other ); @@ -1204,7 +1203,7 @@ public: virtual bool IsSame( const SweptValues & other, double accuracy ) const { const LoftedValues * obj = dynamic_cast( &other ); - if ( obj != c3d_null ) { + if ( obj != nullptr ) { if ( obj->closed == closed ) { if ( c3d::EqualVectors(vector1, obj->vector1, accuracy) && c3d::EqualVectors(vector2, obj->vector2, accuracy) ) { if ( obj->setNormal1 == setNormal1 && obj->setNormal2 == setNormal2 ) { @@ -1295,7 +1294,7 @@ public: { const RibValues * obj = dynamic_cast( &other ); - if ( obj != c3d_null ) { + if ( obj != nullptr ) { if ( obj->side == side ) { if ( ::fabs(obj->angle1 - angle1) < accuracy && ::fabs(obj->angle2 - angle2) < accuracy ) return SweptValues::IsSame( *obj, accuracy ); @@ -1365,7 +1364,7 @@ public: { const SheetRibValues * obj = dynamic_cast( &other ); - if ( obj != c3d_null ) { + if ( obj != nullptr ) { if ( (::fabs(radRibConvex - obj->radRibConvex) < accuracy) && (::fabs(radSideConcave - obj->radSideConcave) < accuracy) ) return RibValues::IsSame( *obj, accuracy ); } @@ -1406,6 +1405,7 @@ public: */ // --- struct MATH_CLASS MbSweptLayout { +public: /** \brief \ru Направление выдавливания (вращения). \en A direction of extrusion (revolution). \~ \details \ru Направление выдавливания (вращения) по отношению к вектору выдавливания (оси вращения). @@ -1466,7 +1466,9 @@ private: */ // --- struct MATH_CLASS MbExtrusionLayout : public MbSweptLayout { +public: MbVector3D dirVector; ///< \ru Вектор выдавливания. \en An extrusion vector. + public: /// \ru Конструктор. \en Constructor. MbExtrusionLayout( const MbSurface & surf, Direction dir, const MbVector3D & dirVec ) : MbSweptLayout( surf, dir ), dirVector( dirVec ) {} @@ -1496,7 +1498,9 @@ private: */ // --- struct MATH_CLASS MbRevolutionLayout : public MbSweptLayout { +public: MbAxis3D revAxis; ///< \ru Ось вращения. \en An revolution axis. + public: /// \ru Конструктор. \en Constructor. MbRevolutionLayout( const MbSurface & surf, Direction dir, const MbAxis3D & rotAxis ) : MbSweptLayout( surf, dir ), revAxis( rotAxis ) {} @@ -1529,8 +1533,8 @@ private: std::vector faces; ///< \ru Опорные грани (могут отсутствовать). \en The reference faces (may be empty). std::vector faceSide; ///< \ru С каких сторон касаться поверхностей при form==cs_Linea (синхронно с faces). \en On which sides to touch surfaces when form==cs_Linea (synchronously with faces). std::vector curves; ///< \ru Направляющие кривые (могут отсутствовать). \en The guide curves (may be empty). - MbCurve3D * track; ///< \ru Кривая, через которую должно пройти сечение (может отсутствовать). \en The curve that the section should pass through (may be c3d_null). - MbFunction * angle; ///< \ru Функция угла наклона (может отсутствовать). \en The function of the angle of inclination (may be c3d_null). + MbCurve3D * track; ///< \ru Кривая, через которую должно пройти сечение (может отсутствовать). \en The curve that the section should pass through (may be nullptr). + MbFunction * angle; ///< \ru Функция угла наклона (может отсутствовать). \en The function of the angle of inclination (may be nullptr). ThreeStates state; ///< \ru Как использовать angle: угол к хорде (ts_neutral), отклонение от касательной поверхности (ts_positive), отклонение от нормали к поверхности (ts_negative). ///< \en How to use angle: angle to chord (ts_neutral), deviation from tangent surface (ts_positive), deviation from normal to surface (ts_negative). public: @@ -1542,8 +1546,8 @@ public: , faces () , faceSide() , curves () - , track ( c3d_null ) - , angle ( c3d_null ) + , track ( nullptr ) + , angle ( nullptr ) , state( ts_neutral ) {} @@ -1560,9 +1564,9 @@ public: \param[in] cs - \ru Направляющие кривые (могут отсутствовать). \en The guide curves (may be empty). \~ \param[in] trk - \ru Кривая, через которую должно пройти сечение (может отсутствовать). - \en The curve that the section should pass through (may be c3d_null). \~ - \param[in] ang - \ru Функция угла наклона (может быть c3d_null). - \en The function of the angle of inclination (may be c3d_null). \~ + \en The curve that the section should pass through (may be nullptr). \~ + \param[in] ang - \ru Функция угла наклона (может быть nullptr). + \en The function of the angle of inclination (may be nullptr). \~ \param[in] st - \ru Как использовать ang. \en How to use ang. \~ */ @@ -1590,7 +1594,9 @@ public: size_t GetEdgesCount() const { return edges.size(); } size_t GetEdgeSideCount() const { return edgeSide.size(); } /// \ru Выдать направляющее ребро. \en Get guide edge. - MbCurveEdge * SetEdge( size_t i ) { return ( i < edges.size() ) ? edges[i] : c3d_null; } + MbCurveEdge * SetEdge( size_t i ) { return ( i < edges.size() ) ? edges[i] : nullptr; } + /// \ru Установить сторону ребра. \en Set edge side. + void SetEdgeSide( size_t i, bool s ) { if ( i < edgeSide.size() ) edgeSide[i] = s; } /// \ru Добавить в данные поверхность. \en Add surface to data. \~ void AddFace( MbFace & _face, bool side ); @@ -1603,7 +1609,9 @@ public: size_t GetFacesCount() const { return faces.size(); } size_t GetFaceSideCount() const { return faceSide.size(); } /// \ru Выдать направляющую грань. \en Get guide face. - MbFace * SetFace( size_t i ) { return ( i < faces.size() ) ? faces[i] : c3d_null; } + MbFace * SetFace( size_t i ) { return ( i < faces.size() ) ? faces[i] : nullptr; } + /// \ru Установить сторону касания грани. \en Set face side. + void SetFaceSide( size_t i, bool s ) { if ( i < faceSide.size() ) faceSide[i] = s; } /// \ru Добавить в данные кривую. \en Add curve to data. \~ void AddCurve( MbCurve3D & _curve ); @@ -1614,7 +1622,7 @@ public: /// \ru Выдать количество дополнительных направляющих кривых. \en Get additional guide curves count. size_t GetCurvesCount() const { return curves.size(); } /// \ru Выдать дополнительную направляющую кривую. \en Get additional guide curve. - MbCurve3D * SetCurve( size_t i ) { return ( i < curves.size() ) ? curves[i] : c3d_null; } + MbCurve3D * SetCurve( size_t i ) { return ( i < curves.size() ) ? curves[i] : nullptr; } /// \ru Добавить в данные кривую. \en Add curve to data. \~ void SetTrack( MbCurve3D & trk ); @@ -1632,11 +1640,11 @@ public: void SetState( ThreeStates st ) { state = st; } /// \ru Преобразовать объект. \en Transform the object. \~ - void Transform( const MbMatrix3D & matr, MbRegTransform * iReg = c3d_null ); + void Transform( const MbMatrix3D & matr, MbRegTransform * iReg = nullptr ); /// \ru Сдвинуть объект. \en Move the object. \~ - void Move ( const MbVector3D & to, MbRegTransform * iReg = c3d_null ); + void Move ( const MbVector3D & to, MbRegTransform * iReg = nullptr ); /// \ru Повернуть объект. \en Rotate the object. \~ - void Rotate ( const MbAxis3D & axis, double angle, MbRegTransform * iReg = c3d_null ); + void Rotate ( const MbAxis3D & axis, double angle, MbRegTransform * iReg = nullptr ); /// \ru Определить, являются ли объекты равными? \en Determine whether an object is equal? bool IsSame( const MbSectionRail & other, double accuracy ) const; /// \ru Определить, являются ли объекты подобными. \en Determine whether the objects are similar. \~ @@ -1666,9 +1674,8 @@ public: */ // --- struct MATH_CLASS MbSectionRule { - public: - MbFunction * discr; ///< \ru Функция управления сечением (дискриминант или радиус, может быть c3d_null). \en Section control function (discriminant or radius). + MbFunction * discr; ///< \ru Функция управления сечением (дискриминант или радиус, может быть nullptr). \en Section control function (discriminant or radius). MbCurve3D * track; ///< \ru Кривая, через которую должно пройти сечение. \en The curve that the section should pass through. MbSurface * touch; ///< \ru Поверхность, которой должно касаться сечение. \en The surface that the section should touch. MbFaceShell * shell; ///< \ru Оболочка, которой должно касаться сечение. \en The shell that the section should touch. @@ -1712,11 +1719,11 @@ public: void SetShell( MbFaceShell & s ); /// \ru Преобразовать объект. \en Transform the object. \~ - void Transform( const MbMatrix3D & matr, MbRegTransform * iReg = c3d_null ); + void Transform( const MbMatrix3D & matr, MbRegTransform * iReg = nullptr ); /// \ru Сдвинуть объект. \en Move the object. \~ - void Move ( const MbVector3D & to, MbRegTransform * iReg = c3d_null ); + void Move ( const MbVector3D & to, MbRegTransform * iReg = nullptr ); /// \ru Повернуть объект. \en Rotate the object. \~ - void Rotate ( const MbAxis3D & axis, double angle, MbRegTransform * iReg = c3d_null ); + void Rotate ( const MbAxis3D & axis, double angle, MbRegTransform * iReg = nullptr ); /// \ru Определить, являются ли объекты равными? \en Determine whether an object is equal? bool IsSame( const MbSectionRule & other, double accuracy ) const; /// \ru Определить, являются ли объекты подобными. \en Determine whether the objects are similar. \~ @@ -1785,9 +1792,9 @@ private: MbeSectionShape form; ///< \ru Форма сечения поверхности. \en The surface cross-section shape. MbSectionRail rail1; ///< \ru Данные начального края сечения. \en The data of the begining of section. MbSectionRail rail2; ///< \ru Данные конечного края сечения. \en The data of the end of section. - MbCurve3D * apexCurve; ///< \ru Кривая вершин (может отсутствовать). \en The apex curve (may be c3d_null). - MbSectionRule descript; ///< \ru Функция управления сечением поверхности (радиус или дискриминант, может быть c3d_null). \en The section control function (radius or discriminant). - MbPolyCurve * pattern; ///< \ru Образующая кривая при form==cs_Shape (для других форм c3d_null). \en Forming curve for form==cs_Shape (c3d_null on other case). + MbCurve3D * apexCurve; ///< \ru Кривая вершин (может отсутствовать). \en The apex curve (may be nullptr). + MbSectionRule descript; ///< \ru Функция управления сечением поверхности (радиус или дискриминант, может быть nullptr). \en The section control function (radius or discriminant). + MbPolyCurve * pattern; ///< \ru Образующая кривая при form==cs_Shape (для других форм nullptr). \en Forming curve for form==cs_Shape (nullptr on other case). double uMin; ///< \ru Минимальное значение первого параметра. \en Minimal value of the first parameter. double uMax; ///< \ru Максимальное значение первого параметра. \en Maximal value of the first parameter. double buildSag; ///< \ru Угловое отклонение при движении по кривым и поверхностям. \en Angular deviation while moving along curves and surfaces. @@ -1809,12 +1816,12 @@ public: \en The data of the begining of section. \~ \param[in] r2 - \ru Данные конечного края сечения. \en The data of the end of section. \~ - \param[in] ap - \ru Кривая вершин (может быть c3d_null). + \param[in] ap - \ru Кривая вершин (может быть nullptr). \en The apex curve (may be empty). \~ - \param[in] desc - \ru Функция управления сечением (может быть c3d_null). - \en Section control function (may be c3d_null). \~ - \param[in] patt - \ru Образующая кривая (может быть c3d_null). - \en Forming curve (may be c3d_null). \~ + \param[in] desc - \ru Функция управления сечением (может быть nullptr). + \en Section control function (may be nullptr). \~ + \param[in] patt - \ru Образующая кривая (может быть nullptr). + \en Forming curve (may be nullptr). \~ */ MbSectionData( MbCurve3D & sp, MbeSectionShape f, @@ -1834,7 +1841,7 @@ public: /// \ru Установить опорную кривую. \en Set reference curve. void SetSpine( MbCurve3D & s ); - //< \ru Установить вектор направления опорной кривой (если spine==c3d_null). \en Set the direction vector of the reference curve (if spine= = c3d_null). + //< \ru Установить вектор направления опорной кривой (если spine==nullptr). \en Set the direction vector of the reference curve (if spine= = nullptr). void SetSpine( const MbVector3D & a ); /// \ru Выдать опорную кривую. \en Get reference curve. const MbCurve3D * GetSpine() const { return spine; } @@ -1992,11 +1999,11 @@ public: void SetCheck( bool c ); /// \ru Преобразовать объект. \en Transform the object. \~ - void Transform( const MbMatrix3D & matr, MbRegTransform * iReg = c3d_null ); + void Transform( const MbMatrix3D & matr, MbRegTransform * iReg = nullptr ); /// \ru Сдвинуть объект. \en Move the object. \~ - void Move ( const MbVector3D & to, MbRegTransform * iReg = c3d_null ); + void Move ( const MbVector3D & to, MbRegTransform * iReg = nullptr ); /// \ru Повернуть объект. \en Rotate the object. \~ - void Rotate ( const MbAxis3D & axis, double angle, MbRegTransform * iReg = c3d_null ); + void Rotate ( const MbAxis3D & axis, double angle, MbRegTransform * iReg = nullptr ); /// \ru Определить, являются ли объекты равными? \en Determine whether an object is equal? bool IsSame( const MbSectionData & other, double acc ) const; /// \ru Определить, являются ли объекты подобными. \en Determine whether the objects are similar. \~ diff --git a/C3d/Include/pars_equation_tree.h b/C3d/Include/pars_equation_tree.h index 7287fdd..3698cc1 100644 --- a/C3d/Include/pars_equation_tree.h +++ b/C3d/Include/pars_equation_tree.h @@ -75,7 +75,7 @@ struct CharacterPointInfo equPoint_DerBreak1 ///< \ru Разрыв производной. \en Derivative discontinuity. }; - const BTreeNode * m_tree; ///< \ru Узел дерева. Не равен c3d_null. \en Node of a tree. Not equal to c3d_null. + const BTreeNode * m_tree; ///< \ru Узел дерева. Не равен nullptr. \en Node of a tree. Not equal to nullptr. EquCharacterPointType m_type; ///< \ru Тип характерной точки. \en Type of a characteristic point. double m_ph; ///< \ru Значение параметра функции. \en The value of the function parameter. double m_period; ///< \ru Период функции. \en A period of a function. @@ -461,10 +461,10 @@ public: \return \ru Переменную для фиксирования. \en Variable for fixation. \~ */ - virtual std_unique_ptr FixVars( const RPArray & unfixedVars, + virtual std::unique_ptr FixVars( const RPArray & unfixedVars, PArray & newFuncs, EquTreeResCode & code ) const = 0; /// \ru Дать эквивалентный узел. \en Get equivalent node. - virtual std_unique_ptr GetCalcEquivalent() const = 0; + virtual std::unique_ptr GetCalcEquivalent() const = 0; /** \brief \ru Дать строку. \en Get string. \~ @@ -653,8 +653,8 @@ IMPL_PERSISTENT_OPS( TreeIntervalNode ) // --- class MATH_CLASS IntervalConstNode : public TreeIntervalNode { - BTreeNode * m_firstValue; ///< \ru Первое значение (всегда не c3d_null). \en First value (always not c3d_null). - BTreeNode * m_secondValue; ///< \ru Второе значение (всегда не c3d_null). \en Second value (always not c3d_null). + BTreeNode * m_firstValue; ///< \ru Первое значение (всегда не nullptr). \en First value (always not nullptr). + BTreeNode * m_secondValue; ///< \ru Второе значение (всегда не nullptr). \en Second value (always not nullptr). public: @@ -752,7 +752,7 @@ IMPL_PERSISTENT_OPS( IntervalConstNode ) // --- class MATH_CLASS IntervalIdentNode : public TreeIntervalNode { - ItIntervalTreeVariable * m_ident; ///< \ru Всегда не c3d_null. \en Always not c3d_null. + ItIntervalTreeVariable * m_ident; ///< \ru Всегда не nullptr. \en Always not nullptr. public: /** \brief \ru Конструктор. @@ -867,18 +867,18 @@ public: \details \ru Получить вложенный узел по индексу.\n \en Get a child node by an index.\n \~ */ - virtual BTreeNode * GetSubNode( size_t /*i*/ ) { return c3d_null; } + virtual BTreeNode * GetSubNode( size_t /*i*/ ) { return nullptr; } virtual bool GetDefRange(DefRange &, ItTreeVariable &, bool /*stopOnBreak*/ ) const { return true; } virtual void GetUsedVariables( SSArray &, SSArray & )const{} - virtual std_unique_ptr FixVars( const RPArray & /*unfixedVars*/, + virtual std::unique_ptr FixVars( const RPArray & /*unfixedVars*/, PArray & /*newFuncs*/, EquTreeResCode & ) const - { return std_unique_ptr(Duplicate()); } + { return std::unique_ptr(Duplicate()); } - virtual std_unique_ptr GetCalcEquivalent() const - { return std_unique_ptr(Duplicate()); } + virtual std::unique_ptr GetCalcEquivalent() const + { return std::unique_ptr(Duplicate()); } virtual void GetString( c3d::string_t & str ) const; virtual size_t SizeOf() const; @@ -981,14 +981,14 @@ public : \{ */ /// \ru Дать вложенный узел по индексу. \en Get a child node by an index. - virtual BTreeNode * GetSubNode( size_t /*i*/ ) { return c3d_null; } + virtual BTreeNode * GetSubNode( size_t /*i*/ ) { return nullptr; } virtual bool GetDefRange( DefRange &, ItTreeVariable &, bool /*stopOnBreak*/ ) const{ return true; } - virtual std_unique_ptr FixVars( const RPArray & unfixed, + virtual std::unique_ptr FixVars( const RPArray & unfixed, PArray & newFuncs, EquTreeResCode & ) const; - virtual std_unique_ptr GetCalcEquivalent() const { return std_unique_ptr(Duplicate()); } + virtual std::unique_ptr GetCalcEquivalent() const { return std::unique_ptr(Duplicate()); } virtual void GetString( c3d::string_t & str ) const { str += id->GetName(); } virtual size_t SizeOf() const; @@ -1142,10 +1142,10 @@ public : /// \ru Дать вложенный узел по индексу. \en Get a child node by an index. virtual BTreeNode * GetSubNode( size_t i ); virtual bool GetDefRange( DefRange &, ItTreeVariable &, bool stopOnBreak ) const; - virtual std_unique_ptr FixVars( const RPArray & unfixed, + virtual std::unique_ptr FixVars( const RPArray & unfixed, PArray & newFuncs, EquTreeResCode & ) const; - virtual std_unique_ptr GetCalcEquivalent() const; + virtual std::unique_ptr GetCalcEquivalent() const; virtual void GetString( c3d::string_t & str ) const; virtual size_t SizeOf() const; @@ -1245,7 +1245,7 @@ private: BTreeNode * op2; ///< \ru Второй операнд. \en The second operand. static SArray varsDerives; ///< \ru Производные аргументов для вычисления производных показательно-степенной функции \en Derivatives of arguments for calculation of derivatives of exponential-power function - static std_unique_ptr deriveFunc; ///< \ru Функция для вычисления производной показательно-степенной функции \en Function for calculation of derivative of the exponential-power function + static std::unique_ptr deriveFunc; ///< \ru Функция для вычисления производной показательно-степенной функции \en Function for calculation of derivative of the exponential-power function public: /** \brief \ru Конструктор. @@ -1304,9 +1304,9 @@ public: virtual BTreeNode * GetSubNode( size_t i ); virtual bool GetDefRange( DefRange &, ItTreeVariable &, bool stopOnBreak ) const; - virtual std_unique_ptr FixVars( const RPArray & unfixed, + virtual std::unique_ptr FixVars( const RPArray & unfixed, PArray & newFuncs, EquTreeResCode & ) const; - virtual std_unique_ptr GetCalcEquivalent() const; + virtual std::unique_ptr GetCalcEquivalent() const; virtual void GetString( c3d::string_t & str ) const; virtual size_t SizeOf() const; @@ -1415,9 +1415,9 @@ public : virtual bool GetCharacterPoints( std::vector & ) const; virtual bool GetDefRange( DefRange & range, ItTreeVariable & var, bool stopOnBreak ) const { C3D_ASSERT( op ); return op->GetDefRange( range, var, stopOnBreak ); } - virtual std_unique_ptr FixVars( const RPArray & unfixed, + virtual std::unique_ptr FixVars( const RPArray & unfixed, PArray & newFuncs, EquTreeResCode & ) const; - virtual std_unique_ptr GetCalcEquivalent() const; + virtual std::unique_ptr GetCalcEquivalent() const; virtual void GetString( c3d::string_t & str ) const; virtual bool IsEqual ( const BTreeNode & other, const EqualVarsMap & equVars ) const { return other.IsEqual( *this, equVars ); } @@ -1475,9 +1475,9 @@ public : virtual BTreeNode * GetSubNode( size_t i ); virtual bool GetDefRange( DefRange &, ItTreeVariable &, bool stopOnBreak ) const; - virtual std_unique_ptr FixVars( const RPArray & unfixed, + virtual std::unique_ptr FixVars( const RPArray & unfixed, PArray & newFuncs, EquTreeResCode & ) const; - virtual std_unique_ptr GetCalcEquivalent() const; + virtual std::unique_ptr GetCalcEquivalent() const; virtual void GetString( c3d::string_t & str ) const; virtual bool IsEqual ( const BTreeNode & other, const EqualVarsMap & equVars ) const { return other.IsEqual( *this, equVars ); } @@ -1550,9 +1550,9 @@ public: // ССА K13 virtual bool GetCharacterPoints( std::vector & ) const { return false; } virtual bool GetDefRange( DefRange &, ItTreeVariable &, bool stopOnBreak ) const; - virtual std_unique_ptr FixVars( const RPArray & unfixed, + virtual std::unique_ptr FixVars( const RPArray & unfixed, PArray & newFuncs, EquTreeResCode & ) const; - virtual std_unique_ptr GetCalcEquivalent() const; + virtual std::unique_ptr GetCalcEquivalent() const; virtual void GetString( c3d::string_t & str ) const; virtual bool IsEqual ( const BTreeNode & other, const EqualVarsMap & equVars ) const { return other.IsEqual( *this, equVars ); } diff --git a/C3d/Include/pars_user_function.h b/C3d/Include/pars_user_function.h index 4c82ef1..83cfdbb 100644 --- a/C3d/Include/pars_user_function.h +++ b/C3d/Include/pars_user_function.h @@ -96,7 +96,7 @@ public: /// \ru Получить массив параметров. \en Get array of parameters. void GetPars ( RPArray & pars ) const; /// \ru Получить аргумент по индексу. \en Get argument by index. - ItTreeVariable * GetPar( size_t i ) const { return i < m_vars.Count() ? m_vars[i] : c3d_null; } + ItTreeVariable * GetPar( size_t i ) const { return i < m_vars.Count() ? m_vars[i] : nullptr; } /// \ru Подготовить объект к записи. \en Prepare an object for writing. void WritingBeginEnd( bool begin ) { RegisterVars( begin ? registrable : noRegistrable ); } /// \ru Оператор присваивания. \en Assignment operator. diff --git a/C3d/Include/pars_yacc.h b/C3d/Include/pars_yacc.h index a669b09..38d9580 100644 --- a/C3d/Include/pars_yacc.h +++ b/C3d/Include/pars_yacc.h @@ -71,7 +71,7 @@ struct ItEquVarCreator // --- MATH_FUNC(EquTreeResCode) CreateBTreeForEquation( const c3d::string_t & equstr , ItEquVarCreator & varsCreator - , std_unique_ptr & dRoot + , std::unique_ptr & dRoot ); @@ -87,8 +87,8 @@ MATH_FUNC(EquTreeResCode) CreateBTreeForEquation( const c3d::string_t & eq // --- MATH_FUNC(EquTreeResCode) CreateBTreeForExpression( const c3d::string_t & equstr , ItEquVarCreator * varsCreator - , std_unique_ptr & root - , std_unique_ptr & iRoot + , std::unique_ptr & root + , std::unique_ptr & iRoot ); @@ -128,7 +128,7 @@ MATH_FUNC(bool) IsInequality( const c3d::string_t & ); // --- MATH_FUNC(EquTreeResCode) CreateBTreeForEquation( const TCHAR * equstr , ItEquVarCreator & varsCreator - , std_unique_ptr & dRoot + , std::unique_ptr & dRoot ); @@ -144,8 +144,8 @@ MATH_FUNC(EquTreeResCode) CreateBTreeForEquation( const TCHAR * eq // --- MATH_FUNC(EquTreeResCode) CreateBTreeForExpression( const TCHAR * equstr , ItEquVarCreator * varsCreator - , std_unique_ptr & root - , std_unique_ptr & iRoot + , std::unique_ptr & root + , std::unique_ptr & iRoot ); diff --git a/C3d/Include/part_solid.h b/C3d/Include/part_solid.h index 4613b43..daab194 100644 --- a/C3d/Include/part_solid.h +++ b/C3d/Include/part_solid.h @@ -431,7 +431,7 @@ public: {} public: /// \ru Проверить данные на корректность. \en Check data for correctness. - bool IsValid() const { return (part != c3d_null && ind > -1 && id != SYS_MAX_UINT32); } + bool IsValid() const { return (part != nullptr && ind > -1 && id != SYS_MAX_UINT32); } private: /// \ru Конструктор без параметров. \en Constructor without parameters. MbPartSolidData(); diff --git a/C3d/Include/plane_instance.h b/C3d/Include/plane_instance.h index d0eeebe..20cd6fb 100644 --- a/C3d/Include/plane_instance.h +++ b/C3d/Include/plane_instance.h @@ -66,10 +66,10 @@ public : // \ru Общие функции геометрического объекта. \en Common functions of a geometric object. virtual MbeSpaceType IsA() const; // \ru Тип объекта. \en A type of an object. - virtual MbSpaceItem & Duplicate( MbRegDuplicate * iReg = c3d_null ) const; // \ru Создать копию. \en Create a copy. - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать согласно матрице. \en Transform according to the matrix. - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвинуть вдоль вектора. \en Translate along a vector. - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси. \en Rotate about an axis. + virtual MbSpaceItem & Duplicate( MbRegDuplicate * iReg = nullptr ) const; // \ru Создать копию. \en Create a copy. + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать согласно матрице. \en Transform according to the matrix. + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвинуть вдоль вектора. \en Translate along a vector. + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси. \en Rotate about an axis. virtual bool IsSame ( const MbSpaceItem &, double accuracy = LENGTH_EPSILON ) const; // \ru Являются ли объекты равными? \en Are the objects equal? virtual bool IsSimilar( const MbSpaceItem & ) const; // \ru Являются ли объекты подобными? \en Are the objects similar? virtual bool SetEqual ( const MbSpaceItem & ); // \ru Сделать объекты равными. \en Make the objects equal. @@ -104,7 +104,7 @@ public : MbPlaneItem * SetPlaneItem( size_t ind = 0 ); /// \ru Заменить двумерный геометрический объект. \en Replace two-dimensional geometric object. bool SetPlaneItem( MbPlaneItem * init, size_t ind = 0 ); - /// \ru Добавить двумерный геометрический объект. \en Add two-dimensional geometric object. The method returns the index of added or existing object in MbPlaneInstance (the method returns SYS_MAX_T if the object is c3d_null). + /// \ru Добавить двумерный геометрический объект. \en Add two-dimensional geometric object. The method returns the index of added or existing object in MbPlaneInstance (the method returns SYS_MAX_T if the object is nullptr). size_t AddPlaneItem( MbPlaneItem * init ); /// \ru Метод возвращает индекс двумерного геометрического объекта. \en The method returns the index of two-dimensional geometric object in MbPlaneInstance (the method returns SYS_MAX_T if the object was not finded). size_t GetIndex( MbPlaneItem * init ); @@ -114,13 +114,13 @@ public : MbPlacement3D & SetPlacement() { return place; } /// \ru Преобразовать двумерный объект согласно матрице. \en Transform two-dimensional object according to the matrix. - void Transform( const MbMatrix &, MbRegTransform * iReg = c3d_null ); + void Transform( const MbMatrix &, MbRegTransform * iReg = nullptr ); /// \ru Сдвинуть двумерный объект вдоль вектора. \en Translate two-dimensional object along a vector. - void Move ( const MbVector &, MbRegTransform * iReg = c3d_null ); + void Move ( const MbVector &, MbRegTransform * iReg = nullptr ); /// \ru Повернуть двумерный объект вокруг точки на заданный угол. \en Rotate two-dimensional object at a given angle around an axis. - void Rotate ( const MbCartPoint & pnt, const MbDirection & angle, MbRegTransform * iReg = c3d_null ); + void Rotate ( const MbCartPoint & pnt, const MbDirection & angle, MbRegTransform * iReg = nullptr ); /// \ru Повернуть двумерный объект вокруг точки на заданный угол. \en Rotate two-dimensional object at a given angle around an axis. - void Rotate ( const MbCartPoint & pnt, double angle, MbRegTransform * iReg = c3d_null ); + void Rotate ( const MbCartPoint & pnt, double angle, MbRegTransform * iReg = nullptr ); /// \ru Удалить все объекты эскиза. \en Delete all the sketch items. void DeleteItems(); @@ -168,7 +168,7 @@ inline MbPlaneInstance::MbPlaneInstance( const MbPlacement3D & p, const PlaneIte planeItems.reserve( addCnt ); for ( size_t k = 0; k < addCnt; ++k ) { const MbPlaneItem * planeItem = inits[k]; - if ( planeItem != c3d_null ) { + if ( planeItem != nullptr ) { planeItem->AddRef(); planeItems.push_back( const_cast( planeItem ) ); } @@ -187,7 +187,7 @@ void MbPlaneInstance::GetItems( PlaneItems & items ) const items.reserve( items.size() + addCnt ); SPtr item_i; for ( size_t i = 0; i < addCnt; ++i ) { - if ( planeItems[i] != c3d_null ) { + if ( planeItems[i] != nullptr ) { item_i = planeItems[i]; items.push_back( item_i ); } diff --git a/C3d/Include/plane_item.h b/C3d/Include/plane_item.h index 8447db5..9b88c9f 100644 --- a/C3d/Include/plane_item.h +++ b/C3d/Include/plane_item.h @@ -143,7 +143,7 @@ public : \return \ru Копия объекта. \en Copy of the object. \~ */ - virtual MbPlaneItem & Duplicate( MbRegDuplicate * iReg = c3d_null ) const = 0; + virtual MbPlaneItem & Duplicate( MbRegDuplicate * iReg = nullptr ) const = 0; /** \brief \ru Преобразовать согласно матрице. \en Transform according to the matrix. \~ @@ -174,7 +174,7 @@ public : For transformation of projection curve. It isn't considered if the surface is planar. \~ */ - virtual void Transform( const MbMatrix & matr, MbRegTransform * iReg = c3d_null, const MbSurface * newSurface = c3d_null ) = 0; + virtual void Transform( const MbMatrix & matr, MbRegTransform * iReg = nullptr, const MbSurface * newSurface = nullptr ) = 0; /** \brief \ru Сдвинуть вдоль вектора. \en Translate along a vector. \~ @@ -205,7 +205,7 @@ public : For transformation of projection curve. It isn't considered if the surface is planar. \~ */ - virtual void Move ( const MbVector & to, MbRegTransform * iReg = c3d_null, const MbSurface * newSurface = c3d_null ) = 0; + virtual void Move ( const MbVector & to, MbRegTransform * iReg = nullptr, const MbSurface * newSurface = nullptr ) = 0; /** \brief \ru Повернуть вокруг точки. \en Rotate about a point. \~ @@ -239,7 +239,7 @@ public : It isn't considered if the surface is planar. \~ */ virtual void Rotate( const MbCartPoint & pnt, const MbDirection & angle, - MbRegTransform * iReg = c3d_null, const MbSurface * newSurface = c3d_null ) = 0; + MbRegTransform * iReg = nullptr, const MbSurface * newSurface = nullptr ) = 0; /** \brief \ru Повернуть вокруг точки. \en Rotate about a point. \~ @@ -261,7 +261,7 @@ public : It isn't considered if the surface is planar. \~ */ void Rotate( const MbCartPoint & pnt, double angle, - MbRegTransform * iReg = c3d_null, const MbSurface * newSurface = c3d_null ); + MbRegTransform * iReg = nullptr, const MbSurface * newSurface = nullptr ); /** \brief \ru Определить, являются ли объекты равными. \en Determine whether objects are equal. \~ diff --git a/C3d/Include/point3d.h b/C3d/Include/point3d.h index 7bb9d1b..a8000ea 100644 --- a/C3d/Include/point3d.h +++ b/C3d/Include/point3d.h @@ -49,10 +49,10 @@ public: virtual MbeSpaceType IsA() const; // \ru Тип объекта. \en A type of an object. virtual MbeSpaceType Type() const; // \ru Групповой тип объекта. \en Group type of object. virtual MbeSpaceType Family() const; // \ru Семейство объекта. \en Family of object. - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Создать копию. \en Create a copy. - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать согласно матрице. \en Transform according to the matrix. - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвинуть вдоль вектора. \en Translate along a vector. - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси. \en Rotate about an axis. + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Создать копию. \en Create a copy. + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать согласно матрице. \en Transform according to the matrix. + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвинуть вдоль вектора. \en Translate along a vector. + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси. \en Rotate about an axis. virtual bool IsSame ( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const; // \ru Являются ли объекты равными? \en Are the objects equal? virtual bool SetEqual ( const MbSpaceItem & init ); // \ru Сделать объекты равным. \en Make the objects equal. virtual double DistanceToPoint ( const MbCartPoint3D & ) const; // \ru Вычислить расстояние до точки. \en Calculate the distance to a point. diff --git a/C3d/Include/point_frame.h b/C3d/Include/point_frame.h index f1c18ff..4380319 100644 --- a/C3d/Include/point_frame.h +++ b/C3d/Include/point_frame.h @@ -72,7 +72,7 @@ public: size_t vertsCnt = verts.size(); vertices.reserve( vertsCnt ); for ( size_t k = 0; k < vertsCnt; ++k ) { - if ( verts[k] != c3d_null ) + if ( verts[k] != nullptr ) AddVertex( const_cast( *verts[k] ), same ); } } @@ -96,10 +96,10 @@ public: // \ru Общие функции геометрического объекта \en Common functions of a geometric object virtual MbeSpaceType IsA() const; // \ru Тип объекта. \en A type of an object. virtual MbeSpaceType Type() const; // \ru Групповой тип объекта. \en Group type of object. - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Создать копию. \en Create a copy. - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать согласно матрице. \en Transform according to the matrix. - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвинуть вдоль вектора. \en Translate along a vector. - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси. \en Rotate about an axis. + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Создать копию. \en Create a copy. + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать согласно матрице. \en Transform according to the matrix. + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвинуть вдоль вектора. \en Translate along a vector. + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси. \en Rotate about an axis. virtual bool IsSame ( const MbSpaceItem &, double accuracy = LENGTH_EPSILON ) const; // \ru Являются ли объекты равными? \en Are the objects equal? virtual bool IsSimilar( const MbSpaceItem & ) const; // \ru Являются ли объекты подобными? \en Are the objects similar? virtual bool SetEqual ( const MbSpaceItem & ); // \ru Сделать объекты равным. \en Make the objects equal. @@ -128,9 +128,9 @@ public: /// \ru Выдать количество вершин. \en Get count of vertices. size_t GetVerticesCount() const { return vertices.size(); } /// \ru Получить вершину по индексу. \en Get vertex by an index. - const MbVertex * GetVertex( size_t k ) const { return ((k < vertices.size()) ? vertices[k] : c3d_null ); } + const MbVertex * GetVertex( size_t k ) const { return ((k < vertices.size()) ? vertices[k] : nullptr ); } /// \ru Получить вершину по индексу для возможного редактирования. \en Get vertex by an index for the possible editing. - MbVertex * SetVertex( size_t k ) { return ((k < vertices.size()) ? vertices[k] : c3d_null ); } + MbVertex * SetVertex( size_t k ) { return ((k < vertices.size()) ? vertices[k] : nullptr ); } /// \ru Получить вершины. \en Get vertices. template diff --git a/C3d/Include/position_data.h b/C3d/Include/position_data.h index 180873b..27887fb 100644 --- a/C3d/Include/position_data.h +++ b/C3d/Include/position_data.h @@ -170,7 +170,7 @@ public: /// \ru Установить замкнутость. \en Set closedness. void SetClosed( bool c ) { closed = c; } - const MbCurveEdge * Edge ( size_t i ) const { return ( i < edges.Count() ) ? edges[i] : c3d_null; } + const MbCurveEdge * Edge ( size_t i ) const { return ( i < edges.Count() ) ? edges[i] : nullptr; } const bool Sense( size_t i ) const { return ( i < sense.Count() ) ? sense[i] : false; } size_t Count() const { return edges.Count(); } /// \ru Оператор присваивания. \en Assignment operator. diff --git a/C3d/Include/reference_item.h b/C3d/Include/reference_item.h index 548c9bb..9a2b59c 100644 --- a/C3d/Include/reference_item.h +++ b/C3d/Include/reference_item.h @@ -61,23 +61,20 @@ typedef std::vector ConstRefItemsSPtrVector; \en Reference-counted object. \~ \details \ru Объект, считающий количество своих владельцев. \n Используется в качестве одного из родительских классов геометрических объектов. \n - Если наследник данного класса захватывается другим объектом или алгоритмом,то другой - объект или алгоритм должен увеличить счетчик ссылок на единицу методом AddRef(). - При отказе от использования наследника данного класса другим объектом (например, при деструктурировании) - или алгоритмом другой объект или алгоритм должны уменьшить счетчик ссылок на единицу - методом Release(). Такое правило позволяет использовать одного и того же наследника - данного класса несколькими другим объектами или алгоритмами одновременно и гарантирует, - что объект будет удалён, когда он станет никому не нужен.\n - + Если экземпляр наследника от данного класса захватывается другим объектом или алгоритмом, + то другой объект или алгоритм должен увеличить счетчик ссылок на единицу методом AddRef(). + При освобождении экземпляра данного класса другим объектом (например, при деструктурировании указателя SPtr) + или алгоритмом другой объект или алгоритм должны вызвать метод Release() для уменьшения счетчика + ссылок. Такое правило позволяет гарантировать действительность экземпяра класса, пока существует + хотя бы один его прользователь.\n \en Object counting number of its owners. \n Is used as one of parent classes of geometric objects. \n - If inheritor of current class is captured by other object or algorithm, then the other - object or algorithm has to increase reference counter by one by AddRef() method. - At refusal of use of the successor of this class by other object (for example at destruction) - or by algorithm, the other object or algorithm has to decrease reference counter - by one by Release() method. Such rule allows to use the same inheritor of current - class simultaneously by several other objects or algorithms and guarantees that the - object will be removed when it becomes unnecessary.\n \~ + If an instance inheriting this class is captured by other object or used in algorithms, + then the other object or algorithm has to increase reference counter by one by AddRef() method. + When an instance of this class is released by another object (for example, when the SPtr pointer is destructed) + or by the using algorithm, the using object or algorithm must call the Release() method to decrease + the reference count. Such rule allows you to guarantee the validity of the MbRefItem + instance as long as there is at least one of its users.\n\~ \note \ru Рекомендуется применение автоматических указателей типа SPtr к экземплярам данного класса. Это упростит работу с кодом, где нужно позаботится об автоматической @@ -96,10 +93,10 @@ 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. -public: +protected: /// \ru Конструктор без параметров. \en Constructor without parameters. MbRefItem(); -protected: +public: virtual ~MbRefItem(); public: @@ -195,9 +192,9 @@ template MbSerialItem::~MbSerialItem() template inline void DeleteMatItem( Type *& item ) { - if ( item != c3d_null ) { + if ( item != nullptr ) { delete item; - item = c3d_null; + item = nullptr; } } @@ -248,8 +245,8 @@ Type & DuplicateIfUsed( Type & item, RegType * iReg ) template Type * DuplicateIfUsed( SPtr & item ) { - if ( item == c3d_null ) - return c3d_null; + if ( item == nullptr ) + return nullptr; Type * resItem = item.get(); if ( item->GetUseCount() > 1 ) // \ru Если оригинал, то делаем копию. \en If there is original, then make a copy. resItem = static_cast( &item->Duplicate() ); @@ -264,8 +261,8 @@ Type * DuplicateIfUsed( SPtr & item ) template Type * DuplicateIfUsed( SPtr & item, RegType * iReg ) { - if ( item == c3d_null ) - return c3d_null; + if ( item == nullptr ) + return nullptr; Type * resItem = item.get(); if ( item->GetUseCount() > 1 ) // \ru Если оригинал, то делаем копию. \en If there is original, then make a copy. resItem = static_cast( &item->Duplicate( iReg ) ); @@ -279,10 +276,10 @@ Type * DuplicateIfUsed( SPtr & item, RegType * iReg ) template void DeleteItem( Type *& item ) { - if ( item != c3d_null ) { + if ( item != nullptr ) { if ( item->GetUseCount() < 1 ) delete item; - item = c3d_null; + item = nullptr; } } @@ -292,9 +289,9 @@ void DeleteItem( Type *& item ) template void ReleaseItem( Type *& item ) { - if ( item != c3d_null ) { + if ( item != nullptr ) { item->Release(); - item = c3d_null; // SKIP_SA + item = nullptr; // SKIP_SA } } // SKIP_SA @@ -304,7 +301,7 @@ void ReleaseItem( Type *& item ) template void AddRefItem( const Type * item ) { - if ( item != c3d_null ) + if ( item != nullptr ) item->AddRef(); } @@ -314,7 +311,7 @@ void AddRefItem( const Type * item ) template void DecRefItem( const Type * item ) { - if ( item != c3d_null ) + if ( item != nullptr ) item->DecRef(); } @@ -326,7 +323,7 @@ template void AddRefItems( const ItemsVector & items ) { for ( size_t k = 0, itemsCnt = items.size(); k < itemsCnt; ++k ) { - if ( items[k] != c3d_null ) + if ( items[k] != nullptr ) items[k]->AddRef(); } } @@ -339,7 +336,7 @@ template void DecRefItems( const ItemsVector & items ) { for ( size_t k = 0, itemsCnt = items.size(); k < itemsCnt; ++k ) { - if ( items[k] != c3d_null ) + if ( items[k] != nullptr ) items[k]->DecRef(); } } @@ -442,7 +439,7 @@ void AddRefItems( const TypeVector & srcItems, bool same, RPArray & dstIte if ( (srcItems.size() > 0) && reinterpret_cast( &srcItems ) != reinterpret_cast( &dstItems ) ) { dstItems.reserve( dstItems.size() + srcItems.size() ); for ( size_t k = 0, cnt = srcItems.size(); k < cnt; ++k ) { - if ( srcItems[k] != c3d_null ) { + if ( srcItems[k] != nullptr ) { Type * srcItem = &const_cast(*srcItems[k]); Type * dstItem = same ? srcItem : static_cast( &srcItem->Duplicate() ); dstItem->AddRef(); @@ -462,7 +459,7 @@ void AddRefItems( const TypeVector & srcItems, bool same, std::vector< SPtr 0) && reinterpret_cast(&srcItems) != reinterpret_cast(&dstItems) ) { dstItems.reserve( dstItems.size() + srcItems.size() ); for ( size_t k = 0, cnt = srcItems.size(); k < cnt; k++ ) { - if ( srcItems[k] != c3d_null ) { + if ( srcItems[k] != nullptr ) { Type * srcItem = &const_cast(*srcItems[k]); SPtr dstItem; dstItem = same ? srcItem : static_cast( &srcItem->Duplicate() ); @@ -482,7 +479,7 @@ void AddRefItems( const TypeVector & srcItems, bool same, std::vector & if ( (srcItems.size() > 0) && reinterpret_cast( &srcItems ) != reinterpret_cast( &dstItems ) ) { dstItems.reserve( dstItems.size() + srcItems.size() ); for ( size_t k = 0, cnt = srcItems.size(); k < cnt; ++k ) { - if ( srcItems[k] != c3d_null ) { + if ( srcItems[k] != nullptr ) { Type * srcItem = &const_cast(*srcItems[k]); Type * dstItem = same ? srcItem : static_cast( &srcItem->Duplicate() ); dstItem->AddRef(); @@ -502,7 +499,7 @@ void AddRefRegItems( const TypeVector & srcItems, bool same, RPArray & dst if ( (srcItems.size() > 0) && reinterpret_cast(&srcItems) != reinterpret_cast(&dstItems) ) { dstItems.reserve( dstItems.size() + srcItems.size() ); for ( size_t k = 0, cnt = srcItems.size(); k < cnt; ++k ) { - if ( srcItems[k] != c3d_null ) { + if ( srcItems[k] != nullptr ) { Type * srcItem = &const_cast(*srcItems[k]); Type * dstItem = same ? srcItem : static_cast( &srcItem->Duplicate( iReg ) ); dstItem->AddRef(); @@ -522,7 +519,7 @@ void AddRefRegItems( const TypeVector & srcItems, bool same, std::vector< SPtr 0) && reinterpret_cast(&srcItems) != reinterpret_cast(&dstItems) ) { dstItems.reserve( dstItems.size() + srcItems.size() ); for ( size_t k = 0, cnt = srcItems.size(); k < cnt; ++k ) { - if ( srcItems[k] != c3d_null ) { + if ( srcItems[k] != nullptr ) { Type * srcItem = &const_cast(*srcItems[k]); SPtr dstItem; dstItem = same ? srcItem : static_cast( &srcItem->Duplicate( iReg ) ); @@ -542,7 +539,7 @@ void AddRefRegItems( const TypeVector & srcItems, bool same, std::vector if ( (srcItems.size() > 0) && reinterpret_cast(&srcItems) != reinterpret_cast(&dstItems) ) { dstItems.reserve( dstItems.size() + srcItems.size() ); for ( size_t k = 0, cnt = srcItems.size(); k < cnt; ++k ) { - if ( srcItems[k] != c3d_null ) { + if ( srcItems[k] != nullptr ) { Type * srcItem = &const_cast(*srcItems[k]); Type * dstItem = same ? srcItem : static_cast( &srcItem->Duplicate( iReg ) ); dstItem->AddRef(); @@ -559,9 +556,9 @@ void AddRefRegItems( const TypeVector & srcItems, bool same, std::vector template bool IsItemSame( const Item * item1, const Item * item2, double accuracy ) { - if ( (item1 == c3d_null) && (item2 == c3d_null) ) + if ( (item1 == nullptr) && (item2 == nullptr) ) return true; - else if ( (item1 != c3d_null) && (item2 != c3d_null) && item1->IsSame( *item2, accuracy ) ) + else if ( (item1 != nullptr) && (item2 != nullptr) && item1->IsSame( *item2, accuracy ) ) return true; return false; } @@ -579,7 +576,7 @@ bool AreItemsSame( const Vector & items1, const Vector & items2, double accuracy if ( cnt == items2.size() ) { areEqual = true; for ( size_t k = 0; k < cnt; ++k ) { - if ( (items1[k] == c3d_null) || (items2[k] == c3d_null) || !items1[k]->IsSame( *items2[k], accuracy ) ) { + if ( (items1[k] == nullptr) || (items2[k] == nullptr) || !items1[k]->IsSame( *items2[k], accuracy ) ) { areEqual = false; break; } @@ -625,7 +622,7 @@ bool AreItemsSimilar( const Vector & items1, const Vector & items2 ) if ( cnt == items2.size() ) { areEqual = true; for ( size_t k = 0; k < cnt; ++k ) { - if ( (items1[k] == c3d_null) || (items2[k] == c3d_null) || !items1[k]->IsSimilar( *items2[k] ) ) { + if ( (items1[k] == nullptr) || (items2[k] == nullptr) || !items1[k]->IsSimilar( *items2[k] ) ) { areEqual = false; break; } @@ -650,7 +647,7 @@ bool SetItemsEqual( const Vector & srcItems, Vector & dstItems ) if ( setEqual ) { for ( size_t k = 0; k < cnt; ++k ) { - if ( srcItems[k] == c3d_null || dstItems[k] == c3d_null || !dstItems[k]->SetEqual( *srcItems[k] ) ) { + if ( srcItems[k] == nullptr || dstItems[k] == nullptr || !dstItems[k]->SetEqual( *srcItems[k] ) ) { setEqual = false; break; } @@ -672,7 +669,7 @@ void DuplicateItems( const TypeVector & srcItems, RegType * iReg, bool same, RPA dstItems.Reserve( srcItems.size() ); for ( size_t k = 0, cnt = srcItems.size(); k < cnt; ++k ) { Type * srcItem = srcItems[k]; - if ( srcItem != c3d_null ) { + if ( srcItem != nullptr ) { Type * dstItem = same ? srcItem : static_cast( &srcItem->Duplicate( iReg ) ); dstItems.push_back( dstItem ); } @@ -690,7 +687,7 @@ void DuplicateItems( const TypeVector & srcItems, RegType * iReg, bool same, std dstItems.reserve( dstItems.size() + srcItems.size() ); for ( size_t k = 0, cnt = srcItems.size(); k < cnt; ++k ) { Type * srcItem = srcItems[k]; - if ( srcItem != c3d_null ) { + if ( srcItem != nullptr ) { SPtr dstItem; dstItem = same ? srcItem : static_cast( &srcItem->Duplicate( iReg ) ); dstItems.push_back( dstItem ); @@ -709,7 +706,7 @@ void DuplicateItems( const TypeVector & srcItems, RegType * iReg, bool same, std dstItems.reserve( dstItems.size() + srcItems.size() ); for ( size_t k = 0, cnt = srcItems.size(); k < cnt; ++k ) { Type * srcItem = srcItems[k]; - if ( srcItem != c3d_null ) { + if ( srcItem != nullptr ) { Type * dstItem = same ? srcItem : static_cast( &srcItem->Duplicate( iReg ) ); dstItems.push_back( dstItem ); } @@ -724,7 +721,7 @@ template void TransformItems( Array & items, const Matrix & matr, RegType * iReg ) { for ( size_t k = 0, cnt = items.size(); k < cnt; ++k ) { - if ( items[k] != c3d_null ) + if ( items[k] != nullptr ) items[k]->Transform( matr, iReg ); } } @@ -736,7 +733,7 @@ template void TransformItems( Array & items, const Matrix & matr ) { for ( size_t k = 0, cnt = items.size(); k < cnt; ++k ) { - if ( items[k] != c3d_null ) + if ( items[k] != nullptr ) items[k]->Transform( matr ); } } @@ -759,7 +756,7 @@ template void MoveItems( Array & items, const Vector & to, RegType * iReg ) { for ( size_t k = 0, cnt = items.size(); k < cnt; ++k ) { - if ( items[k] != c3d_null ) + if ( items[k] != nullptr ) items[k]->Move( to, iReg ); } } @@ -771,7 +768,7 @@ template void MoveItems( Array & items, const Vector & to ) { for ( size_t k = 0, cnt = items.size(); k < cnt; ++k ) { - if ( items[k] != c3d_null ) + if ( items[k] != nullptr ) items[k]->Move( to ); } } @@ -794,7 +791,7 @@ template void RotateItems( Array & items, const Axis & axis, double angle, RegType * iReg ) { for ( size_t k = 0, cnt = items.size(); k < cnt; ++k ) { - if ( items[k] != c3d_null ) + if ( items[k] != nullptr ) items[k]->Rotate( axis, angle, iReg ); } } @@ -806,7 +803,7 @@ template void RotateItems( Array & items, const Axis & axis, double angle ) { for ( size_t k = 0, cnt = items.size(); k < cnt; ++k ) { - if ( items[k] != c3d_null ) + if ( items[k] != nullptr ) items[k]->Rotate( axis, angle ); } } @@ -831,7 +828,7 @@ void WriteRefItems( const Vector & items, Writer & out ) size_t k, cnt = items.size(); for ( k = 0; k < cnt; ++k ) { - if ( items[k] == c3d_null ) + if ( items[k] == nullptr ) cnt--; } @@ -839,7 +836,7 @@ void WriteRefItems( const Vector & items, Writer & out ) if ( out.good() ) { for ( k = 0; k < cnt; ++k ) { - if ( items[k] != c3d_null ) { + if ( items[k] != nullptr ) { items[k]->PrepareWrite(); out << &(*items[k]); } @@ -857,7 +854,7 @@ void WriteRefItems( const std::vector< SPtr > & items, Writer & out ) size_t k, cnt = items.size(); for ( k = 0; k < cnt; ++k ) { - if ( items[k] == c3d_null ) + if ( items[k] == nullptr ) cnt--; } @@ -865,7 +862,7 @@ void WriteRefItems( const std::vector< SPtr > & items, Writer & out ) if ( out.good() ) { for ( k = 0; k < cnt; ++k ) { - if ( items[k] != c3d_null ) { + if ( items[k] != nullptr ) { items[k]->PrepareWrite(); out << items[k].get(); } @@ -886,9 +883,9 @@ void ReadRefItems( Reader & in, RPArray & items ) items.reserve( items.size() + cnt ); for ( size_t i = 0; i < cnt; ++i ) { - Type * item = c3d_null; + Type * item = nullptr; in >> item; - if ( item != c3d_null ) { + if ( item != nullptr ) { items.push_back( item ); item->AddRef(); } @@ -907,9 +904,9 @@ void ReadRefItems( Reader & in, std::vector & items ) if ( in.good() && cnt > 0 ) { for ( size_t i = 0; i < cnt; ++i ) { - Type * item = c3d_null; + Type * item = nullptr; in >> item; - if ( item != c3d_null ) { + if ( item != nullptr ) { items.push_back( item ); item->AddRef(); } @@ -928,9 +925,9 @@ void ReadRefItems( Reader & in, std::vector< SPtr > & items ) if ( in.good() && cnt > 0 ) { for ( size_t i = 0; i < cnt; ++i ) { - Type * item = c3d_null; + Type * item = nullptr; in >> item; - if ( item != c3d_null ) + if ( item != nullptr ) items.push_back( SPtr(item) ); } } @@ -1069,7 +1066,7 @@ inline Type * DetachItem( SPtr & itemOwner ) template void ReplaceByCopy( Type *& item ) { - if ( item != c3d_null ) { + if ( item != nullptr ) { Type * temp = static_cast( &item->Duplicate() ); ::DeleteItem( item ); item = temp; @@ -1084,7 +1081,7 @@ template void AddYourGabaritTo( Objects & objects, Gab & gab ) { for ( size_t k = 0, cnt = objects.size(); k < cnt; ++k ) { - if ( objects[k] != c3d_null ) + if ( objects[k] != nullptr ) objects[k]->AddYourGabaritTo( gab ); } } diff --git a/C3d/Include/region.h b/C3d/Include/region.h index 995dc57..971247a 100644 --- a/C3d/Include/region.h +++ b/C3d/Include/region.h @@ -51,7 +51,7 @@ public: MbRegion( const SPtr &, bool same ); ///< \ru Регион с одним внешним контуром. \en Region with one external contour. MbRegion( const RPArray &, bool same ); ///< \ru Регион с несколькими контурами. \en Region with several contours. MbRegion( const std::vector< SPtr > &, bool same ); ///< \ru Регион с несколькими контурами. \en Region with several contours. - MbRegion( const MbRegion &, bool same, MbRegDuplicate * iReg = c3d_null ); ///< \ru Конструктор копии. \en Copy-constructor. + MbRegion( const MbRegion &, bool same, MbRegDuplicate * iReg = nullptr ); ///< \ru Конструктор копии. \en Copy-constructor. public: virtual ~MbRegion(); @@ -63,10 +63,10 @@ public: virtual MbePlaneType IsA() const; // \ru Тип объекта. \en A type of an object. virtual MbePlaneType Type() const; // \ru Групповой тип объекта. \en Group type of object. virtual MbePlaneType Family() const; // \ru Семейство объекта. \en Family of object. - virtual MbPlaneItem & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию. \en Create a copy - virtual void Transform( const MbMatrix &, MbRegTransform * = c3d_null, const MbSurface * newSurface = c3d_null ); // \ru Преобразовать согласно матрице. \en Transform according to the matrix. - virtual void Move ( const MbVector &, MbRegTransform * = c3d_null, const MbSurface * newSurface = c3d_null ); // \ru Сдвинуть вдоль вектора. \en Move along a vector. - virtual void Rotate ( const MbCartPoint &, const MbDirection & angle, MbRegTransform * iReg = c3d_null, const MbSurface * newSurface = c3d_null ); + virtual MbPlaneItem & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию. \en Create a copy + virtual void Transform( const MbMatrix &, MbRegTransform * = nullptr, const MbSurface * newSurface = nullptr ); // \ru Преобразовать согласно матрице. \en Transform according to the matrix. + virtual void Move ( const MbVector &, MbRegTransform * = nullptr, const MbSurface * newSurface = nullptr ); // \ru Сдвинуть вдоль вектора. \en Move along a vector. + virtual void Rotate ( const MbCartPoint &, const MbDirection & angle, MbRegTransform * iReg = nullptr, const MbSurface * newSurface = nullptr ); virtual bool IsSame ( const MbPlaneItem &, double accuracy = LENGTH_EPSILON ) const; // \ru Являются ли объекты равными? \en Determine whether objects are equal. virtual bool SetEqual ( const MbPlaneItem & ); // \ru Сделать объекты равным. \en Make objects equal. virtual void AddYourGabaritTo( MbRect & ) const; // \ru Добавить свой габарит в присланный габарит. \en Add your own bounding box into the sent bounding box. @@ -276,7 +276,7 @@ private: // --- MATH_FUNC (bool) CreateBooleanResultRegions( RPArray & contours1, RPArray & contours2, const MbRegionBooleanParams & operParams, RPArray & regions, - MbResultType * resInfo = c3d_null ); + MbResultType * resInfo = nullptr ); //------------------------------------------------------------------------------- @@ -301,7 +301,7 @@ MATH_FUNC (bool) CreateBooleanResultRegions( RPArray & contours1, RPA // --- MATH_FUNC (bool) CreateBooleanResultRegions( MbRegion & region1, MbRegion & region2, const MbRegionBooleanParams & operParams, RPArray & regions, - MbResultType * resInfo = c3d_null ); + MbResultType * resInfo = nullptr ); //------------------------------------------------------------------------------- diff --git a/C3d/Include/sheet_metal_param.h b/C3d/Include/sheet_metal_param.h index 781a4d2..beee6c0 100644 --- a/C3d/Include/sheet_metal_param.h +++ b/C3d/Include/sheet_metal_param.h @@ -393,6 +393,7 @@ public: */ // --- struct MATH_CLASS MbJogValues : public MbBendOverSegValues { +public: double elevation; ///< \ru Высота подсечки. \en A jog height. bool addMaterial; ///< \ru Вкл./откл. режим добавления материала. \en On/off mode of material adding. bool byInnerSide; ///< \ru Линия подсечки находится внутри/снаружи первого сгиба. \en Jog line is inside/outside of the first bend. @@ -460,6 +461,7 @@ struct MATH_CLASS MbJogValues : public MbBendOverSegValues { */ // --- struct MATH_CLASS MbClosedCornerValues { +public: /** \brief \ru Cпособ построения. \en Way of construction. \~ \ingroup Build_Parameters @@ -596,6 +598,7 @@ struct MATH_CLASS MbClosedCornerValues { */ // --- struct MATH_CLASS MbMiterValues : public MbClosedCornerValues { +public: bool allow; ///< \ru Флаг выполнения замыкания. \en Flag of performing closure. /// \ru Конструктор по умолчанию. \en Default constructor. @@ -873,6 +876,7 @@ public: */ // --- struct MATH_CLASS MbJointBendValues : public MbBendValues { +public: double distanceBegin; ///< \ru Отступ от начала ориентированного ребра, принадлежащего листовой грани. \en Distance from beginning of the oriented edge owned sheet face. double distanceEnd; ///< \ru Отступ от конца ориентированного ребра, принадлежащего листовой грани. \en Distance from end of the oriented edge owned sheet face. MbMiterValues miterBegin; ///< \ru Параметры края в начале. \en The parameters of boundary at the beginning. @@ -982,6 +986,7 @@ struct MATH_CLASS MbJointBendValues : public MbBendValues { */ // --- struct MATH_CLASS MbStampingValues { +public: double hight; ///< \ru Высота штамповки. \en Stamping height. double angle; ///< \ru Угол наклона боковых стенок штамповки. \en Slope angle of stamping sidewalls. double sketchFilletRadius; ///< \ru Радиус скругления эскиза (отрицательное значение запрещает скругление). \en Fillet radius of sketch (negative value prohibits fillet). @@ -1088,6 +1093,7 @@ struct MATH_CLASS MbStampingValues { */ // --- struct MATH_CLASS MbBeadValues { +public: /** \brief \ru Тип буртика. \en Type of the bead. \~ \ingroup Build_Parameters @@ -1217,6 +1223,7 @@ struct MATH_CLASS MbBeadValues { */ // --- struct MATH_CLASS MbJalousieValues { +public: double width; ///< \ru Ширина. \en Width. double hight; ///< \ru Высота. \en Height. double filletRadius; ///< \ru Радиус скругления. \en The fillet radius. @@ -1319,6 +1326,7 @@ struct MATH_CLASS MbJalousieValues { */ // --- struct MATH_CLASS MbRuledSolidValues { +public: /** \brief \ru Тип смещения зазора. \en A displacement type of the gap. \~ \details \ru За начало отсчёта принимается начальная точка контура. Угол отмеряется против часовой стрелки, @@ -1358,11 +1366,11 @@ struct MATH_CLASS MbRuledSolidValues { /// \ru Конструктор по умолчанию. \en Default constructor. MbRuledSolidValues() : placement1 ( ), - contour1 ( c3d_null ), - breaks1 ( c3d_null ), - placement2 ( c3d_null ), - contour2 ( c3d_null ), - breaks2 ( c3d_null ), + contour1 ( nullptr ), + breaks1 ( nullptr ), + placement2 ( nullptr ), + contour2 ( nullptr ), + breaks2 ( nullptr ), thickness ( 0.0 ), radius ( 0.0 ), slopeAngle ( 0.0 ), @@ -1376,16 +1384,16 @@ struct MATH_CLASS MbRuledSolidValues { cylindricBends ( false ), joinByVertices ( true ), surfDistance ( 0.0 ), - surface ( c3d_null ) { + surface ( nullptr ) { } /// \ru Конструктор копирования. \en Copy-constructor. MbRuledSolidValues( const MbRuledSolidValues & other ) : placement1 ( other.placement1 ), - contour1 ( (other.contour1 != c3d_null) ? new MbContour() : c3d_null ), - breaks1 ( (other.breaks1 != c3d_null) ? new SArray(*other.breaks1) : c3d_null ), - placement2 ( (other.placement2 != c3d_null) ? new MbPlacement3D(*other.placement2) : c3d_null ), - contour2 ( (other.contour2 != c3d_null) ? new MbContour() : c3d_null ), - breaks2 ( (other.breaks2 != c3d_null) ? new SArray(*other.breaks2) : c3d_null ), + contour1 ( (other.contour1 != nullptr) ? new MbContour() : nullptr ), + breaks1 ( (other.breaks1 != nullptr) ? new SArray(*other.breaks1) : nullptr ), + placement2 ( (other.placement2 != nullptr) ? new MbPlacement3D(*other.placement2) : nullptr ), + contour2 ( (other.contour2 != nullptr) ? new MbContour() : nullptr ), + breaks2 ( (other.breaks2 != nullptr) ? new SArray(*other.breaks2) : nullptr ), thickness ( other.thickness ), radius ( other.radius ), slopeAngle ( other.slopeAngle ), @@ -1399,10 +1407,10 @@ struct MATH_CLASS MbRuledSolidValues { cylindricBends ( other.cylindricBends ), joinByVertices ( other.joinByVertices ), surfDistance ( other.surfDistance ), - surface ( (other.surface != c3d_null) ? static_cast(&other.surface->Duplicate()) : c3d_null ) { - if ( contour1 != c3d_null && other.contour1 != c3d_null ) + surface ( (other.surface != nullptr) ? static_cast(&other.surface->Duplicate()) : nullptr ) { + if ( contour1 != nullptr && other.contour1 != nullptr ) contour1->Init( *other.contour1 ); - if ( contour2 != c3d_null && other.contour2 != c3d_null ) + if ( contour2 != nullptr && other.contour2 != nullptr ) contour2->Init( *other.contour2 ); } /// \ru Конструктор по конкретным параметрам. \en Constructor by specific parameters. @@ -1414,10 +1422,10 @@ struct MATH_CLASS MbRuledSolidValues { const double surfDist, const MbSurface * surf ) : placement1( place1 ), contour1( new MbContour() ), - breaks1( (brks1 != c3d_null) ? new SArray(*brks1) : c3d_null ), - placement2( (place2 != c3d_null) ? new MbPlacement3D(*place2) : c3d_null ), - contour2( (cntr2 != c3d_null) ? new MbContour() : c3d_null ), - breaks2( (brks2 != c3d_null) ? new SArray(*brks2) : c3d_null ), + breaks1( (brks1 != nullptr) ? new SArray(*brks1) : nullptr ), + placement2( (place2 != nullptr) ? new MbPlacement3D(*place2) : nullptr ), + contour2( (cntr2 != nullptr) ? new MbContour() : nullptr ), + breaks2( (brks2 != nullptr) ? new SArray(*brks2) : nullptr ), thickness( thick ), radius( rad ), slopeAngle( sAngle ), @@ -1431,58 +1439,58 @@ struct MATH_CLASS MbRuledSolidValues { cylindricBends( cylBends ), joinByVertices( joinByVert ), surfDistance( surfDist ), - surface( (surf != c3d_null) ? static_cast(&surf->Duplicate()) : c3d_null ) { + surface( (surf != nullptr) ? static_cast(&surf->Duplicate()) : nullptr ) { contour1->Init( cntr1 ); - if ( (contour2 != c3d_null) && (cntr2 != c3d_null) ) + if ( (contour2 != nullptr) && (cntr2 != nullptr) ) contour2->Init( *cntr2 ); } /// \ru Инициализировать по другому объекту. \en Initialize by another object. void Init( const MbRuledSolidValues & other ) { placement1.Init( other.placement1 ); - if ( other.contour1 != c3d_null ) { - if ( contour1 == c3d_null ) + if ( other.contour1 != nullptr ) { + if ( contour1 == nullptr ) contour1 = new MbContour(); contour1->Init( *other.contour1 ); } else - contour1 = c3d_null; + contour1 = nullptr; - if ( other.breaks1 != c3d_null ) { - if ( breaks1 != c3d_null ) + if ( other.breaks1 != nullptr ) { + if ( breaks1 != nullptr ) ((SArray &)*breaks1) = *other.breaks1; else breaks1 = new SArray( *other.breaks1 ); } else - breaks1 = c3d_null; + breaks1 = nullptr; - if ( other.placement2 != c3d_null ) { - if ( placement2 != c3d_null ) + if ( other.placement2 != nullptr ) { + if ( placement2 != nullptr ) placement2->Init( *other.placement2 ); else placement2 = new MbPlacement3D( *other.placement2 ); } else - placement2 = c3d_null; + placement2 = nullptr; - if ( other.contour2 != c3d_null ) { - if ( contour2 == c3d_null ) + if ( other.contour2 != nullptr ) { + if ( contour2 == nullptr ) contour2 = new MbContour(); contour2->Init( *other.contour2 ); } else - contour2 = c3d_null; + contour2 = nullptr; - if ( other.breaks2 != c3d_null ) { - if ( breaks2 != c3d_null ) + if ( other.breaks2 != nullptr ) { + if ( breaks2 != nullptr ) ((SArray &)*breaks2) = *other.breaks2; else breaks2 = new SArray( *other.breaks2 ); } else - breaks1 = c3d_null; + breaks1 = nullptr; thickness = other.thickness; radius = other.radius; @@ -1498,54 +1506,54 @@ struct MATH_CLASS MbRuledSolidValues { joinByVertices = other.joinByVertices; surfDistance = other.surfDistance; - if ( other.surface != c3d_null ) + if ( other.surface != nullptr ) surface = static_cast( &other.surface->Duplicate() ); else - surface = c3d_null; + surface = nullptr; } /// \ru Инициализировать контуры. \en Initialize contours. void Init( const MbPlacement3D & place1, const MbContour & cntr1, const SArray * brks1, const MbPlacement3D * place2, const MbContour * cntr2, const SArray * brks2 ) { placement1.Init( place1 ); - if ( contour1 == c3d_null ) + if ( contour1 == nullptr ) contour1 = new MbContour(); contour1->Init( cntr1 ); - if ( brks1 != c3d_null ) { - if ( breaks1 != c3d_null ) + if ( brks1 != nullptr ) { + if ( breaks1 != nullptr ) ((SArray &)*breaks1) = *brks1; else breaks1 = new SArray( *brks1 ); } else - breaks1 = c3d_null; + breaks1 = nullptr; - if ( place2 != c3d_null ) { - if ( placement2 != c3d_null ) + if ( place2 != nullptr ) { + if ( placement2 != nullptr ) placement2->Init( *place2 ); else placement2 = new MbPlacement3D( *place2 ); } else - placement2 = c3d_null; + placement2 = nullptr; - if ( cntr2 != c3d_null ) { - if ( contour2 == c3d_null ) + if ( cntr2 != nullptr ) { + if ( contour2 == nullptr ) contour2 = new MbContour(); contour2->Init( *cntr2 ); } else - contour2 = c3d_null; + contour2 = nullptr; - if ( brks2 != c3d_null ) { - if ( breaks2 != c3d_null ) + if ( brks2 != nullptr ) { + if ( breaks2 != nullptr ) ((SArray &)*breaks2) = *brks2; else breaks2 = new SArray( *brks2 ); } else - breaks1 = c3d_null; + breaks1 = nullptr; } /// \ru Оператор присваивания. \en Assignment operator. @@ -1574,18 +1582,18 @@ struct MATH_CLASS MbRuledSolidValues { ::fabs( gapShift - other.gapShift ) < accuracy && ::fabs( surfDistance - other.surfDistance ) < accuracy ) { - bool isContour1 = contour1 != c3d_null; - bool isOtherContour1 = other.contour1 != c3d_null; - bool isBreaks1 = breaks1 != c3d_null; - bool isOtherBreaks1 = other.breaks1 != c3d_null; - bool isPlacement2 = placement2 != c3d_null; - bool isOtherPlacement2 = other.placement2 != c3d_null; - bool isContour2 = contour2 != c3d_null; - bool isOtherContour2 = other.contour2 != c3d_null; - bool isBreaks2 = breaks2 != c3d_null; - bool isOtherBreaks2 = other.breaks2 != c3d_null; - bool isSurf = surface != c3d_null; - bool isOtherSurf = other.surface != c3d_null; + bool isContour1 = contour1 != nullptr; + bool isOtherContour1 = other.contour1 != nullptr; + bool isBreaks1 = breaks1 != nullptr; + bool isOtherBreaks1 = other.breaks1 != nullptr; + bool isPlacement2 = placement2 != nullptr; + bool isOtherPlacement2 = other.placement2 != nullptr; + bool isContour2 = contour2 != nullptr; + bool isOtherContour2 = other.contour2 != nullptr; + bool isBreaks2 = breaks2 != nullptr; + bool isOtherBreaks2 = other.breaks2 != nullptr; + bool isSurf = surface != nullptr; + bool isOtherSurf = other.surface != nullptr; if ( isContour1 == isOtherContour1 && isBreaks1 == isOtherBreaks1 && @@ -1645,6 +1653,7 @@ struct MATH_CLASS MbRuledSolidValues { */ // --- struct MATH_CLASS MbSimplifyFlatPatternValues { +public: bool uniteFaces; ///< \ru Флаг слияния подобных граней. \en The merger faces flag. bool cornerTreatment; ///< \ru Флаг упрощения углов развёртки. \en The simplification corners flag. /// \ru Конструктор по умолчанию. \en Default constructor. @@ -1795,13 +1804,13 @@ public: size_t i, cnt; for ( i = 0, cnt = innerFaces.Count(); i < cnt && isSame; i++ ) - if ( innerFaces[i] == c3d_null || other.innerFaces[i] == c3d_null || !innerFaces[i]->IsSame( *other.innerFaces[i], accuracy ) ) { + if ( innerFaces[i] == nullptr || other.innerFaces[i] == nullptr || !innerFaces[i]->IsSame( *other.innerFaces[i], accuracy ) ) { isSame = false; break; } for ( i = 0, cnt = outerFaces.Count(); i < cnt && isSame; i++ ) - if ( outerFaces[i] == c3d_null || other.outerFaces[i] == c3d_null || !outerFaces[i]->IsSame( *other.outerFaces[i], accuracy ) ) { + if ( outerFaces[i] == nullptr || other.outerFaces[i] == nullptr || !outerFaces[i]->IsSame( *other.outerFaces[i], accuracy ) ) { isSame = false; break; } @@ -1930,6 +1939,7 @@ private: */ // --- struct MATH_CLASS MbToolStampingValues { +public: /** \brief \ru Cпособ обработки кромок вырубки. \en Type of pierce edge processing. \~ \ingroup Build_Parameters @@ -2018,6 +2028,7 @@ struct MATH_CLASS MbSolidToSheetMetalValues { public: /// \ru Ребро для построения сгиба и параметры сгиба. \en The bend edge and parameters of bending. \~ struct MATH_CLASS MbBendEdgeValues : public MbBendValues { + public: MbEdgeFacesIndexes bendEdgeIndex; ///< \ru Индекс ребра сгиба. \en Index of bend edge. MbName innerFaceName; ///< \ru Имя внутренней грани сгиба. \en Name of interior face of bend. MbName outerFaceName; ///< \ru Имя внешней грани сгиба. \en Name of exterior face of bend. @@ -2078,6 +2089,7 @@ public: }; /// \ru Ребро разъема и параметры замыкания углов. \en The rip edge and closing corner parameters. \~ struct MbRipEdgeValues { + public: std::vector ripEdgeIndicies; ///< \ru Индекс ребра разъема. \en Index of rip edge. MbClosedCornerValues cornerValues; /// \ru Конструктор по умолчанию. \en Default constructor. diff --git a/C3d/Include/solid.h b/C3d/Include/solid.h index 2575849..330bf69 100644 --- a/C3d/Include/solid.h +++ b/C3d/Include/solid.h @@ -143,10 +143,10 @@ public : // \ru Общие функции геометрического объекта. \en Common functions of a geometric object. virtual MbeSpaceType IsA() const; // \ru Тип объекта. \en A type of an object. - virtual MbSpaceItem & Duplicate( MbRegDuplicate * iReg = c3d_null ) const; // \ru Создать копию. \en Create a copy. - virtual void Transform( const MbMatrix3D &, MbRegTransform * iReg = c3d_null ); // \ru Преобразовать согласно матрице. \en Transform according to the matrix. - virtual void Move ( const MbVector3D &, MbRegTransform * iReg = c3d_null ); // \ru Сдвинуть вдоль вектора. \en Move along a vector. - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * iReg = c3d_null ); // \ru Повернуть вокруг оси. \en Rotate around an axis. + virtual MbSpaceItem & Duplicate( MbRegDuplicate * iReg = nullptr ) const; // \ru Создать копию. \en Create a copy. + virtual void Transform( const MbMatrix3D &, MbRegTransform * iReg = nullptr ); // \ru Преобразовать согласно матрице. \en Transform according to the matrix. + virtual void Move ( const MbVector3D &, MbRegTransform * iReg = nullptr ); // \ru Сдвинуть вдоль вектора. \en Move along a vector. + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * iReg = nullptr ); // \ru Повернуть вокруг оси. \en Rotate around an axis. virtual bool IsSame ( const MbSpaceItem &, double accuracy = LENGTH_EPSILON ) const; // \ru Являются ли объекты равными? \en Determine whether objects are equal. virtual bool IsSimilar( const MbSpaceItem & ) const; // \ru Являются ли объекты подобными? \en Determine whether objects are similar. virtual bool SetEqual ( const MbSpaceItem & ); // \ru Сделать объекты равными. \en Make the objects equal. @@ -246,22 +246,22 @@ public : size_t GetFacesCount() const { return outer ? outer->GetFacesCount() : 0; } /// \ru Заполнить контейнер вершинами тела. \en Fill container by solid vertices. template - void GetVertices( VerticesVector & vertices ) const { if ( outer != c3d_null ) { outer->GetVertices( vertices ); } } + void GetVertices( VerticesVector & vertices ) const { if ( outer != nullptr ) { outer->GetVertices( vertices ); } } /// \ru Заполнить контейнер ориентированными ребрами тела. \en Fill container by oriented edges of the solid. template - void GetEdges( EdgesVector & edges ) const { if ( outer != c3d_null ) { outer->GetEdges( edges ); } } + void GetEdges( EdgesVector & edges ) const { if ( outer != nullptr ) { outer->GetEdges( edges ); } } /// \ru Заполнить контейнеры вершинами и ребрами тела. \en Fill containers by vertices and edges of the solid. template - void GetItems( VerticesVector & vertices, EdgesVector & edges ) const { if ( outer != c3d_null ) { outer->GetItems( vertices, edges ); } } + void GetItems( VerticesVector & vertices, EdgesVector & edges ) const { if ( outer != nullptr ) { outer->GetItems( vertices, edges ); } } /// \ru Заполнить контейнер гранями тела. \en Fill container by solid faces. template - void GetFaces ( FacesVector & faces ) const { if ( outer != c3d_null ) { outer->GetFaces( faces ); } } + void GetFaces ( FacesVector & faces ) const { if ( outer != nullptr ) { outer->GetFaces( faces ); } } /// \ru Заполнить контейнер гранями тела. \en Fill container by solid faces. template - void GetFacesSet( FacesSet & faces ) const { if ( outer != c3d_null ) { outer->GetFacesSet( faces ); } } + void GetFacesSet( FacesSet & faces ) const { if ( outer != nullptr ) { outer->GetFacesSet( faces ); } } /// \ru Заполнить контейнер вершинами, ребрами и гранями тела. \en Fill container by vertices, edges and faces of the solid. template - void GetItems( TopologyItemsVector & items ) const { if ( outer != c3d_null ) { outer->GetItems( items ); } } + void GetItems( TopologyItemsVector & items ) const { if ( outer != nullptr ) { outer->GetItems( items ); } } /// \ru Выдать вершину по её номеру. \en Get vertex by its index. MbVertex * GetVertex( size_t index ) const; diff --git a/C3d/Include/space_instance.h b/C3d/Include/space_instance.h index 11d7d35..208b5ee 100644 --- a/C3d/Include/space_instance.h +++ b/C3d/Include/space_instance.h @@ -73,10 +73,10 @@ public : // \ru Общие функции геометрического объекта. \en Common functions of a geometric object. virtual MbeSpaceType IsA() const; // \ru Тип объекта. \en A type of an object. - virtual MbSpaceItem & Duplicate( MbRegDuplicate * iReg = c3d_null ) const; // \ru Создать копию. \en Create a copy. - virtual void Transform( const MbMatrix3D &, MbRegTransform * iReg = c3d_null ); // \ru Преобразовать согласно матрице. \en Transform according to the matrix. - virtual void Move ( const MbVector3D &, MbRegTransform * iReg = c3d_null ); // \ru Сдвинуть вдоль вектора. \en Translate along a vector. - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * iReg = c3d_null ); // \ru Повернуть вокруг оси. \en Rotate about an axis. + virtual MbSpaceItem & Duplicate( MbRegDuplicate * iReg = nullptr ) const; // \ru Создать копию. \en Create a copy. + virtual void Transform( const MbMatrix3D &, MbRegTransform * iReg = nullptr ); // \ru Преобразовать согласно матрице. \en Transform according to the matrix. + virtual void Move ( const MbVector3D &, MbRegTransform * iReg = nullptr ); // \ru Сдвинуть вдоль вектора. \en Translate along a vector. + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * iReg = nullptr ); // \ru Повернуть вокруг оси. \en Rotate about an axis. virtual bool IsSame ( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const; // \ru Являются ли объекты равными? \en Are the objects equal? virtual bool IsSimilar( const MbSpaceItem & init ) const; // \ru Являются ли объекты подобными? \en Are the objects similar? virtual bool SetEqual ( const MbSpaceItem & init ); // \ru Сделать объекты равными. \en Make the objects equal. diff --git a/C3d/Include/space_item.h b/C3d/Include/space_item.h index 4b76de1..c730531 100644 --- a/C3d/Include/space_item.h +++ b/C3d/Include/space_item.h @@ -122,7 +122,7 @@ enum MbeSpaceType { st_SplineSurface = 319, ///< \ru NURBS поверхность, определяемая точками. \en NURBS surface. st_GridSurface = 320, ///< \ru Поверхность, определяемая точками. \en Surface defined by points. st_TriBezierSurface = 321, ///< \ru Треугольная Bezier поверхность, определяемая точками. \en Triangular Bezier surface. - st_TriSplineSurface = 322, ///< \ru Треугольная NURBS поверхность, определяемая точками. \en Triangular NURBS surface. + st_SimplexSurface = 322, ///< \ru Треугольная NURBS поверхность, определяемая точками. \en Triangular NURBS surface. st_OffsetSurface = 323, ///< \ru Эквидистантная поверхность. \en Offset surface. st_DeformedSurface = 324, ///< \ru Деформированная поверхность. \en Deformed surface. st_NurbsSurface = 325, ///< \ru NURBS поверхность, определяемая кривыми. \en NURBS surface defined by curves. @@ -149,6 +149,7 @@ enum MbeSpaceType { st_GregoryRibbonPatchSurface= 346, ///< \ru Поверхность Грегори с граничными условиями. \en Gregory patch surface with ribbons. st_ExplorationSurface = 347, ///< \ru Поверхность заметания с масштабированием и поворотом образующей кривой. \en Swept surface with scaling and winding of generating curve. st_SectionSurface = 348, ///< \ru Поверхность заметания переменного сечения. \en The swept mutable section surface. + st_SimplexSpline = 349, ///< \ru Поверхность, моделирующая симплексный сплайн. st_FreeSurface = 400, ///< \ru Тип для поверхностей, созданных пользователем. \en Type for the user-defined surfaces. \n // \ru Типы вспомогательных объектов. \en Helper object types. @@ -246,7 +247,7 @@ public : \return \ru Копия объекта. \en A copy of the object. */ - virtual MbSpaceItem & Duplicate( MbRegDuplicate * iReg = c3d_null ) const = 0; + virtual MbSpaceItem & Duplicate( MbRegDuplicate * iReg = nullptr ) const = 0; /** \brief \ru Преобразовать объект согласно матрице. \en Convert the object according to the matrix. \~ @@ -269,7 +270,7 @@ public : \param[in] iReg - \ru Регистратор. \en Registrator. */ - virtual void Transform( const MbMatrix3D & matr, MbRegTransform * iReg = c3d_null ) = 0; + virtual void Transform( const MbMatrix3D & matr, MbRegTransform * iReg = nullptr ) = 0; /** \brief \ru Сдвинуть объект вдоль вектора. \en Move an object along a vector. \~ @@ -292,7 +293,7 @@ public : \param[in] iReg - \ru Регистратор. \en Registrator. */ - virtual void Move ( const MbVector3D & to, MbRegTransform * iReg = c3d_null ) = 0; + virtual void Move ( const MbVector3D & to, MbRegTransform * iReg = nullptr ) = 0; /** \brief \ru Повернуть объект вокруг оси на заданный угол. \en Rotate an object around an axis at a given angle. \~ @@ -317,7 +318,7 @@ public : \param[in] iReg - \ru Регистратор. \en Registrator. */ - virtual void Rotate ( const MbAxis3D & axis, double angle, MbRegTransform * iReg = c3d_null ) = 0; + virtual void Rotate ( const MbAxis3D & axis, double angle, MbRegTransform * iReg = nullptr ) = 0; /** \brief \ru Определить, являются ли объекты равными. \en Determine whether an object is equal. \~ diff --git a/C3d/Include/surf_chamfer_surface.h b/C3d/Include/surf_chamfer_surface.h index 5d0d08f..bcbb1ff 100644 --- a/C3d/Include/surf_chamfer_surface.h +++ b/C3d/Include/surf_chamfer_surface.h @@ -110,13 +110,13 @@ public: \en \name Common functions of a geometric object \{ */ virtual MbeSpaceType IsA() const; // \ru Тип элемента \en A type of element - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Cделать копию элемента. \en Make a copy of the element. + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Cделать копию элемента. \en Make a copy of the element. virtual bool IsSame ( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const; // \ru Является ли объект копией. \en Whether the object is a copy. virtual bool SetEqual ( const MbSpaceItem & ); // \ru Cделать равным. \en Make equal. virtual bool IsSimilar( const MbSpaceItem & ) const; // \ru Являются ли объекты подобными. \en Determine whether the objects are similar. - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг. \en Move. - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси. \en Rotate around an axis. + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг. \en Move. + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси. \en Rotate around an axis. virtual void GetProperties( MbProperties &properties ); // \ru Выдать свойства объекта. \en Get properties of the object. virtual void SetProperties( const MbProperties &properties ); // \ru Записать свойства объекта. \en Set properties of the object. diff --git a/C3d/Include/surf_channel_surface.h b/C3d/Include/surf_channel_surface.h index fb42c21..bd15a88 100644 --- a/C3d/Include/surf_channel_surface.h +++ b/C3d/Include/surf_channel_surface.h @@ -163,7 +163,7 @@ public: \en \name Common functions of a geometric object \{ */ virtual MbeSpaceType IsA() const; // \ru Тип элемента. \en A type of element. - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента. \en Create a copy of the element. + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента. \en Create a copy of the element. virtual bool IsSame ( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const; // \ru Является ли объект копией. \en Whether the object is a copy. virtual bool SetEqual ( const MbSpaceItem & ); // \ru Сделать равным. \en Make equal. virtual bool IsSimilar( const MbSpaceItem & ) const; // \ru Являются ли объекты подобными. \en Determine whether the objects are similar. diff --git a/C3d/Include/surf_cone_surface.h b/C3d/Include/surf_cone_surface.h index a82b0a9..b4b7baa 100644 --- a/C3d/Include/surf_cone_surface.h +++ b/C3d/Include/surf_cone_surface.h @@ -174,10 +174,10 @@ public: \en \name Common functions of a geometric object \{ */ virtual MbeSpaceType IsA () const; // \ru Тип элемента \en A type of element - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента. \en Create a copy of the element. + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента. \en Create a copy of the element. virtual bool IsSame ( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const; // \ru Равны ли объекты. \en Whether the objects are equal. virtual bool SetEqual ( const MbSpaceItem & init ); // \ru Сделать равным. \en Make equal. - virtual void Transform( const MbMatrix3D & matr, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. + virtual void Transform( const MbMatrix3D & matr, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. virtual void GetProperties( MbProperties & properties ); // \ru Выдать свойства объекта. \en Get properties of the object. virtual void SetProperties( const MbProperties & properties ); // \ru Записать свойства объекта. \en Set properties of the object. @@ -279,7 +279,7 @@ public: virtual MbCurve3D * CurveUV( const MbLineSegment &, bool bApprox = true ) const; // \ru Пространственная копия линии по параметрической линии. \en Spatial copy of line by parametric line. // \ru Найти все проекции точки на поверхность вдоль вектора в любом из двух направлений. \en Find all a point projection onto the surface along a vector in either of two directions. - virtual void DirectPointProjection( const MbCartPoint3D & p, const MbVector3D & vect, SArray & uv, bool ext, MbRect2D * uvRange = c3d_null ) const; + virtual void DirectPointProjection( const MbCartPoint3D & p, const MbVector3D & vect, SArray & uv, bool ext, MbRect2D * uvRange = nullptr ) const; // \ru Пересечение с кривой. \en Intersection with curve. virtual void CurveIntersection( const MbCurve3D & curv, SArray & uv, SArray & tt, bool ext0, bool ext, bool touchInclude = false ) const; @@ -287,7 +287,7 @@ public: // \ru Дать мимнимально различимую величину параметра. \en Get the minimum distinguishable value of parameter. virtual double GetParamPrice() const; // \ru Построить касательные и нормальные плейсменты конструктивных плоскостей. \en Construct tangent and normal placements of constructive planes. - virtual bool CreateNormalPlacements ( const MbVector3D & axisZ, double angle, SArray & places ) const; + virtual bool CreateNormalPlacements ( const MbVector3D & axisZ, double angle, SArray & places, VERSION version = Math::DefaultMathVersion() ) const; virtual bool CreateTangentPlacements( const MbVector3D & axisZ, SArray & places ) const; virtual bool GetCylinderAxis( MbAxis3D & axis ) const ; // \ru Дать ось вращения для поверхности. \en Get a rotation axis of a surface. virtual bool GetCenterLines( std::vector & clCurves ) const; // \ru Дать осевые (центральные) линии для поверхности. \en Get center lines of a surface. @@ -335,7 +335,7 @@ public: /** \ru \name Функции элементарных поверхностей \en \name Functions of elementary surfaces \{ */ - virtual bool GetPointProjection( const MbCartPoint3D & p, bool init, double & u, double & v, bool ext, MbRect2D * uvRange = c3d_null ) const; + virtual bool GetPointProjection( const MbCartPoint3D & p, bool init, double & u, double & v, bool ext, MbRect2D * uvRange = nullptr ) const; /** \} */ /** \ru \name Функции конической поверхности \en \name Functions of conical surface diff --git a/C3d/Include/surf_coons_surface.h b/C3d/Include/surf_coons_surface.h index a932b25..125faea 100644 --- a/C3d/Include/surf_coons_surface.h +++ b/C3d/Include/surf_coons_surface.h @@ -194,13 +194,13 @@ public: \en \name Common functions of a geometric object \{ */ virtual MbeSpaceType IsA() const; // \ru Тип элемента \en A type of element - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Cделать копию элемента \en Make a copy of element + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Cделать копию элемента \en Make a copy of element virtual bool IsSame( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const; // \ru Является ли объект копией. \en Whether the object is a copy. virtual bool SetEqual( const MbSpaceItem & init ); // \ru Сделать равным \en Make equal virtual bool IsSimilar( const MbSpaceItem & init ) const; // \ru Являются ли объекты подобными \en Whether the objects are similar - virtual void Transform( const MbMatrix3D & matr, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move( const MbVector3D & to, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate( const MbAxis3D & axis, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate around an axis + virtual void Transform( const MbMatrix3D & matr, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move( const MbVector3D & to, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate( const MbAxis3D & axis, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate around an axis virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта \en Get properties of the object virtual void SetProperties( const MbProperties & ); // \ru Записать свойства объекта \en Set properties of the object @@ -352,8 +352,8 @@ public: \en Index of the curve. \~ \param[out] sense - \ru Флаг совпадения направленности кривой с рисунком, приведенным выше. \en Flag that indicates the coincidence of the curve with the picture shown above.\~ - \return - \ru Указатель на кривую или c3d_null. - \en Pointer to the curve or c3d_null. \~ + \return - \ru Указатель на кривую или nullptr. + \en Pointer to the curve or nullptr. \~ */ const MbCurve3D * GetExactCurve( size_t k, bool & sense ) const; @@ -473,7 +473,7 @@ inline const MbCurve3D * MbCoonsPatchSurface::GetCurve( size_t ind ) const case 2 : { return curve2; } case 3 : { return curve3; } } - return c3d_null; + return nullptr; } diff --git a/C3d/Include/surf_corner_surface.h b/C3d/Include/surf_corner_surface.h index ccadc19..e7f9ec3 100644 --- a/C3d/Include/surf_corner_surface.h +++ b/C3d/Include/surf_corner_surface.h @@ -90,13 +90,13 @@ public: \en \name Common functions of a geometric object \{ */ virtual MbeSpaceType IsA() const; // \ru Тип элемента \en A type of element - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Cделать копию элемента \en Make a copy of element + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Cделать копию элемента \en Make a copy of element virtual bool IsSame( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const; // \ru Является ли объект копией. \en Whether the object is a copy. virtual bool SetEqual( const MbSpaceItem & init ); // \ru Сделать равным \en Make equal virtual bool IsSimilar( const MbSpaceItem & init ) const; // \ru Являются ли объекты подобными \en Whether the objects are similar - virtual void Transform( const MbMatrix3D & matr, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move( const MbVector3D & to, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate( const MbAxis3D & axis, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate around an axis + virtual void Transform( const MbMatrix3D & matr, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move( const MbVector3D & to, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate( const MbAxis3D & axis, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate around an axis virtual void CalculateSurfaceWire( const MbStepData & stepData, size_t beg, MbMesh & mesh, size_t uMeshCount = c3d::WIRE_MAX, size_t vMeshCount = c3d::WIRE_MAX ) const; @@ -307,7 +307,7 @@ inline const MbCurve3D * MbCornerSurface::GetCurve( size_t ind ) const case 1 : { return curve1; } case 2 : { return curve2; } } - return c3d_null; + return nullptr; } diff --git a/C3d/Include/surf_cover_surface.h b/C3d/Include/surf_cover_surface.h index 6bba67a..54c7b87 100644 --- a/C3d/Include/surf_cover_surface.h +++ b/C3d/Include/surf_cover_surface.h @@ -97,13 +97,13 @@ public: \en \name Common functions of a geometric object \{ */ virtual MbeSpaceType IsA() const; // \ru Тип элемента \en A type of element - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Cделать копию элемента \en Make a copy of element + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Cделать копию элемента \en Make a copy of element virtual bool IsSame( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const; // \ru Является ли объект копией. \en Whether the object is a copy. virtual bool SetEqual( const MbSpaceItem & init ); // \ru Сделать равным \en Make equal virtual bool IsSimilar( const MbSpaceItem & init ) const; // \ru Являются ли объекты подобными \en Whether the objects are similar - virtual void Transform( const MbMatrix3D & matr, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move( const MbVector3D & to, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate( const MbAxis3D & axis, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate around an axis + virtual void Transform( const MbMatrix3D & matr, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move( const MbVector3D & to, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate( const MbAxis3D & axis, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate around an axis virtual void GetProperties( MbProperties & properties ); // \ru Выдать свойства объекта \en Get properties of the object virtual void SetProperties( const MbProperties & properties ); // \ru Записать свойства объекта \en Set properties of the object @@ -240,8 +240,8 @@ public: \en Index of the curve. \~ \param[out] sense - \ru Флаг совпадения направленности кривой с рисунком, приведенным выше. \en Flag that indicates the coincidence of the curve with the picture shown above.\~ - \return - \ru Указатель на кривую или c3d_null. - \en Pointer to the curve or c3d_null. \~ + \return - \ru Указатель на кривую или nullptr. + \en Pointer to the curve or nullptr. \~ */ const MbCurve3D * GetExactCurve( size_t k, bool &sense ) const; @@ -295,7 +295,7 @@ inline const MbCurve3D * MbCoverSurface::GetCurve( size_t ind ) const case 2 : { return curve2; } case 3 : { return curve3; } } - return c3d_null; + return nullptr; } diff --git a/C3d/Include/surf_curve_bounded_surface.h b/C3d/Include/surf_curve_bounded_surface.h index 4d240e5..de3cf3d 100644 --- a/C3d/Include/surf_curve_bounded_surface.h +++ b/C3d/Include/surf_curve_bounded_surface.h @@ -120,7 +120,7 @@ public : /// \ru Конструктор для поверхности c габаритом при чтении грани. \en Constructor for surface with bounding box at face reading. MbCurveBoundedSurface( MbSurface & initSurface, c3d::PlaneContoursSPtrVector & initCurves, MbCube & gab ); /// \ru Конструктор по контурам, берет за базовую поверхность поверхность первого контура. \en Constructor by contours, uses the surface of first contour as base surface. - MbCurveBoundedSurface( MbContourOnSurface & init1, MbContourOnSurface * init2 = c3d_null ); + MbCurveBoundedSurface( MbContourOnSurface & init1, MbContourOnSurface * init2 = nullptr ); /// \ru Конструктор-копия на новую базовую поверхность. \en Copy-constructor for new base surface. MbCurveBoundedSurface( const MbCurveBoundedSurface & init, MbSurface & newBaseSurface, bool calculateGabarit = true ); @@ -141,13 +141,13 @@ public : \en \name Common functions of a geometric object \{ */ virtual MbeSpaceType IsA() const; // \ru Тип элемента. \en A type of element. - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента. \en Create a copy of the element. + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента. \en Create a copy of the element. virtual bool IsSame ( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const; // \ru Является ли объект копией. \en Whether the object is a copy. virtual bool SetEqual ( const MbSpaceItem & ); // \ru Сделать равным. \en Make equal. virtual bool IsSimilar( const MbSpaceItem & ) const; // \ru Являются ли объекты подобными. \en Determine whether the objects are similar. - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвинуть объект вдоль вектора. \en Move an object along a vector. - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси. \en Rotate around an axis. + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвинуть объект вдоль вектора. \en Move an object along a vector. + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси. \en Rotate around an axis. virtual double DistanceToPoint( const MbCartPoint3D & ) const; // \ru Вычислить расстояние до точки. \en Calculate the distance to a point. virtual void Refresh(); // \ru Сбросить все временные данные. \en Reset all temporary data. virtual void CalculateMesh( const MbStepData & stepData, const MbFormNote & note, MbMesh & mesh ) const; // \ru Построить полигональную копию mesh. \en Build polygonal copy mesh. @@ -306,9 +306,9 @@ public : size_t SegmentIntersection( const MbCurve & pCurve, SArray & curveParams, double epsilon = Math::metricEpsilon ) const; // \ru Найти ближайшую проекцию точки на поверхность. \en Find the nearest projection of a point onto the surface. - virtual bool NearPointProjection( const MbCartPoint3D & p, double & u, double & v, bool ext, MbRect2D * uvRange = c3d_null ) const; // \ru Ближайшая проекция точки на поверхность. \en The nearest point projection onto the surface. + virtual bool NearPointProjection( const MbCartPoint3D & p, double & u, double & v, bool ext, MbRect2D * uvRange = nullptr ) const; // \ru Ближайшая проекция точки на поверхность. \en The nearest point projection onto the surface. // \ru Найти все проекции точки на поверхность вдоль вектора в любом из двух направлений. \en Find all a point projection onto the surface along a vector in either of two directions. - virtual void DirectPointProjection( const MbCartPoint3D & p, const MbVector3D & vect, SArray & uv, bool ext, MbRect2D * uvRange = c3d_null ) const; + virtual void DirectPointProjection( const MbCartPoint3D & p, const MbVector3D & vect, SArray & uv, bool ext, MbRect2D * uvRange = nullptr ) const; // \ru Вce точки пересечения поверхности и кривой. \en All the points of intersection of a surface and a curve. virtual void CurveIntersection( const MbCurve3D & curv, SArray & uv, SArray & tt, bool ext0, bool ext, bool touchInclude = false ) const; @@ -324,7 +324,7 @@ public : virtual bool GetMatrixToSurface( const MbSurface & surf, MbMatrix & matr, VERSION version, double precision = METRIC_PRECISION ) const; virtual ThreeStates Salient() const; // \ru Выпуклая ли поверхность. \en Whether the surface is convex. // \ru Построить касательные и нормальные плейсменты конструктивных плоскостей. \en Construct tangent and normal placements of constructive planes. - virtual bool CreateNormalPlacements ( const MbVector3D & axisZ, double angle, SArray & places ) const; + virtual bool CreateNormalPlacements ( const MbVector3D & axisZ, double angle, SArray & places, VERSION version = Math::DefaultMathVersion() ) const; virtual bool CreateTangentPlacements( const MbVector3D & axisZ, SArray & places ) const; // \ru Определение разбивки параметрической области поверхности вертикалями и горизонталями. \en Determine splitting of parametric region of surface by vertical and horizontal lines. virtual void GetTesselation( const MbStepData & stepData, @@ -500,7 +500,7 @@ public : \details \ru Дать контур, ограничивающий поверхность, по его индексу. С проверкой индекса. \en Get contour bounding surface by its index. With index checking. \~ */ - const MbContourOnSurface * GetCurve ( size_t ind ) const { return ( ind < curves.Count() ) ? curves[ind] : c3d_null; } + const MbContourOnSurface * GetCurve ( size_t ind ) const { return ( ind < curves.Count() ) ? curves[ind] : nullptr; } /** \brief \ru Дать контур, ограничивающий поверхность, по его индексу. \en Get contour bounding surface by its index. \~ \details \ru Дать контур, ограничивающий поверхность, по его индексу. Без проверки индекса. @@ -514,7 +514,7 @@ public : \details \ru Дать контур, ограничивающий поверхность, по его индексу. С проверкой индекса. \en Get contour bounding surface by its index. With index checking. \~ */ - MbContourOnSurface * SetCurve ( size_t ind ) { return ( ind < curves.Count() ) ? curves[ind] : c3d_null; } + MbContourOnSurface * SetCurve ( size_t ind ) { return ( ind < curves.Count() ) ? curves[ind] : nullptr; } /** \brief \ru Дать контур, ограничивающий поверхность, по его индексу. \en Get contour bounding surface by its index. \~ \details \ru Дать контур, ограничивающий поверхность, по его индексу. Без проверки индекса. diff --git a/C3d/Include/surf_cylinder_surface.h b/C3d/Include/surf_cylinder_surface.h index cb5b354..0fbe2aa 100644 --- a/C3d/Include/surf_cylinder_surface.h +++ b/C3d/Include/surf_cylinder_surface.h @@ -151,10 +151,10 @@ public: \en \name Common functions of a geometric object \{ */ virtual MbeSpaceType IsA() const; // \ru Тип элемента. \en A type of element. - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента. \en Create a copy of the element. + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента. \en Create a copy of the element. virtual bool IsSame ( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const; // \ru Равны ли объекты. \en Whether the objects are equal. virtual bool SetEqual ( const MbSpaceItem & ); // \ru Сделать равным. \en Make equal. - virtual void Transform( const MbMatrix3D & matr, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. + virtual void Transform( const MbMatrix3D & matr, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. virtual void GetProperties( MbProperties & properties ); // \ru Выдать свойства объекта. \en Get properties of the object. virtual void SetProperties( const MbProperties & properties ); // \ru Записать свойства объекта. \en Set properties of the object. @@ -254,7 +254,7 @@ public: virtual MbCurve3D * CurveUV( const MbLineSegment &, bool bApprox = true ) const; // \ru Пространственная копия линии по параметрической линии. \en Spatial copy of line by parametric line. // \ru Найти все проекции точки на поверхность вдоль вектора в любом из двух направлений. \en Find all a point projection onto the surface along a vector in either of two directions. - virtual void DirectPointProjection( const MbCartPoint3D & p, const MbVector3D & vect, SArray & uv, bool ext, MbRect2D * uvRange = c3d_null ) const; + virtual void DirectPointProjection( const MbCartPoint3D & p, const MbVector3D & vect, SArray & uv, bool ext, MbRect2D * uvRange = nullptr ) const; // \ru Пересечение с кривой. \en Intersection with curve. virtual void CurveIntersection( const MbCurve3D & curv, SArray & uv, SArray & tt, bool ext0, bool ext, bool touchInclude = false ) const; @@ -273,7 +273,7 @@ public: // \ru Дать мимнимально различимую величину параметра. \en Get the minimum distinguishable value of parameter. virtual double GetParamPrice() const; // \ru Построить касательные и нормальные плейсменты конструктивных плоскостей. \en Construct tangent and normal placements of constructive planes. - virtual bool CreateNormalPlacements ( const MbVector3D & axisZ, double angle, SArray & places ) const; + virtual bool CreateNormalPlacements ( const MbVector3D & axisZ, double angle, SArray & places, VERSION version = Math::DefaultMathVersion() ) const; virtual bool CreateTangentPlacements( const MbVector3D & axisZ, SArray & places ) const; virtual bool GetCylinderAxis( MbAxis3D & axis ) const; // \ru Дать ось вращения для поверхности. \en Get a rotation axis of a surface. virtual bool GetCenterLines( std::vector & clCurves ) const; // \ru Дать осевые (центральные) линии для поверхности. \en Get center lines of a surface. @@ -318,7 +318,7 @@ public: /** \ru \name Функции элементарных поверхностей \en \name Functions of elementary surfaces \{ */ - virtual bool GetPointProjection( const MbCartPoint3D & p, bool init, double & u, double & v, bool ext, MbRect2D * uvRange = c3d_null ) const; + virtual bool GetPointProjection( const MbCartPoint3D & p, bool init, double & u, double & v, bool ext, MbRect2D * uvRange = nullptr ) const; /** \} */ /** \ru \name Функции цилиндрической поверхности \en \name Functions of the cylindrical surface diff --git a/C3d/Include/surf_elementary_surface.h b/C3d/Include/surf_elementary_surface.h index ba593e9..6c1b07a 100644 --- a/C3d/Include/surf_elementary_surface.h +++ b/C3d/Include/surf_elementary_surface.h @@ -59,12 +59,12 @@ public: \{ */ virtual MbeSpaceType IsA () const = 0; // \ru Тип элемента. \en A type of element. virtual MbeSpaceType Type() const; // \ru Тип элемента. \en A type of element. - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const = 0; // \ru Сделать копию элемента. \en Create a copy of the element. + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const = 0; // \ru Сделать копию элемента. \en Create a copy of the element. virtual bool IsSame ( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const = 0; // \ru Являются ли объекты равными. \en Determine whether objects are equal. virtual bool SetEqual ( const MbSpaceItem & ) = 0; // \ru Сделать равным. \en Make equal. - virtual void Transform( const MbMatrix3D & matr, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. - virtual void Move ( const MbVector3D & to, MbRegTransform * = c3d_null ); // \ru Сдвиг. \en Move. - virtual void Rotate ( const MbAxis3D & axis, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси. \en Rotate around an axis. + virtual void Transform( const MbMatrix3D & matr, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. + virtual void Move ( const MbVector3D & to, MbRegTransform * = nullptr ); // \ru Сдвиг. \en Move. + virtual void Rotate ( const MbAxis3D & axis, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси. \en Rotate around an axis. virtual double DistanceToPoint( const MbCartPoint3D & to ) const; // \ru Вычислить расстояние до точки. \en Calculate the distance to a point. virtual void GetProperties( MbProperties & properties ) = 0; // \ru Выдать свойства объекта. \en Get properties of the object. @@ -140,7 +140,7 @@ public: // \ru Ближайшая проекция точки на поверхность \en Nearest point projection onto the surface virtual MbeNewtonResult PointProjectionNewton( const MbCartPoint3D & p, size_t iterLimit, double & u, double & v, bool ext ) const; // \ru Функция для нахождения проекции точки на поверхность. \en Function for searching the point projection onto the surface. - virtual bool NearPointProjection( const MbCartPoint3D & p, double & u, double & v, bool ext, MbRect2D * uvRange = c3d_null ) const; // \ru Ближайшая проекция точки на поверхность. \en The nearest point projection onto the surface. + virtual bool NearPointProjection( const MbCartPoint3D & p, double & u, double & v, bool ext, MbRect2D * uvRange = nullptr ) const; // \ru Ближайшая проекция точки на поверхность. \en The nearest point projection onto the surface. virtual bool IsRectangular() const; // \ru Если true производные по u и v ортогональны. \en If true, then derivatives by u and v are orthogonal. virtual void SetLimit( double u1, double v1, double u2, double v2 ) = 0; @@ -168,7 +168,7 @@ public: \return \ru true в случае успеха операции \en True if the operation succeeded \~ */ - virtual bool GetPointProjection( const MbCartPoint3D & p, bool init, double & u, double & v, bool ext, MbRect2D * uvRange = c3d_null ) const = 0; + virtual bool GetPointProjection( const MbCartPoint3D & p, bool init, double & u, double & v, bool ext, MbRect2D * uvRange = nullptr ) const = 0; // Дать приращение параметра u и параметра v, соответствующее единичной длине в пространстве. \en Get increment of parameters, corresponding to the unit length in space. virtual void GetParamsToUnit( double u, double v, double & uParam, double & vParam ) const; diff --git a/C3d/Include/surf_elevation_surface.h b/C3d/Include/surf_elevation_surface.h index df975a1..e32f011 100644 --- a/C3d/Include/surf_elevation_surface.h +++ b/C3d/Include/surf_elevation_surface.h @@ -38,7 +38,7 @@ const VERSION ELEVATION_SURFACE_VERSION1 = 0x0F001003L; ///< \ru Расчёт т // --- class MATH_CLASS MbElevationSurface : public MbLoftedSurface { private: - MbCurve3D * spine; ///< \ru Направляющая кривая (не c3d_null). \en Guide curve (not c3d_null). + MbCurve3D * spine; ///< \ru Направляющая кривая (не nullptr). \en Guide curve (not nullptr). RPArray mSpines; ///< \ru Множество указателей на направляющие кривые (на основе spine). \en Set of pointers to guide curves (based on 'spine'). bool isSimToEvol; ///< \ru Способ расчёта точек на поверхности. \en Way of calculating of points on the surface. @@ -102,13 +102,13 @@ public: \en \name Common functions of a geometric object \{ */ virtual MbeSpaceType IsA() const; // \ru Тип элемента \en A type of element - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента \en Create a copy of the element + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента \en Create a copy of the element virtual bool IsSame ( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const; // \ru Равны ли объекты \en Whether the objects are equal virtual bool SetEqual ( const MbSpaceItem & ); // \ru Сделать равным \en Make equal virtual bool IsSimilar( const MbSpaceItem & ) const; // \ru Являются ли объекты подобными \en Whether the objects are similar - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate around an axis + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate around an axis virtual void Refresh (); virtual void GetProperties( MbProperties & properties ); // \ru Выдать свойства объекта \en Get properties of the object @@ -187,13 +187,13 @@ public: virtual void ChangeCarrier( const MbSpaceItem & item, MbSpaceItem & init ); // \ru Изменение носителя \en Changing of carrier // \ru Построить касательные и нормальные плейсменты конструктивных плоскостей \en Construct tangent and normal placements of constructive planes - virtual bool CreateNormalPlacements ( const MbVector3D & axisZ, double angle, SArray & places ) const; + virtual bool CreateNormalPlacements ( const MbVector3D & axisZ, double angle, SArray & places, VERSION version = Math::DefaultMathVersion() ) const; virtual bool CreateTangentPlacements( const MbVector3D & axisZ, SArray & places ) const; virtual size_t GetVMeshCount() const; // \ru Выдать количество полигонов по v \en Get the count of polygons by v /// \ru Вернуть направляющую кривую. \en Return spine (guide) curve. - const MbCurve3D & GetSpineCurve() const { C3D_ASSERT( spine != c3d_null ); return *spine; } + const MbCurve3D & GetSpineCurve() const { C3D_ASSERT( spine != nullptr ); return *spine; } /// \ru Вернуть направляющую кривую. \en Return spine (guide) curve. bool IsSimilarToEvolution() const { return isSimToEvol; } @@ -315,8 +315,8 @@ inline void MbElevationSurface::CheckParam( double & u, double & v, bool ext ) c \en Center of mass of profile curve. \~ \param[in,out] ct - \ru Искомый параметр. \en Required parameter. \~ - \param[in,out] tau - \ru Производная направляющей в точке с координатой ct. Если в функцию передать c3d_null, производная не вычисляется. - \en Derivative of guide curve at point with 'ct' coordinate. If giving c3d_null to function, then derivative isn't calculated. \~ + \param[in,out] tau - \ru Производная направляющей в точке с координатой ct. Если в функцию передать nullptr, производная не вычисляется. + \en Derivative of guide curve at point with 'ct' coordinate. If giving nullptr to function, then derivative isn't calculated. \~ \return \ru true - если направляющая пересекается с плоскостью профиля, false - если не пересекается. \en True - if guide curve intersects with plane of profile, false - if not intersects. \~ \ingroup Algorithms_3D @@ -341,8 +341,8 @@ bool CreateElevationParam( const MbCurve3D & crvThis, const MbCurve3D & spine, \en The spine (guide) curve. \~ \param[in,out] vParams - \ru Множество параметров. \en Set of parameters. \~ - \param[in,out] tiePnts - \ru Множество центров масс профильных кривых. Не заполняется, если в функцию передать c3d_null. - \en Set of centers of mass of profile curves. If giving c3d_null to function, then it isn't filled. \~ + \param[in,out] tiePnts - \ru Множество центров масс профильных кривых. Не заполняется, если в функцию передать nullptr. + \en Set of centers of mass of profile curves. If giving nullptr to function, then it isn't filled. \~ \return \ru true - если массив параметров успешно создан. \en True - if the array of parameters successfully created. \~ \ingroup Algorithms_3D diff --git a/C3d/Include/surf_evolution_surface.h b/C3d/Include/surf_evolution_surface.h index 858c429..617084b 100644 --- a/C3d/Include/surf_evolution_surface.h +++ b/C3d/Include/surf_evolution_surface.h @@ -140,13 +140,13 @@ public: \en \name Common functions of a geometric object \{ */ virtual MbeSpaceType IsA() const; // \ru Тип элемента \en A type of element - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента. \en Create a copy of the element. + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента. \en Create a copy of the element. virtual bool IsSame ( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const; // \ru Равны ли объекты. \en Whether the objects are equal. virtual bool SetEqual ( const MbSpaceItem & ); // \ru Сделать равным. \en Make equal. virtual bool IsSimilar ( const MbSpaceItem & ) const; // \ru Являются ли объекты подобными. \en Determine whether the objects are similar. - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг. \en Move. - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси. \en Rotate around an axis. + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг. \en Move. + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси. \en Rotate around an axis. virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта. \en Get properties of the object. virtual void SetProperties( const MbProperties & ); // \ru Записать свойства объекта. \en Set properties of the object. @@ -233,7 +233,7 @@ public: virtual MbCurve3D * CurveV( double u, MbRect1D *pRgn, bool bApprox = true ) const; // \ru Пространственная копия линии u = const. \en Spatial copy of 'u = const'-line. // \ru Построить касательные и нормальные плейсменты конструктивных плоскостей. \en Construct tangent and normal placements of constructive planes. - virtual bool CreateNormalPlacements ( const MbVector3D & axisZ, double angle, SArray & places ) const; + virtual bool CreateNormalPlacements ( const MbVector3D & axisZ, double angle, SArray & places, VERSION version = Math::DefaultMathVersion() ) const; virtual bool CreateTangentPlacements( const MbVector3D & axisZ, SArray & places ) const; // \ru Подобные ли поверхности для объединения (слива). \en Whether the surfaces to union (joining) are similar. virtual bool IsSimilarToSurface( const MbSurface & surf, VERSION version, double precision = METRIC_PRECISION ) const; diff --git a/C3d/Include/surf_exaction_surface.h b/C3d/Include/surf_exaction_surface.h index 257f5cb..cebc1b1 100644 --- a/C3d/Include/surf_exaction_surface.h +++ b/C3d/Include/surf_exaction_surface.h @@ -96,13 +96,13 @@ public: \en \name Common functions of a geometric object \{ */ virtual MbeSpaceType IsA() const; // \ru Тип элемента. \en A type of element. - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента. \en Create a copy of the element. + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента. \en Create a copy of the element. virtual bool IsSame ( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const; // \ru Равны ли объекты. \en Whether the objects are equal. virtual bool SetEqual ( const MbSpaceItem & ); // \ru Сделать равными. \en Make equal. virtual bool IsSimilar( const MbSpaceItem & ) const; // \ru Являются ли объекты подобными. \en Determine whether the objects are similar. - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг. \en Move. - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси. \en Rotate around an axis. + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг. \en Move. + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси. \en Rotate around an axis. virtual void GetProperties( MbProperties & properties ); // \ru Выдать свойства объекта. \en Get properties of the object. virtual void SetProperties( const MbProperties & properties ); // \ru Записать свойства объекта. \en Set properties of the object. diff --git a/C3d/Include/surf_expansion_surface.h b/C3d/Include/surf_expansion_surface.h index b009f7f..913e1ec 100644 --- a/C3d/Include/surf_expansion_surface.h +++ b/C3d/Include/surf_expansion_surface.h @@ -38,7 +38,7 @@ class MATH_CLASS MbExpansionSurface : public MbSweptSurface { private: MbCurve3D * spine; ///< \ru Направляющая кривая. \en Spine (guide) curve. - MbCurve3D * brink; ///< \ru Вторая образующая кривая (первой является curve, может быть c3d_null). \en The second generating curve ('curve' is first one, may be c3d_null). + MbCurve3D * brink; ///< \ru Вторая образующая кривая (первой является curve, может быть nullptr). \en The second generating curve ('curve' is first one, may be nullptr). double tmin; ///< \ru Начальный параметр brink. \en Start parameter of 'brink'. double dt; ///< \ru Производная параметра кривой brink по параметру u (dt * (u - umin) = t_brink - tmin_brink). \en Derivative of parameter of 'brink' curve by u parameter (dt * (u - umin) = t_brink - tmin_brink). MbCartPoint3D origin; ///< \ru Начало образующей. \en Begin of gravity of generating curve. @@ -62,7 +62,7 @@ public: \en Second generating curve \~ */ MbExpansionSurface( const MbCurve3D & cr, const MbCurve3D & sp, bool sameCurve, bool sameSpine, - const MbCurve3D * sl = c3d_null ); + const MbCurve3D * sl = nullptr ); /** \brief \ru Конструктор по точке, образующей и направляющей. \en Constructor by point, generating curve and guide curve. \~ @@ -101,13 +101,13 @@ public: \en \name Common functions of a geometric object \{ */ virtual MbeSpaceType IsA() const; // \ru Тип элемента. \en A type of element. - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента. \en Create a copy of the element. + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента. \en Create a copy of the element. virtual bool IsSame ( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const; // \ru Равны ли объекты. \en Whether the objects are equal. virtual bool SetEqual ( const MbSpaceItem & ); // \ru Сделать равным. \en Make equal. virtual bool IsSimilar( const MbSpaceItem & ) const; // \ru Являются ли объекты подобными. \en Determine whether the objects are similar. - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг. \en Move. - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси. \en Rotate around an axis. + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг. \en Move. + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси. \en Rotate around an axis. virtual void GetProperties( MbProperties & properties ); // \ru Выдать свойства объекта. \en Get properties of the object. virtual void SetProperties( const MbProperties & properties ); // \ru Записать свойства объекта. \en Set properties of the object. @@ -188,7 +188,7 @@ public: virtual MbCurve3D * CurveV( double u, MbRect1D * pRgn, bool bApprox = true ) const; // \ru Пространственная копия линии u = const. \en Spatial copy of 'u = const'-line. // \ru Построить касательные и нормальные плейсменты конструктивных плоскостей. \en Construct tangent and normal placements of constructive planes. - virtual bool CreateNormalPlacements ( const MbVector3D & axisZ, double angle, SArray & places ) const; + virtual bool CreateNormalPlacements ( const MbVector3D & axisZ, double angle, SArray & places, VERSION version = Math::DefaultMathVersion() ) const; virtual bool CreateTangentPlacements( const MbVector3D & axisZ, SArray & places ) const; // \ru Определение разбивки параметрической области поверхности вертикалями и горизонталями. \en Determine splitting of parametric region of surface by vertical and horizontal lines. virtual void GetTesselation( const MbStepData & stepData, @@ -248,7 +248,7 @@ IMPL_PERSISTENT_OPS( MbExpansionSurface ) // --- inline double MbExpansionSurface::BrinkParameterFrom( const double & u ) const { double t = u; - if ( brink != c3d_null ) + if ( brink != nullptr ) t = tmin + (u - umin) * dt; return t; } @@ -259,7 +259,7 @@ inline double MbExpansionSurface::BrinkParameterFrom( const double & u ) const { // --- inline double MbExpansionSurface::BrinkParameterInto( const double & t ) const { double u = t; - if ( brink != c3d_null ) { + if ( brink != nullptr ) { double du = (::fabs(dt) > EXTENT_EQUAL) ? 1.0 / dt : 1.0; u = umin + (t - tmin) * du; } diff --git a/C3d/Include/surf_exploration_surface.h b/C3d/Include/surf_exploration_surface.h index 404c8b1..88dff1e 100644 --- a/C3d/Include/surf_exploration_surface.h +++ b/C3d/Include/surf_exploration_surface.h @@ -75,13 +75,13 @@ public: \en \name Common functions of a geometric object \{ */ virtual MbeSpaceType IsA() const; // \ru Тип элемента \en A type of element - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента. \en Create a copy of the element. + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента. \en Create a copy of the element. virtual bool IsSame ( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const; // \ru Равны ли объекты. \en Whether the objects are equal. virtual bool SetEqual ( const MbSpaceItem & ); // \ru Сделать равным. \en Make equal. virtual bool IsSimilar ( const MbSpaceItem & ) const; // \ru Являются ли объекты подобными. \en Determine whether the objects are similar. - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг. \en Move. - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси. \en Rotate around an axis. + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг. \en Move. + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси. \en Rotate around an axis. virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта. \en Get properties of the object. virtual void SetProperties( const MbProperties & ); // \ru Записать свойства объекта. \en Set properties of the object. diff --git a/C3d/Include/surf_extrusion_surface.h b/C3d/Include/surf_extrusion_surface.h index 7030984..8beaa37 100644 --- a/C3d/Include/surf_extrusion_surface.h +++ b/C3d/Include/surf_extrusion_surface.h @@ -76,13 +76,13 @@ public: \en \name Common functions of a geometric object \{ */ virtual MbeSpaceType IsA() const; // \ru Тип элемента. \en A type of element. - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента. \en Create a copy of the element. + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента. \en Create a copy of the element. virtual bool IsSame ( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const; // \ru Равны ли объекты. \en Whether the objects are equal. virtual bool SetEqual ( const MbSpaceItem & ); // \ru Сделать равным. \en Make equal. virtual bool IsSimilar( const MbSpaceItem & ) const; // \ru Являются ли объекты подобными. \en Determine whether the objects are similar. - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг. \en Move. - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси. \en Rotate around an axis. + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг. \en Move. + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси. \en Rotate around an axis. virtual void GetProperties( MbProperties & properties ); // \ru Выдать свойства объекта. \en Get properties of the object. virtual void SetProperties( const MbProperties & properties ); // \ru Записать свойства объекта. \en Set properties of the object. @@ -163,7 +163,7 @@ public: virtual ThreeStates Salient() const; // \ru Выпуклая ли поверхность. \en Whether a surface is convex. // \ru Проекция точки на поверхность. \en The point projection onto the surface. - virtual bool NearPointProjection ( const MbCartPoint3D & p, double & u, double & v, bool ext, MbRect2D * uvRange = c3d_null ) const; // \ru Ближайшая проекция точки на поверхность. \en The nearest point projection onto the surface. + virtual bool NearPointProjection ( const MbCartPoint3D & p, double & u, double & v, bool ext, MbRect2D * uvRange = nullptr ) const; // \ru Ближайшая проекция точки на поверхность. \en The nearest point projection onto the surface. // \ru Пересечение с кривой. \en Intersection with curve. virtual void CurveIntersection( const MbCurve3D & curv, SArray & uv, SArray & tt, bool ext0, bool ext, bool touchInclude = false ) const; @@ -172,7 +172,7 @@ public: virtual void CalculateLocalGabarit( const MbMatrix3D &, MbCube & ) const; // \ru Рассчитать габарит относительно л.с.к. \en Calculate bounding box relative to the local coordinate system. // \ru Построить касательные и нормальные плейсменты конструктивных плоскостей. \en Construct tangent and normal placements of constructive planes. - virtual bool CreateNormalPlacements ( const MbVector3D & axisZ, double angle, SArray & places ) const; + virtual bool CreateNormalPlacements ( const MbVector3D & axisZ, double angle, SArray & places, VERSION version = Math::DefaultMathVersion() ) const; virtual bool CreateTangentPlacements( const MbVector3D & axisZ, SArray & places ) const; virtual bool GetCylinderAxis( MbAxis3D & axis ) const; // \ru Дать ось вращения для поверхности. \en Get a rotation axis of a surface. virtual bool GetCenterLines( std::vector & clCurves ) const; // \ru Дать осевые (центральные) линии для поверхности. \en Get center lines of a surface. diff --git a/C3d/Include/surf_fillet_surface.h b/C3d/Include/surf_fillet_surface.h index 444352b..c19a7d8 100644 --- a/C3d/Include/surf_fillet_surface.h +++ b/C3d/Include/surf_fillet_surface.h @@ -46,7 +46,7 @@ class MATH_CLASS MbFunction; */// --- class MATH_CLASS MbFilletSurface : public MbSmoothSurface { protected: - MbCurve3D * curve0; ///< \ru Кривая пересечения касательных к поверхностям - всегда не c3d_null. \en Intersection curve of tangents to surfaces - always not c3d_null. + MbCurve3D * curve0; ///< \ru Кривая пересечения касательных к поверхностям - всегда не nullptr. \en Intersection curve of tangents to surfaces - always not nullptr. MbFunction * weights0; ///< \ru Функция веса точек средней кривой curve0. \en Function of weight of points of curve0 mid-curve. double conic; ///< \ru Коэффициент формы, изменяется от 0.05 до 0.95, определяет вес точек кривой curve0. \en Coefficient of shape is changed between 0.05 and 0.95 and determines weight of points of curve0 curve. bool even; ///< \ru Равномерная параметризация по дуге или нет. \en Whether arc length parameterization is uniform or not. @@ -181,13 +181,13 @@ public: \en \name Common functions of a geometric object \{ */ virtual MbeSpaceType IsA() const; // \ru Тип элемента \en A type of element - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента. \en Create a copy of the element. + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента. \en Create a copy of the element. virtual bool IsSame ( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const; virtual bool SetEqual ( const MbSpaceItem & ); // \ru Сделать равным. \en Make equal. virtual bool IsSimilar( const MbSpaceItem & ) const; // \ru Являются ли объекты подобными. \en Determine whether the objects are similar. - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг. \en Move. - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси. \en Rotate around an axis. + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг. \en Move. + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси. \en Rotate around an axis. virtual void GetProperties( MbProperties &properties ); // \ru Выдать свойства объекта. \en Get properties of the object. virtual void SetProperties( const MbProperties &properties ); // \ru Записать свойства объекта. \en Set properties of the object. @@ -284,12 +284,12 @@ public: // \ru Проекции точки на поверхность. \en The point projections onto the surface. virtual MbeNewtonResult PointProjectionNewton( const MbCartPoint3D & p, size_t iterLimit, double & u, double & v, bool ext ) const; // \ru Функция для нахождения проекции точки на поверхность. \en Function for searching the point projection onto the surface. - virtual bool NearPointProjection ( const MbCartPoint3D & p, double & u, double & v, bool ext, MbRect2D * uvRange = c3d_null ) const; // \ru Ближайшая проекция точки на поверхность. \en The nearest point projection onto the surface. + virtual bool NearPointProjection ( const MbCartPoint3D & p, double & u, double & v, bool ext, MbRect2D * uvRange = nullptr ) const; // \ru Ближайшая проекция точки на поверхность. \en The nearest point projection onto the surface. virtual double GetFilletRadius( const MbCartPoint3D & p ) const; // \ru Является ли поверхность скруглением. \en Whether the surface is fillet. virtual double GetFilletRadius( double u ) const; // \ru Дать радиус скругления по первому параметру. \en Get fillet radius if the surface is fillet. // \ru Построить касательные и нормальные плейсменты конструктивных плоскостей. \en Construct tangent and normal placements of constructive planes. - virtual bool CreateNormalPlacements ( const MbVector3D & axisZ, double angle, SArray & places ) const; + virtual bool CreateNormalPlacements ( const MbVector3D & axisZ, double angle, SArray & places, VERSION version = Math::DefaultMathVersion() ) const; virtual bool CreateTangentPlacements( const MbVector3D & axisZ, SArray & places ) const; virtual bool GetCylinderAxis( MbAxis3D &axis ) const; // \ru Дать ось вращения для поверхности. \en Get a rotation axis of a surface. // \ru Подобные ли поверхности для объединения (слива). \en Whether the surfaces to union (joining) are similar. diff --git a/C3d/Include/surf_gregory_surface.h b/C3d/Include/surf_gregory_surface.h index 8b10413..875cc39 100644 --- a/C3d/Include/surf_gregory_surface.h +++ b/C3d/Include/surf_gregory_surface.h @@ -52,7 +52,7 @@ public: \param[in] initContour - \ru Контур. \en The contour. \~ */ - MbGregorySurface( const MbContour3D & initContour, const SArray * conj = c3d_null ); + MbGregorySurface( const MbContour3D & initContour, const SArray * conj = nullptr ); protected: /// \ru Конструктор-копия. \en Copy constructor. MbGregorySurface( const MbGregorySurface &, MbRegDuplicate * ); @@ -66,13 +66,13 @@ public: \en \name Common functions of a geometric object. \{ */ virtual MbeSpaceType IsA() const; // \ru Тип элемента. \en A type of element. - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента. \en Make a copy of element. + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента. \en Make a copy of element. virtual bool IsSame( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const; // \ru Является ли объект копией. \en Whether the object is a copy. virtual bool SetEqual( const MbSpaceItem & init ); // \ru Сделать равным. \en Make equal. virtual bool IsSimilar( const MbSpaceItem & init ) const; // \ru Являются ли объекты подобными. \en Whether the objects are similar. - virtual void Transform( const MbMatrix3D & matr, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix - virtual void Move( const MbVector3D &to, MbRegTransform * = c3d_null ); // \ru Сдвиг. \en Translation - virtual void Rotate( const MbAxis3D &axis, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси. \en Rotate around an axis + virtual void Transform( const MbMatrix3D & matr, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix + virtual void Move( const MbVector3D &to, MbRegTransform * = nullptr ); // \ru Сдвиг. \en Translation + virtual void Rotate( const MbAxis3D &axis, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси. \en Rotate around an axis virtual void Refresh(); // \ru Сбросить все временные данные. \en Flush all the temporary data. virtual void GetProperties( MbProperties & properties ); // \ru Выдать свойства объекта. \en Get properties of the object. diff --git a/C3d/Include/surf_grid_surface.h b/C3d/Include/surf_grid_surface.h index 8e9cb60..fc69ed8 100644 --- a/C3d/Include/surf_grid_surface.h +++ b/C3d/Include/surf_grid_surface.h @@ -193,13 +193,13 @@ public: \{ */ // \ru Общие функции геометрического объекта \en Common functions of a geometric object virtual MbeSpaceType IsA() const; // \ru Тип элемента \en A type of element - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Cделать копию элемента \en Make a copy of element + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Cделать копию элемента \en Make a copy of element virtual bool IsSame( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const; virtual bool SetEqual( const MbSpaceItem &init ); // \ru Сделать равным \en Make equal virtual bool IsSimilar( const MbSpaceItem &init ) const; // \ru Являются ли объекты подобными \en Whether the objects are similar - virtual void Transform( const MbMatrix3D &matr, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move( const MbVector3D &to, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate( const MbAxis3D &axis, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate around an axis + virtual void Transform( const MbMatrix3D &matr, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move( const MbVector3D &to, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate( const MbAxis3D &axis, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate around an axis virtual double DistanceToPoint( const MbCartPoint3D & ) const; // \ru Вычислить расстояние до точки. \en Calculate the distance to a point. virtual void GetProperties( MbProperties &properties ); // \ru Выдать свойства объекта \en Get properties of the object @@ -280,9 +280,9 @@ public: virtual size_t CurveClassification( const MbCurve & curve, SArray & tcurv, SArray & dir ) const; // \ru Найти ближайшую проекцию точки на поверхность. \en Find the nearest projection of a point onto the surface. - virtual bool NearPointProjection( const MbCartPoint3D & p, double & u, double & v, bool ext, MbRect2D * uvRange = c3d_null ) const; // \ru Ближайшая проекция точки на поверхность. \en The nearest point projection onto the surface. + virtual bool NearPointProjection( const MbCartPoint3D & p, double & u, double & v, bool ext, MbRect2D * uvRange = nullptr ) const; // \ru Ближайшая проекция точки на поверхность. \en The nearest point projection onto the surface. // \ru Найти все проекции точки на поверхность вдоль вектора в любом из двух направлений. \en Find all a point projection onto the surface along a vector in either of two directions. - virtual void DirectPointProjection( const MbCartPoint3D & p, const MbVector3D & vect, SArray & uv, bool ext, MbRect2D * uvRange = c3d_null ) const; + virtual void DirectPointProjection( const MbCartPoint3D & p, const MbVector3D & vect, SArray & uv, bool ext, MbRect2D * uvRange = nullptr ) const; // \ru Вce точки пересечения поверхности и кривой. \en All the points of intersection of a surface and a curve. virtual void CurveIntersection( const MbCurve3D & curv, SArray & uv, SArray & tt, bool ext0, bool ext, bool touchInclude = false ) const; @@ -341,7 +341,7 @@ public: , const Triangles & _triangles , const Bounds & _bounds ) { - MbGridSurface * surface = c3d_null; + MbGridSurface * surface = nullptr; const size_t itemsCnt = _params.size(); diff --git a/C3d/Include/surf_join_surface.h b/C3d/Include/surf_join_surface.h index 57396fa..8468310 100644 --- a/C3d/Include/surf_join_surface.h +++ b/C3d/Include/surf_join_surface.h @@ -219,12 +219,12 @@ public: \en \name Common functions of a geometric object \{ */ virtual MbeSpaceType IsA() const; // \ru Тип элемента \en A type of element - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента \en Create a copy of the element + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента \en Create a copy of the element virtual bool IsSame ( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const; // \ru Являются ли объекты равными \en Determine whether objects are equal virtual bool SetEqual ( const MbSpaceItem & ); // \ru Сделать равным \en Make equal - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate around an axis + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate around an axis virtual void GetProperties( MbProperties & properties ); // \ru Выдать свойства объекта \en Get properties of the object virtual void SetProperties( const MbProperties & properties ); // \ru Записать свойства объекта \en Set properties of the object diff --git a/C3d/Include/surf_lofted_surface.h b/C3d/Include/surf_lofted_surface.h index cb183fa..0dbc82b 100644 --- a/C3d/Include/surf_lofted_surface.h +++ b/C3d/Include/surf_lofted_surface.h @@ -202,13 +202,13 @@ public: \{ */ virtual MbeSpaceType IsA() const; // \ru Тип элемента \en A type of element virtual MbeSpaceType Type() const; // \ru Тип элемента \en A type of element - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента \en Create a copy of the element + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента \en Create a copy of the element virtual bool IsSame ( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const; // \ru Равны ли объекты \en Whether the objects are equal virtual bool SetEqual ( const MbSpaceItem & ); // \ru Сделать равным \en Make equal virtual bool IsSimilar( const MbSpaceItem & ) const; // \ru Являются ли объекты подобными \en Whether the objects are similar - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate around an axis + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate around an axis virtual void Refresh(); virtual void GetProperties( MbProperties & properties ); // \ru Выдать свойства объекта \en Get properties of the object @@ -303,7 +303,7 @@ public: virtual bool IsSpecialSimilarToSurface( const MbSurface & surf, VERSION version, double precision = METRIC_PRECISION ) const; // \ru Специальный случай \en Special case // \ru Построить касательные и нормальные плейсменты конструктивных плоскостей \en Construct tangent and normal placements of constructive planes - virtual bool CreateNormalPlacements ( const MbVector3D & axisZ, double angle, SArray & places ) const; + virtual bool CreateNormalPlacements ( const MbVector3D & axisZ, double angle, SArray & places, VERSION version = Math::DefaultMathVersion() ) const; virtual bool CreateTangentPlacements( const MbVector3D & axisZ, SArray & places ) const; virtual bool GetCylinderAxis( MbAxis3D & axis ) const; // \ru Дать ось вращения для поверхности \en Get a rotation axis of a surface @@ -322,9 +322,9 @@ public: SArray & uu, SArray & vv ) const; // \ru Найти ближайшую проекцию точки на поверхность или ее продолжение по заданному начальному приближению. \en Find the neares projection of a point onto the surface. - virtual bool NearPointProjection ( const MbCartPoint3D & pnt, double & u, double & v, bool ext, MbRect2D * uvRange = c3d_null ) const; + virtual bool NearPointProjection ( const MbCartPoint3D & pnt, double & u, double & v, bool ext, MbRect2D * uvRange = nullptr ) const; // \ru Найти все проекции точки на поверхность вдоль вектора в любом из двух направлений. \en Find all a point projection onto the surface along a vector in either of two directions. - virtual void DirectPointProjection( const MbCartPoint3D & pnt, const MbVector3D & vect, SArray & uv, bool ext, MbRect2D * uvRange = c3d_null ) const; + virtual void DirectPointProjection( const MbCartPoint3D & pnt, const MbVector3D & vect, SArray & uv, bool ext, MbRect2D * uvRange = nullptr ) const; virtual bool IsLineU() const; // \ru Если true все производные по U выше первой равны нулю \en If true, then all the derivatives by U higher the first one are equal to zero virtual bool IsLineV() const; // \ru Если true все производные по V выше первой равны нулю \en If true, then all the derivatives by V higher the first one are equal to zero @@ -350,7 +350,7 @@ public: \return \ru Константная кривая. \en The constant curve. \~ */ - const MbCurve3D * GetCurve( ptrdiff_t ind ) const { return (ind >= 0 && ind < (ptrdiff_t)uCurves.Count()) ? uCurves[ind] : c3d_null; } + const MbCurve3D * GetCurve( ptrdiff_t ind ) const { return (ind >= 0 && ind < (ptrdiff_t)uCurves.Count()) ? uCurves[ind] : nullptr; } /** \brief \ru Получить кривую для редактирования по номеру. \en Get curve for editing by an index. \~ \details \ru Получить кривую для редактирования по номеру. \n @@ -360,7 +360,7 @@ public: \return \ru Кривая. \en A curve. \~ */ - MbCurve3D * SetCurve( ptrdiff_t ind ) { return (ind >= 0 && ind < (ptrdiff_t)uCurves.Count()) ? uCurves[ind] : c3d_null; } + MbCurve3D * SetCurve( ptrdiff_t ind ) { return (ind >= 0 && ind < (ptrdiff_t)uCurves.Count()) ? uCurves[ind] : nullptr; } /** \brief \ru Получить параметр по номеру. \en Get parameter by an index. \~ \details \ru Получить параметр по номеру.\n @@ -691,8 +691,8 @@ inline void MbLoftedSurface::ParamThird( double t1, double t2, double * tLoft ) \en Whether the surface is closed by parameter v. \~ \param[in,out] vParams - \ru Множество параметров. \en Set of parameters. \~ - \param[in,out] tiePnts - \ru Множество центров масс профильных кривых. Не заполняется, если в функцию передать c3d_null. - \en Set of centers of mass of profile curves. If giving c3d_null to function, then it isn't filled. \~ + \param[in,out] tiePnts - \ru Множество центров масс профильных кривых. Не заполняется, если в функцию передать nullptr. + \en Set of centers of mass of profile curves. If giving nullptr to function, then it isn't filled. \~ \param[in] version - \ru Версия. \en Version. \~ \return \ru true - если массив параметров успешно создан. diff --git a/C3d/Include/surf_mesh_surface.h b/C3d/Include/surf_mesh_surface.h index bbe7020..eadf8e4 100644 --- a/C3d/Include/surf_mesh_surface.h +++ b/C3d/Include/surf_mesh_surface.h @@ -197,7 +197,7 @@ public: */ MbMeshSurface( RPArray & initU, RPArray & initV, bool uClosed, bool vClosed, - bool same, const SArray * types = c3d_null, + bool same, const SArray * types = nullptr, MbeMeshSurfaceVersion vers = msv_Ver3 ); /** \brief \ru Конструктор поверхности. \en Constructor of surface. \~ @@ -263,7 +263,7 @@ public: MbMeshSurface( RPArray & initU, RPArray & initV, SArray & parsU, SArray & parsV, bool uClosed, bool vClosed, - bool same, const SArray * types = c3d_null, + bool same, const SArray * types = nullptr, MbeMeshSurfaceVersion vers = msv_Ver3 ); /** \brief \ru Конструктор поверхности. @@ -360,13 +360,13 @@ public: \{ */ virtual MbeSpaceType IsA() const; // \ru Тип элемента \en A type of element virtual MbeSpaceType Type() const; // \ru Групповой тип элемента. \en Group element type. - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Cделать копию элемента \en Make a copy of element + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Cделать копию элемента \en Make a copy of element virtual bool IsSame( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const; // \ru Является ли объект копией. \en Whether the object is a copy. virtual bool SetEqual( const MbSpaceItem & init ); // \ru Сделать равным \en Make equal virtual bool IsSimilar( const MbSpaceItem & init ) const; // \ru Являются ли объекты подобными \en Whether the objects are similar - virtual void Transform( const MbMatrix3D & matr, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move( const MbVector3D &to, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate( const MbAxis3D &axis, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate around an axis + virtual void Transform( const MbMatrix3D & matr, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move( const MbVector3D &to, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate( const MbAxis3D &axis, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate around an axis virtual void Refresh(); // \ru Сбросить все временные данные \en Flush all the temporary data virtual void GetProperties( MbProperties & properties ); // \ru Выдать свойства объекта \en Get properties of the object @@ -471,9 +471,9 @@ public: virtual bool IsLineV() const; // \ru Если true все производные по V выше первой равны нулю \en If true, then all the derivatives by V higher the first one are equal to zero // \ru Найти ближайшую проекцию точки на поверхность или ее продолжение по заданному начальному приближению. \en Find the neares projection of a point onto the surface. - virtual bool NearPointProjection ( const MbCartPoint3D & pnt, double & u, double & v, bool ext, MbRect2D * uvRange = c3d_null ) const; + virtual bool NearPointProjection ( const MbCartPoint3D & pnt, double & u, double & v, bool ext, MbRect2D * uvRange = nullptr ) const; // \ru Найти все проекции точки на поверхность вдоль вектора в любом из двух направлений. \en Find all a point projection onto the surface along a vector in either of two directions. - virtual void DirectPointProjection( const MbCartPoint3D & pnt, const MbVector3D & vect, SArray & uv, bool ext, MbRect2D * uvRange = c3d_null ) const; + virtual void DirectPointProjection( const MbCartPoint3D & pnt, const MbVector3D & vect, SArray & uv, bool ext, MbRect2D * uvRange = nullptr ) const; virtual MbCurve3D * CurveU( double v, MbRect1D * pRgn, bool bApprox = true ) const; // \ru Пространственная копия линии v = const. \en Spatial copy of 'v = const'-line. virtual MbCurve3D * CurveV( double u, MbRect1D * pRgn, bool bApprox = true ) const; // \ru Пространственная копия линии u = const. \en Spatial copy of 'u = const'-line. @@ -501,20 +501,20 @@ public: \en Get curve with 'ind' index from first family. \n \~ \param[in] ind - \ru Номер запрашиваемой кривой в массиве. \en Index of required curve in array. \~ - \return \ru Кривая или c3d_null, если значение ind выходит за диапазон возможных индексов массиве кривых. - \en Curve or c3d_null if value of 'ind' is out of range of possible indices of array of curves. \~ + \return \ru Кривая или nullptr, если значение ind выходит за диапазон возможных индексов массиве кривых. + \en Curve or nullptr if value of 'ind' is out of range of possible indices of array of curves. \~ */ - const MbCurve3D * GetUCurve( size_t ind ) const { return ( ind < uCurves.Count()) ? uCurves[ind] : c3d_null; } + const MbCurve3D * GetUCurve( size_t ind ) const { return ( ind < uCurves.Count()) ? uCurves[ind] : nullptr; } /** \brief \ru Получить кривую с индексом ind из второго семейства. \en Get curve with 'ind' index from second family. \~ \details \ru Получить кривую с индексом ind из второго семейства. \n \en Get curve with 'ind' index from second family. \n \~ \param[in] ind - \ru Номер запрашиваемой кривой в массиве. \en Index of required curve in array. \~ - \return \ru Кривая или c3d_null, если значение ind выходит за диапазон возможных индексов массиве кривых. - \en Curve or c3d_null if value of 'ind' is out of range of possible indices of array of curves. \~ + \return \ru Кривая или nullptr, если значение ind выходит за диапазон возможных индексов массиве кривых. + \en Curve or nullptr if value of 'ind' is out of range of possible indices of array of curves. \~ */ - const MbCurve3D * GetVCurve( size_t ind ) const { return ( ind < vCurves.Count()) ? vCurves[ind] : c3d_null; } + const MbCurve3D * GetVCurve( size_t ind ) const { return ( ind < vCurves.Count()) ? vCurves[ind] : nullptr; } /** \brief \ru Получить значение параметра, соответствующего кривой с индексом ind из первого семейства. \en Get value of parameter corresponding to curve with 'ind' index from first family. \~ \details \ru Получить значение параметра, соответствующего кривой с индексом ind из первого семейства.\n @@ -606,12 +606,15 @@ private: void PointOn( double & u, double & v, MbCartPoint3D & p, MbMeshSurfaceAuxiliaryData * ) const; // \ru Точка на поверхности \en Point on the surface // \ru Определить местные координаты области поверхности. \en Determine local coordinates of surface region. - void LocalCoordinate( double u, double v, double & ul, double & vl, size_t & i0,size_t & j0,size_t & i1, size_t & j1, MbMeshSurfaceAuxiliaryData * ucache = c3d_null ) const; + void LocalCoordinate( double u, double v, double & ul, double & vl, size_t & i0,size_t & j0,size_t & i1, size_t & j1, MbMeshSurfaceAuxiliaryData * ucache = nullptr ) const; void LocalCoordinate_v2( double u, double v, double & ul, double & vl, size_t & i0, size_t & j0, size_t & i1, size_t & j1, size_t ord, MbMeshSurfaceAuxiliaryData * ucache ) const; void LocalCoordinate_v4( double u, double v, size_t ordU, size_t ordV, MbMeshSurfaceAuxiliaryData * ucache ) const; // \ru Рассчитать параметры для границы патча. \en Calculate parameters for the patch boundary. void PatchBoundExplore_v4( const MbCurve3D * curve, const MbFunction * fn, double par, size_t bnd, MbeMatingType tp, MbCoonsPatchData & pd, ptrdiff_t ord ) const; + // \ru Вернуть изолинию на поверхности для указанного параметра. + MbCurve3D * CurveUV_v4( bool dirU, double sPar, MbRect1D * pRgn, bool bApprox ) const; // \ru Пространственная копия линии u(v) = const. \en Spatial copy of line u(v) = const. + // \ru Вычислить вспомогательные вектора производных вдоль U кривых патча. \en Calculate auxiliary vectors of derivatives along U curves of patch. void CalculateAlongU( const double & ul, const size_t & j0, const size_t & j1, MbMeshSurfaceAuxiliaryData * ucache ) const; @@ -773,7 +776,7 @@ private: void GeneratrixCurveExplore_v3( bool dirU, size_t ind, double t, MbCartPoint3D & p, MbVector3D & fir, MbVector3D & sec, MbVector3D & thir ) const; // \ru Инициализировать массивы расширения. \en Init expansion arrays. - void InitExtArrays( const bool (*adjPatch)[4] = c3d_null ); + void InitExtArrays( const bool (*adjPatch)[4] = nullptr ); /** \} */ @@ -816,7 +819,7 @@ inline void MbMeshSurface::CheckParams( double & u, double & v ) const // --- inline void MbMeshSurface::CheckParamsEx( double & u, double & v, MbMeshSurfaceAuxiliaryData * ucache ) const { - MbMeshSurfaceAuxiliaryData * loccache = ucache != c3d_null ? ucache : cache(); + MbMeshSurfaceAuxiliaryData * loccache = ucache != nullptr ? ucache : cache(); if ( loccache->data->PoleUMin() == spt_Undefined ) CheckPoles( loccache ); if ( loccache->data->PoleUMin() == spt_Point ) { diff --git a/C3d/Include/surf_offset_surface.h b/C3d/Include/surf_offset_surface.h index c2c4a58..066136a 100644 --- a/C3d/Include/surf_offset_surface.h +++ b/C3d/Include/surf_offset_surface.h @@ -44,7 +44,7 @@ class MATH_CLASS MbSurfaceContiguousData; // --- class MATH_CLASS MbOffsetSurface : public MbSurface { private: - MbSurface * basisSurface; ///< \ru Базовая поверхность (всегда не c3d_null). \en Base surface (always not c3d_null). + MbSurface * basisSurface; ///< \ru Базовая поверхность (всегда не nullptr). \en Base surface (always not nullptr). double u0min; ///< \ru Минимальный параметр u базовой поверхности. \en Minimal parameter u of the base surface. double u0max; ///< \ru Максимальный параметр u базовой поверхности. \en Maximal parameter u of the base surface. double v0min; ///< \ru Минимальный параметр v базовой поверхности. \en Minimal parameter v of the base surface. @@ -197,14 +197,14 @@ public: \en \name Common functions of a geometric object \{ */ virtual MbeSpaceType IsA() const; // \ru Тип элемента. \en A type of element. - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента. \en Create a copy of the element. + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента. \en Create a copy of the element. virtual bool IsSame ( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const; // \ru Является ли объект копией. \en Whether the object is a copy. virtual bool SetEqual ( const MbSpaceItem & ); // \ru Сделать равным. \en Make equal. virtual bool IsSimilar( const MbSpaceItem & ) const; // \ru Являются ли объекты подобными. \en Determine whether the objects are similar. virtual bool IsPlanar( double accuracy = METRIC_EPSILON ) const; // \ru Является ли поверхность плоской. \en Whether the surface is planar. - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг. \en Move. - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси. \en Rotate around an axis. + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг. \en Move. + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси. \en Rotate around an axis. virtual void Refresh(); // \ru Сбросить все временные данные \en Flush all the temporary data virtual void GetProperties( MbProperties & properties ); // \ru Выдать свойства объекта. \en Get properties of the object. @@ -303,7 +303,7 @@ public: virtual double CurvatureU ( double u, double v ) const; // \ru Kривизна линии u. \en Curvature of u-line. virtual double CurvatureV ( double u, double v ) const; // \ru Kривизна линии v. \en Curvature of v-line. // \ru Ближайшая проекция точки на поверхность. \en The nearest point projection onto the surface. - virtual bool NearPointProjection( const MbCartPoint3D & p, double & u, double & v, bool ext, MbRect2D * uvRange = c3d_null ) const; + virtual bool NearPointProjection( const MbCartPoint3D & p, double & u, double & v, bool ext, MbRect2D * uvRange = nullptr ) const; // \ru Изменение носителя. \en Changing of carrier. virtual void ChangeCarrier( const MbSpaceItem & item, MbSpaceItem & init ); // \ru Изменение носимых элементов. \en Change a carrier elements. @@ -338,7 +338,7 @@ public: virtual bool IsLineV () const; // \ru Если true все производные по V выше первой равны нулю. \en If true, then all the derivatives by V higher the first one are equal to zero. // \ru Найти все проекции точки на поверхность вдоль вектора в любом из двух направлений. \en Find all a point projection onto the surface along a vector in either of two directions. - virtual void DirectPointProjection( const MbCartPoint3D & pnt, const MbVector3D & vect, SArray & uv, bool ext, MbRect2D * uvRange = c3d_null ) const; + virtual void DirectPointProjection( const MbCartPoint3D & pnt, const MbVector3D & vect, SArray & uv, bool ext, MbRect2D * uvRange = nullptr ) const; /** \brief \ru Проверить параметры. Аналог глобальной функции _CheckParams, оптимизированный под использование кэшей. \en Check parameters. Analogue of the global function _CheckParams, optimized for caches usage. \~ diff --git a/C3d/Include/surf_plane.h b/C3d/Include/surf_plane.h index a9a6973..1a7cb50 100644 --- a/C3d/Include/surf_plane.h +++ b/C3d/Include/surf_plane.h @@ -209,8 +209,8 @@ public: \en \name Common functions of a geometric object \{ */ virtual MbeSpaceType IsA() const; // \ru Тип элемента. \en A type of element. - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const ; // \ru Сделать копию элемента. \en Create a copy of the element. - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const ; // \ru Сделать копию элемента. \en Create a copy of the element. + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. virtual bool IsSame ( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const; // \ru Равны ли объекты. \en Whether the objects are equal. virtual bool SetEqual ( const MbSpaceItem & ); // \ru Сделать равными. \en Make equal. @@ -322,10 +322,10 @@ public: virtual MbeItemLocation PointRelative ( const MbCartPoint3D & pnt, double eps = ANGLE_REGION ) const; virtual double DistanceToPoint( const MbCartPoint3D & ) const; // \ru Вычислить расстояние до точки. \en Calculate the distance to a point. // \ru Найти все проекции точки на поверхность вдоль вектора в любом из двух направлений. \en Find all a point projection onto the surface along a vector in either of two directions. - virtual void DirectPointProjection( const MbCartPoint3D & p, const MbVector3D & v, SArray & uv, bool ext, MbRect2D * uvRange = c3d_null ) const; + virtual void DirectPointProjection( const MbCartPoint3D & p, const MbVector3D & v, SArray & uv, bool ext, MbRect2D * uvRange = nullptr ) const; // \ru Ближайшая проекция точки на поверхность в направлении вектора. \en The nearest projection of a point to the surface in direction of the vector. virtual bool NearDirectPointProjection( const MbCartPoint3D & p, const MbVector3D & vector, - double & u, double & v, bool ext, MbRect2D * uvRange = c3d_null, bool onlyPositiveDirection = false ) const; + double & u, double & v, bool ext, MbRect2D * uvRange = nullptr, bool onlyPositiveDirection = false ) const; // \ru Пересечения с кривой. \en Intersection with a curve. virtual MbeNewtonResult CurveIntersectNewton( const MbCurve3D &, double funcEpsilon, size_t limit, double & u, double & v, double & t, bool ext0, bool ext ) const; // \ru Нахождениe точки пересечения c кривой. \en Search of a point of intersection with curve. @@ -340,7 +340,7 @@ public: virtual bool GetMatrixToSurface( const MbSurface & surf, MbMatrix & matr, VERSION version, double precision = METRIC_PRECISION ) const; virtual double GetParamDelta() const; // \ru Дать максимальное приращение параметра. \en Get the maximum increment of parameter. - virtual double GetParamPrice() const; // \ru Дать мимнимально различимую величину параметра. \en Get the minimum distinguishable value of parameter. + virtual double GetParamPrice() const; // \ru Дать минимально различимую величину параметра. \en Get the minimum distinguishable value of parameter. virtual double GetUParamToUnit() const; // \ru Дать приращение параметра u, соответствующее единичной длине в пространстве. \en Get increment of u-parameter, corresponding to the unit length in space. virtual double GetVParamToUnit() const; // \ru Дать приращение параметра v, соответствующее единичной длине в пространстве. \en Get increment of v-parameter, corresponding to the unit length in space. @@ -371,7 +371,7 @@ public: /** \ru \name Функции элементарных поверхностей \en \name Functions of elementary surfaces. \{ */ - virtual bool GetPointProjection( const MbCartPoint3D & p, bool init, double & u, double & v, bool ext, MbRect2D * uvRange = c3d_null ) const; + virtual bool GetPointProjection( const MbCartPoint3D & p, bool init, double & u, double & v, bool ext, MbRect2D * uvRange = nullptr ) const; /** \} */ /** \ru \name Функции плоскости \en \name Functions of plane. @@ -418,7 +418,7 @@ public: /// \ru Матрица для преобразования симметрии относительно плоскости. \en The matrix of symmetry transformation relative to the plane void Symmetry ( MbMatrix3D & m ) const { position.Symmetry(m); } /// \ru Инвертировать нормаль плоскости. \en Invert the normal of plane. - void Invert( MbMatrix * = c3d_null, MbRegTransform * ireg = c3d_null ); + void Invert( MbMatrix * = nullptr, MbRegTransform * ireg = nullptr ); /// \ru Сделать систему координат правой. \en Make the coordinate system right. void SetRightPlacement() { position.SetRight(); SetDirtyGabarit(); } diff --git a/C3d/Include/surf_polysurface.h b/C3d/Include/surf_polysurface.h index 59bc181..f85fc33 100644 --- a/C3d/Include/surf_polysurface.h +++ b/C3d/Include/surf_polysurface.h @@ -84,12 +84,12 @@ public: \{ */ virtual MbeSpaceType IsA() const = 0; // \ru Тип элемента \en Type of element virtual MbeSpaceType Type() const; // \ru Тип элемента \en Type of element - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const = 0; // \ru Cделать копию элемента \en Make a copy of an element. + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const = 0; // \ru Cделать копию элемента \en Make a copy of an element. virtual bool IsSame ( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const = 0; // \ru Являются ли объекты равными \en Determine whether objects are equal virtual bool SetEqual ( const MbSpaceItem & ) = 0; // \ru Сделать равным \en Make equal - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг \en Translation - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси \en Rotate about an axis + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг \en Translation + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси \en Rotate about an axis virtual void GetProperties( MbProperties & ) = 0; // \ru Выдать свойства объекта \en Get properties of the object virtual void SetProperties( const MbProperties & ) = 0; // \ru Записать свойства объекта \en Set properties of the object diff --git a/C3d/Include/surf_revolution_surface.h b/C3d/Include/surf_revolution_surface.h index 8e2fdc5..06a2c4f 100644 --- a/C3d/Include/surf_revolution_surface.h +++ b/C3d/Include/surf_revolution_surface.h @@ -137,13 +137,13 @@ public: \en \name Common functions of a geometric object \{ */ virtual MbeSpaceType IsA() const; // \ru Тип элемента. \en A type of element. - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента. \en Create a copy of the element. + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента. \en Create a copy of the element. virtual bool IsSame ( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const; // \ru Равны ли объекты. \en Whether the objects are equal. virtual bool SetEqual ( const MbSpaceItem & ); // \ru Сделать равным. \en Make equal. virtual bool IsSimilar( const MbSpaceItem & ) const; // \ru Являются ли объекты подобными. \en Determine whether the objects are similar. - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг. \en Translation. - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси. \en Rotate around an axis. + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг. \en Translation. + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси. \en Rotate around an axis. virtual void GetProperties( MbProperties & properties ); // \ru Выдать свойства объекта. \en Get properties of the object. virtual void SetProperties( const MbProperties & properties ); // \ru Записать свойства объекта. \en Set properties of the object. @@ -241,9 +241,9 @@ public: virtual MbCurve3D * CurveV( double u, MbRect1D * pRgn, bool bApprox = true ) const; // \ru Пространственная копия линии u = const \en A spatial copy of the line u = const. // \ru Ближайшая проекция точки на поверхность. \en The nearest point projection on the surface. - virtual bool NearPointProjection( const MbCartPoint3D & p, double & u, double & v, bool ext, MbRect2D * uvRange = c3d_null ) const; // \ru Ближайшая проекция точки на поверхность. \en The nearest point projection on the surface. + virtual bool NearPointProjection( const MbCartPoint3D & p, double & u, double & v, bool ext, MbRect2D * uvRange = nullptr ) const; // \ru Ближайшая проекция точки на поверхность. \en The nearest point projection on the surface. // \ru Найти все проекции точки на поверхность вдоль вектора в любом из двух направлений. \en Find all a point projection onto the surface along a vector in either of two directions. - virtual void DirectPointProjection( const MbCartPoint3D & p, const MbVector3D & vect, SArray & uv, bool ext, MbRect2D * uvRange = c3d_null ) const; + virtual void DirectPointProjection( const MbCartPoint3D & p, const MbVector3D & vect, SArray & uv, bool ext, MbRect2D * uvRange = nullptr ) const; // \ru Подобные ли поверхности для объединения (слива). \en Whether the surfaces are similar to merge. virtual bool IsSimilarToSurface( const MbSurface & surf, VERSION version, double precision = METRIC_PRECISION ) const; @@ -254,7 +254,7 @@ public: virtual bool IsSpecialSimilarToSurface( const MbSurface & surf, VERSION version, double precision = METRIC_PRECISION ) const; // \ru Специальный случай \en Special case // \ru Построить касательные и нормальные плейсменты конструктивных плоскостей. \en Construct tangent and normal placements of constructive planes. - virtual bool CreateNormalPlacements ( const MbVector3D & axisZ, double angle, SArray & places ) const; + virtual bool CreateNormalPlacements ( const MbVector3D & axisZ, double angle, SArray & places, VERSION version = Math::DefaultMathVersion() ) const; virtual bool CreateTangentPlacements( const MbVector3D & axisZ, SArray & places ) const; virtual double GetFilletRadius( const MbCartPoint3D & p ) const; // \ru Является ли поверхность скруглением. \en Whether the surface is fillet. diff --git a/C3d/Include/surf_ruled_surface.h b/C3d/Include/surf_ruled_surface.h index 5344aef..162187c 100644 --- a/C3d/Include/surf_ruled_surface.h +++ b/C3d/Include/surf_ruled_surface.h @@ -116,13 +116,13 @@ public: \en \name Common functions of a geometric object \{ */ virtual MbeSpaceType IsA() const; // \ru Тип элемента. \en A type of element. - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента. \en Create a copy of the element. + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента. \en Create a copy of the element. virtual bool IsSame ( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const; // \ru Равны ли объекты. \en Whether the objects are equal. virtual bool SetEqual ( const MbSpaceItem & ); // \ru Сделать равным. \en Make equal. virtual bool IsSimilar( const MbSpaceItem & ) const; // \ru Являются ли объекты подобными. \en Determine whether the objects are similar. - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг. \en Move. - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси. \en Rotate around an axis. + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг. \en Move. + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси. \en Rotate around an axis. virtual void GetProperties( MbProperties &properties ); // \ru Выдать свойства объекта. \en Get properties of the object. virtual void SetProperties( const MbProperties &properties ); // \ru Записать свойства объекта. \en Set properties of the object. @@ -214,7 +214,7 @@ public: virtual void ChangeCarrier( const MbSpaceItem & item, MbSpaceItem & init ); // \ru Изменение носителя. \en Changing of carrier. // \ru Ближайшая проекция точки на поверхность. \en The nearest point projection onto the surface. - virtual bool NearPointProjection( const MbCartPoint3D & p, double & u, double & v, bool ext, MbRect2D * uvRange = c3d_null ) const; + virtual bool NearPointProjection( const MbCartPoint3D & p, double & u, double & v, bool ext, MbRect2D * uvRange = nullptr ) const; // \ru Пересечение с кривой. \en Intersection with curve. virtual void CurveIntersection( const MbCurve3D & curv, SArray & uv, SArray & tt, @@ -232,7 +232,7 @@ public: virtual MbCurve3D * CurveUV( const MbLineSegment &, bool bApprox = true ) const; // \ru Пространственная копия линии по параметрической линии. \en Spatial copy of line by parametric line. // \ru Построить касательные и нормальные плейсменты конструктивных плоскостей. \en Construct tangent and normal placements of constructive planes. - virtual bool CreateNormalPlacements ( const MbVector3D & axisZ, double angle, SArray & places ) const; + virtual bool CreateNormalPlacements ( const MbVector3D & axisZ, double angle, SArray & places, VERSION version = Math::DefaultMathVersion() ) const; virtual bool CreateTangentPlacements( const MbVector3D & axisZ, SArray & places ) const; virtual bool GetCylinderAxis( MbAxis3D &axis ) const; // \ru Дать ось вращения для поверхности \en Get a rotation axis of a surface // \ru Подобные ли поверхности для объединения (слива). \en Whether the surfaces to union (joining) are similar. @@ -285,7 +285,7 @@ private: RuledSurfaceType CheckType(); MbConeSurface * GetConeSurface() const; bool IsPlane() const; // \ru НЕ ИСПОЛЬЗОВАТЬ СНАРУЖИ !!! \en NOT USE OUTSIDE !!! - void BreaksInit( bool forCurve ); // \ru Определение точек излома направляющих. \en Determination of the break points of the guides. + void BreakPoints( bool forCurve, double precision = ANGLE_REGION ); // \ru Определение точек излома направляющих. \en Determination of the break points of the guides. DECLARE_PERSISTENT_CLASS_NEW_DEL( MbRuledSurface ) OBVIOUS_PRIVATE_COPY( MbRuledSurface ) diff --git a/C3d/Include/surf_section_surface.h b/C3d/Include/surf_section_surface.h index afcf2e7..828e495 100644 --- a/C3d/Include/surf_section_surface.h +++ b/C3d/Include/surf_section_surface.h @@ -56,8 +56,8 @@ protected: MbCurve3D * guide1; ///< \ru Первая направляющая кривая. \en The first guide curve. MbCurve3D * guide2; ///< \ru Вторая направляющая кривая. \en The second guide curve. std::vector curves; ///< \ru Дополнительные контрольные кривые (могут отсутствовать). \en The additional control curves (may be empty). - MbFunction * function; ///< \ru Функция управления сечением (радиус или дискриминант, может быть c3d_null)). \en Section control function (radius or discriminant, may be c3d_null). - MbPolyCurve * pattern; ///< \ru Образующая кривая при form==cs_Shape (для других форм c3d_null). \en Forming curve for form==cs_Shape (c3d_null on other case). + MbFunction * function; ///< \ru Функция управления сечением (радиус или дискриминант, может быть nullptr)). \en Section control function (radius or discriminant, may be nullptr). + MbPolyCurve * pattern; ///< \ru Образующая кривая при form==cs_Shape (для других форм nullptr). \en Forming curve for form==cs_Shape (nullptr on other case). std::vector shape; ///< \ru Описание сечения при form==cs_Shape (пуст в других случаях). \en Description of shape cross-section for form==cs_Shape (is empty on other case). std::vector knots; ///< \ru Узловой вектор сплайна. \en Knot vector of the spline. size_t order; ///< \ru Порядок сплайна (степень + 1). \en Order of spline (degree + 1). @@ -182,8 +182,8 @@ public: \en The first guide curve. \~ \param[in] g2 - \ru Вторая направляющая кривая (g1==g2 совпадает с первой при cs_Round). \en The second guide curve (g1==g2 the same first guide for st_Round). \~ - \param[in] c0 - \ru Дополнительная направляющая кривая (может быть c3d_null). - \en The additional guide curve (may be c3d_null). \~ + \param[in] c0 - \ru Дополнительная направляющая кривая (может быть nullptr). + \en The additional guide curve (may be nullptr). \~ \param[in] f - \ru Форма сечения поверхности. \en The form of the surface section. \~ \param[in] sense - \ru Направление нормали поверхности направляющей кривой (для guide1==guide2). @@ -229,13 +229,13 @@ public: virtual MbeSpaceType IsA() const; // \ru Тип элемента \en A type of element virtual MbeSpaceType Type() const; // \ru Групповой тип элемента. \en Group element type. - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента. \en Create a copy of the element. + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента. \en Create a copy of the element. virtual bool IsSame ( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const; // \ru Равны ли объекты. \en Whether the objects are equal. virtual bool SetEqual ( const MbSpaceItem & ); // \ru Сделать равным. \en Make equal. virtual bool IsSimilar ( const MbSpaceItem & ) const; // \ru Являются ли объекты подобными. \en Determine whether the objects are similar. - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг. \en Move. - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси. \en Rotate around an axis. + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг. \en Move. + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси. \en Rotate around an axis. virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта. \en Get properties of the object. virtual void SetProperties( const MbProperties & ); // \ru Записать свойства объекта. \en Set properties of the object. @@ -342,7 +342,7 @@ public: virtual MbCurve3D * CurveV( double u, MbRect1D *pRgn, bool bApprox = true ) const; // \ru Пространственная копия линии u = const. \en Spatial copy of 'u = const'-line. // \ru Построить касательные и нормальные плейсменты конструктивных плоскостей. \en Construct tangent and normal placements of constructive planes. - virtual bool CreateNormalPlacements ( const MbVector3D & axisZ, double angle, SArray & places ) const; + virtual bool CreateNormalPlacements ( const MbVector3D & axisZ, double angle, SArray & places, VERSION version = Math::DefaultMathVersion() ) const; virtual bool CreateTangentPlacements( const MbVector3D & axisZ, SArray & places ) const; // \ru Подобные ли поверхности для объединения (слива). \en Whether the surfaces to union (joining) are similar. virtual bool IsSimilarToSurface( const MbSurface & surf, VERSION version, double precision = METRIC_PRECISION ) const; @@ -370,17 +370,17 @@ public: const MbSpine & GetSpine() const { return *spine; } /// \ru Дать опорную кривую. \en Get reference curve. const MbCurve3D & GetSpineCurve() const { return spine->GetCurve(); } - /// \ru Дать первую направляющую кривую (может быть c3d_null). \en Get first guide curve (may be c3d_null). + /// \ru Дать первую направляющую кривую (может быть nullptr). \en Get first guide curve (may be nullptr). const MbCurve3D * GetGuide1() const { return guide1; } - /// \ru Дать вторую направляющую кривую (может быть c3d_null). \en Get second guide curve (may be c3d_null). + /// \ru Дать вторую направляющую кривую (может быть nullptr). \en Get second guide curve (may be nullptr). const MbCurve3D * GetGuide2() const { return guide2; } - /// \ru Дать кривую вершин (может отсутствовать). \en Get apex curve (may be c3d_null). - const MbCurve3D * GetApexCurve() const { return ( curves.size() > 0 ) ? curves[0] : c3d_null; } + /// \ru Дать кривую вершин (может отсутствовать). \en Get apex curve (may be nullptr). + const MbCurve3D * GetApexCurve() const { return ( curves.size() > 0 ) ? curves[0] : nullptr; } /// \ru Дать дополнительную направляющую кривую (может отсутствовать). \en Get additional guide curve (may be absence). - const MbCurve3D * GetCurve( size_t i ) const { return ( i < curves.size() ) ? curves[i] : c3d_null; } - /// \ru Дать функцию управления сечением (радиус или дискриминант, может быть c3d_null)). \en Get section control function (radius or discriminant, may be c3d_null). + const MbCurve3D * GetCurve( size_t i ) const { return ( i < curves.size() ) ? curves[i] : nullptr; } + /// \ru Дать функцию управления сечением (радиус или дискриминант, может быть nullptr)). \en Get section control function (radius or discriminant, may be nullptr). const MbFunction * GetFunction() const { return function; } - /// \ru Дать образующую кривую при form==cs_Shape (для других форм c3d_null). \en Get forming curve for form==cs_Shape (c3d_null on other case). + /// \ru Дать образующую кривую при form==cs_Shape (для других форм nullptr). \en Get forming curve for form==cs_Shape (nullptr on other case). const MbPolyCurve * GetPattern() const { return pattern; } /// \ru Вычисление параметров направляющих кривых по второму параметру поверхности. \en Calculating the parameters of guide curves by the second surface parameter. @@ -404,7 +404,7 @@ public: protected : void Init(); // \ru Инициализация данных. \en Data init. - void BreaksInit( const MbCurve3D * ); // \ru Определение точек излома направляющих. \en Determination of the break points of the guides. + void BreakPoints( const MbCurve3D * , double precision = ANGLE_REGION ); // \ru Определение точек излома направляющих. \en Determination of the break points of the guides. void CacheInit(); // \ru Инициализация вспомогательных данных. \en Auxiliary data init. // \ru Проверить и изменить при необходимости параметры поверхности. \en Check and correct parameters of the surface. void CheckParams( double & u, double & v, bool ext ) const; diff --git a/C3d/Include/surf_sector_surface.h b/C3d/Include/surf_sector_surface.h index 19a4f9d..640c0c0 100644 --- a/C3d/Include/surf_sector_surface.h +++ b/C3d/Include/surf_sector_surface.h @@ -66,13 +66,13 @@ public: \en \name Common functions of a geometric object \{ */ virtual MbeSpaceType IsA() const; // \ru Тип элемента. \en A type of element. - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Cделать копию элемента. \en Make a copy of an element. + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Cделать копию элемента. \en Make a copy of an element. virtual bool IsSame ( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const; // \ru Являются ли объекты равными. \en Determine whether objects are equal. virtual bool SetEqual ( const MbSpaceItem & ); // \ru Сделать равным. \en Make equal. virtual bool IsSimilar( const MbSpaceItem & ) const; // \ru Являются ли объекты подобными. \en Determine whether the objects are similar. - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать. \en Transform. - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг. \en Translation. - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси. \en Rotate around an axis. + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать. \en Transform. + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг. \en Translation. + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси. \en Rotate around an axis. virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта. \en Get properties of the object. virtual void SetProperties( const MbProperties & ); // \ru Записать свойства объекта. \en Set properties of the object. @@ -163,7 +163,7 @@ public: virtual void CalculateLocalGabarit( const MbMatrix3D &, MbCube & ) const; // \ru Рассчитать габарит относительно л.с.к. \en Calculate bounding box relative to the local coordinate system. // \ru Построить касательные и нормальные плейсменты конструктивных плоскостей. \en Construct tangent and normal placements of constructive planes. - virtual bool CreateNormalPlacements ( const MbVector3D & axisZ, double angle, SArray & places ) const; + virtual bool CreateNormalPlacements ( const MbVector3D & axisZ, double angle, SArray & places, VERSION version = Math::DefaultMathVersion() ) const; virtual bool CreateTangentPlacements( const MbVector3D & axisZ, SArray & places ) const; // \ru Определение разбивки параметрической области поверхности вертикалями и горизонталями. \en Determine a splitting of parametric region of a surface by verticals and horizontals. virtual void GetTesselation( const MbStepData & stepData, diff --git a/C3d/Include/surf_smooth_surface.h b/C3d/Include/surf_smooth_surface.h index 718ca23..9115136 100644 --- a/C3d/Include/surf_smooth_surface.h +++ b/C3d/Include/surf_smooth_surface.h @@ -37,8 +37,8 @@ class MATH_CLASS MbSurfaceIntersectionCurve; // --- class MATH_CLASS MbSmoothSurface : public MbSurface { protected: - MbSurfaceCurve * curve1; ///< \ru Опорная кривая на первой поверхности (всегда не c3d_null). \en Support curve on the first surface (it never equals c3d_null). - MbSurfaceCurve * curve2; ///< \ru Опорная кривая на второй поверхности (всегда не c3d_null). \en Support curve on the second surface (it never equals c3d_null). + MbSurfaceCurve * curve1; ///< \ru Опорная кривая на первой поверхности (всегда не nullptr). \en Support curve on the first surface (it never equals nullptr). + MbSurfaceCurve * curve2; ///< \ru Опорная кривая на второй поверхности (всегда не nullptr). \en Support curve on the second surface (it never equals nullptr). MbeSmoothForm form; ///< \ru Тип сопряжения. \en Conjugation type. double distance1; ///< \ru Радиус скругления или "катет" фаски со знаком для поверхности кривой curve1. \en Fillet radius or chamfer "cathetus" with sign for surface of curve1 curve. double distance2; ///< \ru Радиус скругления или "катет" фаски со знаком для поверхности кривой curve2. \en Fillet radius or chamfer "cathetus" with sign for surface of curve2 curve. @@ -116,12 +116,12 @@ public: \{ */ virtual MbeSpaceType IsA() const = 0; // \ru Тип элемента. \en A type of element. virtual MbeSpaceType Type() const; // \ru Тип элемента. \en A type of element. - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const = 0; // \ru Сделать копию элемента. \en Create a copy of the element. + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const = 0; // \ru Сделать копию элемента. \en Create a copy of the element. virtual bool IsSame ( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const = 0; virtual bool SetEqual ( const MbSpaceItem & ) = 0; // \ru Сделать равным. \en Make equal. - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ) = 0; // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ) = 0; // \ru Сдвиг. \en Translation. - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ) = 0; // \ru Повернуть вокруг оси. \en Rotate around an axis. + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ) = 0; // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ) = 0; // \ru Сдвиг. \en Translation. + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ) = 0; // \ru Повернуть вокруг оси. \en Rotate around an axis. virtual void GetProperties( MbProperties &properties ) = 0; // \ru Выдать свойства объекта. \en Get properties of the object. virtual void SetProperties( const MbProperties &properties ) = 0; // \ru Записать свойства объекта. \en Set properties of the object. @@ -215,8 +215,8 @@ public: \en Add to end (true) or add to start (false) \~ \param[in] matr - \ru Матрица преобразования объектов с init в данную поверхность, \en A matrix of transformation of objects from 'init' to the given surface, \~ - \param[in] seam - \ru Кривая другого разделяющего ребра (может быть c3d_null) - \en A curve of another splitting edge (possibly it is c3d_null) \~ + \param[in] seam - \ru Кривая другого разделяющего ребра (может быть nullptr) + \en A curve of another splitting edge (possibly it is nullptr) \~ */ virtual bool SurfacesCombine( const MbSurfaceIntersectionCurve & edge, const MbSurface & init, bool add, MbMatrix & matr, diff --git a/C3d/Include/surf_sphere_surface.h b/C3d/Include/surf_sphere_surface.h index 4f951e1..a9b3504 100644 --- a/C3d/Include/surf_sphere_surface.h +++ b/C3d/Include/surf_sphere_surface.h @@ -109,10 +109,10 @@ public: \en \name Common functions of a geometric object \{ */ virtual MbeSpaceType IsA() const; // \ru Тип элемента. \en A type of element. - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const ; // \ru Сделать копию элемента. \en Create a copy of the element. + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const ; // \ru Сделать копию элемента. \en Create a copy of the element. virtual bool IsSame ( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const; // \ru Равны ли объекты. \en Whether the objects are equal. virtual bool SetEqual ( const MbSpaceItem & ); // \ru Сделать равным. \en Make equal. - virtual void Transform( const MbMatrix3D & matr, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. + virtual void Transform( const MbMatrix3D & matr, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. virtual void GetProperties( MbProperties & properties ); // \ru Выдать свойства объекта. \en Get properties of the object. virtual void SetProperties( const MbProperties & properties ); // \ru Записать свойства объекта. \en Set properties of the object. @@ -217,7 +217,7 @@ public: virtual MbCurve3D * CurveU( double v, MbRect1D * pRgn, bool bApprox = true ) const; // \ru Пространственная копия линии v = const. \en A spatial copy of the line v = const. virtual MbCurve3D * CurveV( double u, MbRect1D * pRgn, bool bApprox = true ) const; // \ru Пространственная копия линии u = const. \en A spatial copy of the line u = const. // \ru Найти все проекции точки на поверхность вдоль вектора в любом из двух направлений. \en Find all a point projection onto the surface along a vector in either of two directions. - virtual void DirectPointProjection( const MbCartPoint3D & p, const MbVector3D & vect, SArray & uv, bool ext, MbRect2D * uvRange = c3d_null ) const; + virtual void DirectPointProjection( const MbCartPoint3D & p, const MbVector3D & vect, SArray & uv, bool ext, MbRect2D * uvRange = nullptr ) const; // \ru Пересечение с кривой. \en Intersection with a curve. virtual void CurveIntersection( const MbCurve3D & curv, SArray & uv, SArray & tt, bool ext0, bool ext, bool touchInclude = false ) const; @@ -269,7 +269,7 @@ public: /** \ru \name Функции элементарных поверхностей \en \name Functions of elementary surfaces. \{ */ - virtual bool GetPointProjection( const MbCartPoint3D & p, bool init, double & u, double & v, bool ext, MbRect2D * uvRange = c3d_null ) const; + virtual bool GetPointProjection( const MbCartPoint3D & p, bool init, double & u, double & v, bool ext, MbRect2D * uvRange = nullptr ) const; /** \} */ /** \ru \name Функции конической поверхности \en \name Functions of conical surface diff --git a/C3d/Include/surf_spine.h b/C3d/Include/surf_spine.h index 1f08158..371ca28 100644 --- a/C3d/Include/surf_spine.h +++ b/C3d/Include/surf_spine.h @@ -55,11 +55,11 @@ public: }; private: - SPtr curve; ///< \ru Направляющая кривая - всегда не c3d_null. \en Spine curve - it is always not c3d_null. + SPtr curve; ///< \ru Направляющая кривая - всегда не nullptr. \en Spine curve - it is always not nullptr. MbVector3D direction; ///< \ru Вектор ориентации матрицы преобразования. \en Vector of transformation matrix orientation. - SPtr optionalCurve; ///< \ru Кривая вектора ориентации матрицы преобразования (может быть c3d_null для простой траектории). \en A curve of the transformation matrix orientation (it may be c3d_null for a simple trajectory). - SPtr spineSurface; ///< \ru Поверхность направляющей кривой, если "curve" - кривая на поверхности, или c3d_null. \en The surface of the "curve", if it is curve on surface, or c3d_null. - SPtr featureCurve; ///< \ru Двумерная кривая, если "curve" - кривая на поверхности, или c3d_null. \en Two-dimensional curve of the "curve", if it is curve on surface, or c3d_null. + SPtr optionalCurve; ///< \ru Кривая вектора ориентации матрицы преобразования (может быть nullptr для простой траектории). \en A curve of the transformation matrix orientation (it may be nullptr for a simple trajectory). + SPtr spineSurface; ///< \ru Поверхность направляющей кривой, если "curve" - кривая на поверхности, или nullptr. \en The surface of the "curve", if it is curve on surface, or nullptr. + SPtr featureCurve; ///< \ru Двумерная кривая, если "curve" - кривая на поверхности, или nullptr. \en Two-dimensional curve of the "curve", if it is curve on surface, or nullptr. LocalAxes localAxes; ///< \ru Способы ориентации локальной системы координат вдоль направляющей кривой "curve". \en Methods of orientation of the local coordinate system along the guide curve "curve". double crossSize; ///< \ru Поперечный масштаб при построении optionalCurve. \en Transverse scale in construction of "optionalCurve". double ortParam; ///< \ru Параметр кривой, для которой рассчитаны ort0, ort1, ort2. \en Parameter of a curve with evaluated ort0, ort1 and ort2. @@ -253,7 +253,7 @@ public: /// \ru Тип элемента. \en A type of element. MbeSpaceType IsA() const { return curve->IsA(); } /// \ru Сделать копию элемента. \en Create a copy of the element. - MbSpine & Duplicate( MbRegDuplicate * = c3d_null ) const; + MbSpine & Duplicate( MbRegDuplicate * = nullptr ) const; /// \ru Сделать равным. \en Make equal. bool SetEqual( const MbSpine & ); /// \ru Являются ли объекты подобными. \en Determine whether the objects are similar. @@ -261,13 +261,13 @@ public: /// \ru Равны ли объекты. \en Whether the objects are equal. bool IsSame ( const MbSpine & other, double accuracy = LENGTH_EPSILON ) const; /// \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. - void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); + void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); /// \ru Сдвиг. \en Translation. - void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); + void Move ( const MbVector3D &, MbRegTransform * = nullptr ); /// \ru Повернуть вокруг оси. \en Rotate around an axis. - void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); + void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); /// \ru Изменить направление. \en Change the direction. - void Inverse( MbRegTransform * iReg = c3d_null ); + void Inverse( MbRegTransform * iReg = nullptr ); /// \ru Сбросить временные данные объекта. \en Reset temporary data of an object. void Reset(); /** \} */ diff --git a/C3d/Include/surf_spiral_surface.h b/C3d/Include/surf_spiral_surface.h index 7c849f0..072c852 100644 --- a/C3d/Include/surf_spiral_surface.h +++ b/C3d/Include/surf_spiral_surface.h @@ -105,13 +105,13 @@ public: \en \name Common functions of a geometric object \{ */ virtual MbeSpaceType IsA() const; // \ru Тип элемента. \en A type of element. - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Сделать копию элемента. \en Create a copy of the element. + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Сделать копию элемента. \en Create a copy of the element. virtual bool IsSame ( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const; // \ru Равны ли объекты. \en Whether the objects are equal. virtual bool SetEqual ( const MbSpaceItem & ); // \ru Сделать равным. \en Make equal. virtual bool IsSimilar( const MbSpaceItem & ) const; // \ru Являются ли объекты подобными. \en Determine whether the objects are similar. - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвиг. \en Translation. - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси. \en Rotate around an axis. + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвиг. \en Translation. + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси. \en Rotate around an axis. virtual void GetProperties( MbProperties & properties ); // \ru Выдать свойства объекта. \en Get properties of the object. virtual void SetProperties( const MbProperties & properties ); // \ru Записать свойства объекта. \en Set properties of the object. @@ -189,10 +189,10 @@ public: virtual MbCurve3D * CurveV( double u, MbRect1D * pRgn, bool bApprox = true ) const; // \ru Пространственная копия линии u = const. \en A spatial copy of the line u = const. // \ru Найти проекцию точки на поверхность. \en Find the projection of a point onto the surface. - virtual bool NearPointProjection ( const MbCartPoint3D & pnt, double & u, double & v, bool ext, MbRect2D * uvRange = c3d_null ) const; + virtual bool NearPointProjection ( const MbCartPoint3D & pnt, double & u, double & v, bool ext, MbRect2D * uvRange = nullptr ) const; // \ru Построить касательные и нормальные плейсменты конструктивных плоскостей. \en Construct tangent and normal placements of constructive planes. - virtual bool CreateNormalPlacements ( const MbVector3D & axisZ, double angle, SArray & places ) const; + virtual bool CreateNormalPlacements ( const MbVector3D & axisZ, double angle, SArray & places, VERSION version = Math::DefaultMathVersion() ) const; virtual bool CreateTangentPlacements( const MbVector3D & axisZ, SArray & places ) const; // \ru Подобные ли поверхности для объединения (слива). \en Whether the surfaces are similar to merge. diff --git a/C3d/Include/surf_spline_surface.h b/C3d/Include/surf_spline_surface.h index 05f4775..ed44128 100644 --- a/C3d/Include/surf_spline_surface.h +++ b/C3d/Include/surf_spline_surface.h @@ -146,7 +146,7 @@ private: DPtr data; ///< \ru Дополнительные данные о поверхности. \en Additional data about a surface. DPtr wdata; ///< \ru Рабочие данные для расчета поверхности. \en Working data for the calculation of a surface. - double * wc; ///< \ru Рассчитанные в точке (uc,vc) значения весов (может быть c3d_null). \en Weights values calculated in the point (uc, vc) (may be c3d_null). + double * wc; ///< \ru Рассчитанные в точке (uc,vc) значения весов (может быть nullptr). \en Weights values calculated in the point (uc, vc) (may be nullptr). MbSplineSurfaceAuxiliaryData(); MbSplineSurfaceAuxiliaryData( const MbSplineSurfaceAuxiliaryData & init ); @@ -350,7 +350,7 @@ public: \en \name Common functions of geometric object. \{ */ virtual MbeSpaceType IsA() const; // \ru Тип элемента. \en A type of element. - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const; // \ru Cделать копию элемента. \en Make a copy of an element. + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const; // \ru Cделать копию элемента. \en Make a copy of an element. virtual bool IsSame ( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const; // \ru Равны ли объекты. \en Whether the objects are equal. virtual bool SetEqual( const MbSpaceItem & ); // \ru Сделать равным. \en Make equal. @@ -500,9 +500,9 @@ public: virtual bool IsPlanar( double accuracy = METRIC_EPSILON ) const; // \ru Является ли поверхность плоской. \en Whether a surface is planar. // \ru Найти ближайшую проекцию точки на поверхность или ее продолжение по заданному начальному приближению. \en Find the neares projection of a point onto the surface. - virtual bool NearPointProjection ( const MbCartPoint3D & pnt, double & u, double & v, bool ext, MbRect2D * uvRange = c3d_null ) const; + virtual bool NearPointProjection ( const MbCartPoint3D & pnt, double & u, double & v, bool ext, MbRect2D * uvRange = nullptr ) const; // \ru Найти все проекции точки на поверхность вдоль вектора в любом из двух направлений. \en Find all a point projection onto the surface along a vector in either of two directions. - virtual void DirectPointProjection( const MbCartPoint3D & pnt, const MbVector3D & vect, SArray & uv, bool ext, MbRect2D * uvRange = c3d_null ) const; + virtual void DirectPointProjection( const MbCartPoint3D & pnt, const MbVector3D & vect, SArray & uv, bool ext, MbRect2D * uvRange = nullptr ) const; // \ru Являются ли узловые векторы равными? \en Are knotVectos equal? bool IsKnotsTheSame( const MbSplineSurface & e, bool sameDir, double precision ) const; @@ -767,8 +767,8 @@ public: \en Create a two-dimensional curve if a space curve is a surface boundary.\n \~ \param[in] curve - \ru Заданная пространственная кривая. \en A given space curve. \~ - \return \ru Ссылка на двумерную кривую на поверхности или c3d_null, если построить ее не удалось. - \en A reference to the two-dimensional curve on a surface or c3d_null if the construction of it is failed. \~ + \return \ru Ссылка на двумерную кривую на поверхности или nullptr, если построить ее не удалось. + \en A reference to the two-dimensional curve on a surface or nullptr if the construction of it is failed. \~ */ MbCurve * IsSplineBorder( const MbCurve3D & curve ) const; @@ -805,7 +805,7 @@ private: double GetKoef( bool isU ) const; // \ru Получить коэффициент пересчета из длины в параметры. \en Get a coefficient of recalculation of the length to the parameters. //--- - // \ru Служебные функции, которые используют заданный кэш (должен быть != c3d_null). \en Service functions that use a given cache (must != c3d_null). + // \ru Служебные функции, которые используют заданный кэш (должен быть != nullptr). \en Service functions that use a given cache (must != nullptr). bool CheckPoles( MbSplineSurfaceAuxiliaryData * ) const; // \ru Проверить наличие полюсов. \en Check poles existence. bool CatchMemory( MbSplineSurfaceAuxiliaryData * ) const; @@ -856,7 +856,7 @@ private: MbSplineSurfaceAuxiliaryData * ) const; //--- - double GetMinStep ( bool isU, const double * pRng = c3d_null ) const; + double GetMinStep ( bool isU, const double * pRng = nullptr ) const; bool ApproxAsPlane() const; // \ru Можно ли аппроксимировать поверхность как плоскость. \en Whether a surface can be approximated by a plane. // \ru Вычислить аппроксимацию поверхности, считая, что ее можно аппроксимировать как плоскость. \en Calculate an approximation of surface assuming that it can be approximated by a plane. diff --git a/C3d/Include/surf_swept_surface.h b/C3d/Include/surf_swept_surface.h index 12d1d33..2d13cb1 100644 --- a/C3d/Include/surf_swept_surface.h +++ b/C3d/Include/surf_swept_surface.h @@ -48,7 +48,7 @@ protected: MbSweptSurface( const MbCurve3D &, bool same ); MbSweptSurface( const MbSweptSurface &, MbRegDuplicate * ); MbSweptSurface() // \ru Используется только в конвертерах. \en This is used only in converters. - : curve( c3d_null ), umin( 0 ), vmin( 0 ), umax( 0 ), vmax( 0 ), uclosed( false ), vclosed( false ) {} + : curve( nullptr ), umin( 0 ), vmin( 0 ), umax( 0 ), vmax( 0 ), uclosed( false ), vclosed( false ) {} private: MbSweptSurface( const MbSweptSurface & ); // \ru Не реализовано. \en Not implemented. @@ -63,12 +63,12 @@ public: \{ */ virtual MbeSpaceType IsA() const = 0; // \ru Тип элемента. \en A type of element. virtual MbeSpaceType Type() const; // \ru Тип элемента. \en A type of element. - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const= 0; // \ru Сделать копию элемента. \en Create a copy of the element. + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const= 0; // \ru Сделать копию элемента. \en Create a copy of the element. virtual bool IsSame ( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const = 0; // \ru Являются ли объекты равными. \en Determine whether objects are equal. virtual bool SetEqual ( const MbSpaceItem & ) = 0; // \ru Сделать равным. \en Make equal. - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ) = 0; // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ) = 0; // \ru Сдвиг. \en Translation. - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ) = 0; // \ru Повернуть вокруг оси. \en Rotate around an axis. + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ) = 0; // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ) = 0; // \ru Сдвиг. \en Translation. + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ) = 0; // \ru Повернуть вокруг оси. \en Rotate around an axis. virtual void GetProperties( MbProperties & properties ) = 0; // \ru Выдать свойства объекта. \en Get properties of the object. virtual void SetProperties( const MbProperties & properties ) = 0; // \ru Записать свойства объекта. \en Set properties of the object. diff --git a/C3d/Include/surf_tessellation.h b/C3d/Include/surf_tessellation.h index 0a47ee7..67dfb40 100644 --- a/C3d/Include/surf_tessellation.h +++ b/C3d/Include/surf_tessellation.h @@ -370,26 +370,26 @@ inline bool MbSurfaceWorkingData::Explore( double u0, double v0, bool ext0, doub bool resUV = false; bool resVV = false; - if ( uuDer == c3d_null ) + if ( uuDer == nullptr ) resUU = true; else if ( ders[sdt_DeriveUU].x != UNDEFINED_DBL ) { uuDer->Init( ders[sdt_DeriveUU] ); resUU = true; } - if ( uvDer == c3d_null ) + if ( uvDer == nullptr ) resUV = true; else if ( ders[sdt_DeriveUV].x != UNDEFINED_DBL ) { uvDer->Init( ders[sdt_DeriveUV] ); resUV = true; } - if ( vvDer == c3d_null ) + if ( vvDer == nullptr ) resVV = true; else if ( ders[sdt_DeriveVV].x != UNDEFINED_DBL ) { vvDer->Init( ders[sdt_DeriveVV] ); resVV = true; } if ( resUU && resUV && resVV ) { - if ( nor == c3d_null ) + if ( nor == nullptr ) res = true; else if ( norm.x != UNDEFINED_DBL ) { nor->Init( norm ); diff --git a/C3d/Include/surf_torus_surface.h b/C3d/Include/surf_torus_surface.h index 4deebd6..b2b013e 100644 --- a/C3d/Include/surf_torus_surface.h +++ b/C3d/Include/surf_torus_surface.h @@ -132,10 +132,10 @@ public: \en \name Common functions of a geometric object \{ */ virtual MbeSpaceType IsA() const; // \ru Тип элемента. \en A type of element. - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const ; // \ru Сделать копию элемента. \en Create a copy of the element. + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const ; // \ru Сделать копию элемента. \en Create a copy of the element. virtual bool IsSame ( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const; // \ru Равны ли объекты. \en Whether the objects are equal. virtual bool SetEqual( const MbSpaceItem & ); // \ru Сделать равным. \en Make equal. - virtual void Transform( const MbMatrix3D & matr, MbRegTransform * = c3d_null ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. + virtual void Transform( const MbMatrix3D & matr, MbRegTransform * = nullptr ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. virtual void GetProperties( MbProperties & properties ); // \ru Выдать свойства объекта. \en Get properties of the object. virtual void SetProperties( const MbProperties & properties ); // \ru Записать свойства объекта. \en Set properties of the object. @@ -233,7 +233,7 @@ public: virtual MbCurve3D * CurveU( double v, MbRect1D * pRgn, bool bApprox = true ) const; // \ru Пространственная копия линии v = const. \en A spatial copy of the line v = const. virtual MbCurve3D * CurveV( double u, MbRect1D * pRgn, bool bApprox = true ) const; // \ru Пространственная копия линии u = const. \en A spatial copy of the line u = const. // \ru Найти все проекции точки на поверхность вдоль вектора в любом из двух направлений. \en Find all a point projection onto the surface along a vector in either of two directions. - virtual void DirectPointProjection( const MbCartPoint3D & p, const MbVector3D & vect, SArray & uv, bool ext, MbRect2D * uvRange = c3d_null ) const; + virtual void DirectPointProjection( const MbCartPoint3D & p, const MbVector3D & vect, SArray & uv, bool ext, MbRect2D * uvRange = nullptr ) const; // \ru Пересечение с кривой. \en Intersection with a curve. virtual void CurveIntersection( const MbCurve3D & curv, SArray & uv, SArray & tt, bool ext0, bool ext, bool touchInclude = false ) const; @@ -284,7 +284,7 @@ public: /** \ru \name Функции элементарных поверхностей \en \name Functions of elementary surfaces. \{ */ - virtual bool GetPointProjection( const MbCartPoint3D & p, bool init, double & u, double & v, bool ext, MbRect2D * uvRange = c3d_null ) const; + virtual bool GetPointProjection( const MbCartPoint3D & p, bool init, double & u, double & v, bool ext, MbRect2D * uvRange = nullptr ) const; /** \} */ /** \ru \name Функции тороидальной поверхности \en \name Functions of toroidal surface diff --git a/C3d/Include/surface.h b/C3d/Include/surface.h index a4223cd..13ee95e 100644 --- a/C3d/Include/surface.h +++ b/C3d/Include/surface.h @@ -118,12 +118,12 @@ public: virtual MbeSpaceType IsA() const = 0; // \ru Тип элемента. \en A type of element. virtual MbeSpaceType Type() const; // \ru Групповой тип элемента. \en Group element type. virtual MbeSpaceType Family() const; // \ru Семейство объекта. \en Family of object. - virtual MbSpaceItem & Duplicate( MbRegDuplicate * = c3d_null ) const = 0; // \ru Сделать копию объекта. \en Create a copy of the object. + virtual MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const = 0; // \ru Сделать копию объекта. \en Create a copy of the object. virtual bool IsSame ( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const = 0; // \ru Являются ли объекты равными. \en Determine whether objects are equal. virtual bool SetEqual ( const MbSpaceItem & ) = 0; // \ru Сделать объекты равным. \en Make objects equal. - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ) = 0; // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ) = 0; // \ru Сдвинуть объект вдоль вектора. \en Move an object along a vector. - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ) = 0; // \ru Повернуть вокруг оси. \en Rotate around an axis. + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ) = 0; // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix. + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ) = 0; // \ru Сдвинуть объект вдоль вектора. \en Move an object along a vector. + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ) = 0; // \ru Повернуть вокруг оси. \en Rotate around an axis. virtual double DistanceToPoint( const MbCartPoint3D & ) const; // \ru Вычислить расстояние до точки. \en Calculate the distance to a point. virtual void AddYourGabaritTo( MbCube & c ) const; // \ru Добавить габарит поверхности в куб. \en Add the surface bounding box into a cube. virtual void Refresh(); // \ru Сбросить все временные данные. \en Reset all temporary data. @@ -407,11 +407,11 @@ public: \param[out] vDer - \ru Производная по v. \en Derivative with respect to v. \~ \param[out] uuDer - \ru Вторая производная по u, если не ноль. - \en Second derivative with respect to u, if not c3d_null. \~ + \en Second derivative with respect to u, if not nullptr. \~ \param[out] vvDer - \ru Вторая производная по v, если не ноль. - \en Second derivative with respect to v, if not c3d_null. \~ + \en Second derivative with respect to v, if not nullptr. \~ \param[out] uvDer - \ru Вторая производная по u и по v, если не ноль. - \en Second derivative with respect to u and v, if not c3d_null. \~ + \en Second derivative with respect to u and v, if not nullptr. \~ \ingroup Surfaces */ virtual void Explore( double & u, double & v, bool ext, @@ -867,8 +867,8 @@ public: \en Parameters of construction in u direction. \~ \param[in] vParam - \ru Параметры построения по направлению v. \en Parameters of construction in v direction. \~ - \result \ru Построенная NURBS поверхность или c3d_null при неуспешном построении. - \en The constructed NURBS surface or c3d_null in a case of failure. \~ + \result \ru Построенная NURBS поверхность или nullptr при неуспешном построении. + \en The constructed NURBS surface or nullptr in a case of failure. \~ */ virtual MbSurface * NurbsSurface( const MbNurbsParameters & uParam, const MbNurbsParameters & vParam ) const; @@ -1159,7 +1159,7 @@ public: \result \ru true - если найдена проекция, удовлетворяющая всем входным условиям. \en True - if there is found a projection which satisfies to all input conditions. \~ */ - virtual bool NearPointProjection( const MbCartPoint3D & pnt, double & u, double & v, bool ext, MbRect2D * uvRange = c3d_null ) const; + virtual bool NearPointProjection( const MbCartPoint3D & pnt, double & u, double & v, bool ext, MbRect2D * uvRange = nullptr ) const; /// \ru Нахождение проекции точки на поверхность в направлении вектора. Для внутреннего использования. \en Finding of point projections to the surface in direction of the vector. For internal use only. virtual MbeNewtonResult DirectPointProjectionNewton( const MbCartPoint3D & p, const MbVector3D & vect, size_t iterLimit, double & u, double & v, double & w, bool ext ) const; @@ -1183,7 +1183,7 @@ public: \param[in] uvRange - \ru Диапазон изменения параметров поверхности, в котором надо найти решение. \en A range of surface parameters changing in which the solution should be found. \~ */ - virtual void DirectPointProjection( const MbCartPoint3D & pnt, const MbVector3D & vect, SArray & uv, bool ext, MbRect2D * uvRange = c3d_null ) const; + virtual void DirectPointProjection( const MbCartPoint3D & pnt, const MbVector3D & vect, SArray & uv, bool ext, MbRect2D * uvRange = nullptr ) const; /** \brief \ru Найти ближайшую проекцию точки на поверхность в направлении вектора. \en Find the nearest point projection to the surface in the vector direction. \~ @@ -1209,7 +1209,7 @@ public: \en True - if there is found a projection which satisfies to all input conditions. \~ */ virtual bool NearDirectPointProjection( const MbCartPoint3D & pnt, const MbVector3D & vect, double & u, double & v, bool ext, - MbRect2D * uvRange = c3d_null, bool onlyPositiveDirection = false ) const; + MbRect2D * uvRange = nullptr, bool onlyPositiveDirection = false ) const; /// \ru Решение системы уравнений для определения пересечения поверхности и кривой. Для внутреннего использования. \en Solution of equation system for determination of intersections between a surface and a curve. For internal use only. virtual MbeNewtonResult CurveIntersectNewton( const MbCurve3D & curv1, double funcEpsilon, size_t iterLimit, double & u0, double & v0, double & t1, bool ext0, bool ext1 ) const; @@ -1372,7 +1372,7 @@ public: virtual double DistanceToSurface( const MbSurface & surf1, double & u0, double & v0, double & u1, double & v1 ) const; /// \ru Построить нормальные плейсменты конструктивных плоскостей. \en Construct normal placements of constructive planes. - virtual bool CreateNormalPlacements ( const MbVector3D & axisZ, double angle, SArray & places ) const; + virtual bool CreateNormalPlacements ( const MbVector3D & axisZ, double angle, SArray & places, VERSION version = Math::DefaultMathVersion() ) const; /// \ru Построить касательные плейсменты конструктивных плоскостей. \en Construct tangent placements of constructive planes. virtual bool CreateTangentPlacements( const MbVector3D & axisZ, SArray & places ) const; /// \ru Построить касательные плейсменты конструктивных плоскостей. Для внутреннего использования. \en Construct tangent placements of constructive planes. For internal use only. @@ -1453,7 +1453,7 @@ public: \param[in] s - \ru Поверхность-копия. \en A surface-copy. \~ */ - void CopyGabarit( const MbSurface & s, const MbVector3D * to = c3d_null ) { cube = s.cube; if ( (to != c3d_null) && !cube.IsEmpty() ) { cube.Move( *to ); } } + void CopyGabarit( const MbSurface & s, const MbVector3D * to = nullptr ) { cube = s.cube; if ( (to != nullptr) && !cube.IsEmpty() ) { cube.Move( *to ); } } /// \ru Вычислить диагональ габаритного куба. \en Calculate the diagonal of the bounding box. double GetGabDiagonal() const { if ( cube.IsEmpty() ) { MbCube tmp; CalculateGabarit( tmp ); } return cube.GetDiagonal(); } @@ -1733,7 +1733,7 @@ public: bool GetControlPlacement( MbPlacement3D & place, bool sameSense = true ) const; /// \ru Сориентировать ось Х плейсмента вдоль линии его пересечения с поверхностью. \en Orient an axis X of a placement along the line of its intersection with surface. bool OrientPlacement ( MbPlacement3D & place, bool normalSense = true ) const; - /// \ru Определить, лежит ли точка на плоскости. \en Determine whether a point is located on a surface or not. + /// \ru Определить, лежит ли точка на поверхности. \en Determine whether a point is located on a surface or not. bool IsPointOn ( const MbCartPoint3D &, double eps = METRIC_PRECISION ) const; /// \ru Вычислить точку на поверхности в области определения поверхности. \en Calculate the point on a surface inside the domain of surface. void PointOn ( MbCartPoint & uv, MbCartPoint3D & p ) const; diff --git a/C3d/Include/system_atomic.h b/C3d/Include/system_atomic.h index a5f6ea0..be19cd7 100644 --- a/C3d/Include/system_atomic.h +++ b/C3d/Include/system_atomic.h @@ -22,14 +22,6 @@ // //--- -#ifdef C3D_STANDARD_CXX_11_PARTIAL - #ifndef _NOT_USE_ATOMIC - #define C3D_USE_CXX11_ATOMIC - #endif -#endif - -#ifdef C3D_USE_CXX11_ATOMIC - #include typedef std::atomic_ptrdiff_t use_count_type; ///< \ru Потокобезопасный тип счётчика ссылок. \en Thread-safe references count type. @@ -111,170 +103,5 @@ public: Type operator()() const { return static_cast( m_value.load() ); } }; -#else - -//------------------------------------------------------------------------------ -// \ru Шаблонный класс, работающий с целочисленными типами данных. Базовый класс для потокобезопасных счётчиков. -// \en Template class working with integer data types. Base class for thread-safe counters. -//-- -template< class Type > -class atomic_itype -{ -protected: - CommonMutex m_lock; - Type m_value; -public: - atomic_itype() {} - atomic_itype( const atomic_itype & t ) : m_value( t.m_value ) {} - atomic_itype( const Type & t ) : m_value( t ) {} - - // \ru Операторы присваивания. \en Assignment operators. - atomic_itype & operator = ( const atomic_itype & t ) { ScopedLock l( &m_lock ); m_value = t.m_value; return *this; } - atomic_itype & operator = ( Type t ) { ScopedLock l( &m_lock ); m_value = t; return *this; } - - // \ru Операторы инкремента и декремента. \en Increment and decrement operators. - atomic_itype & operator ++ () { ScopedLock l( &m_lock ); ++m_value; return *this; } // prefix ++ - atomic_itype & operator -- () { ScopedLock l( &m_lock ); --m_value; return *this; } // prefix -- - Type operator ++ ( int ) { // postfix ++ - Type t = m_value; - { - ScopedLock l( &m_lock ); - ++m_value; - } - return t; - } - Type operator -- ( int ) { // postfix -- - Type t = m_value; - { - ScopedLock l( &m_lock ); - --m_value; - } - return t; - } - - // \ru Операторы сравнения. \en Comparison operators. - bool operator == ( const atomic_itype & t ) const { return m_value == t.m_value; } - bool operator != ( const atomic_itype & t ) const { return m_value != t.m_value; } - bool operator < ( const atomic_itype & t ) const { return m_value < t.m_value; } - bool operator > ( const atomic_itype & t ) const { return m_value > t.m_value; } - bool operator <= ( const atomic_itype & t ) const { return m_value <= t.m_value; } - bool operator >= ( const atomic_itype & t ) const { return m_value >= t.m_value; } - - // \ru Доступ к данным. \en Data access. - Type operator()() const { return m_value; } - -}; - -//------------------------------------------------------------------------------ -// \ru Потокобезопасный логический тип. \en Thread-safe boolean type. -//-- -class atomic_bool : public atomic_itype -{ -public: - atomic_bool() {} - - atomic_bool( const atomic_bool & t ) : atomic_itype( t.m_value ) {} - atomic_bool( const bool t ) : atomic_itype( t ? 1 : 0 ) {} - atomic_bool( const int t ) : atomic_itype( t != 0 ? 1 : 0 ) {} - - // \ru Операторы присваивания. \en Assignment operators. - atomic_bool & operator = ( const atomic_bool & t ) { ScopedLock l( &m_lock ); m_value = t.m_value; return *this; } - atomic_bool & operator = ( bool t ) { ScopedLock l( &m_lock ); m_value = t ? 1 : 0; return *this; } - atomic_bool & operator = ( int t ) { ScopedLock l( &m_lock ); m_value = t != 0 ? 1 : 0; return *this; } - - bool operator && ( bool t ) { return t == !!m_value; } - bool operator || ( bool t ) { return t || !!m_value; } - - // \ru Доступ к данным. \en Data access. - bool operator()() const { return !!m_value; } - -private: - // \ru Операторы инкремента и декремента не разрешены. \en Increment and decrement operators not allowed. - atomic_bool & operator ++ (); - atomic_bool & operator -- (); - bool operator ++ ( int ); - bool operator -- ( int ); -}; - -typedef atomic_itype serial_type; // \ru Потокобезопасный тип счётчика ссылок. \en Thread-safe references count type. -typedef atomic_itype use_count_type; // \ru Потокобезопасный тип счётчика ссылок. \en Thread-safe references count type. -typedef atomic_itype flag_type; ///< \ru Потокобезопасный тип флага. \en Thread-safe flag type. - -//------------------------------------------------------------------------------ -/** \ru Получить значение. \en Get value. -*/ -//--- -template -Type LoadTypeValue( const AtomicType & v ) { - return v(); -} - -//------------------------------------------------------------------------------ -/** \ru Установить значение. \en Get value. -*/ -//--- -template -void StoreTypeValue( const AtomicType & src, AtomicType & dst ) { - dst = src; -} - -//------------------------------------------------------------------------------ -/** \ru Установить значение. \en Get value. -*/ -//--- -template -void StoreTypeValue( const Type src, AtomicType & dst ) { - dst = src; -} - -//------------------------------------------------------------------------------ -/** \ru Получить значение. \en Get value. -*/ -//--- -inline size_t SerialTypeValue( const serial_type & v ) { - return v(); -} -inline ptrdiff_t UseCountValue( const use_count_type & v ) { - return v(); -} - -//------------------------------------------------------------------------------ -// \ru Шаблонный класс для перечислений (Type - тип перечисления). -// \en Template class for enums (Type - a type of enum). -//-- -template< class Type > -class atomic_enum_type : public atomic_itype -{ -public: - atomic_enum_type() : atomic_itype() {} - atomic_enum_type( Type & val ) : atomic_itype( val ) {} - atomic_enum_type( const Type & val ) : atomic_itype( val ) {} - atomic_enum_type( const atomic_enum_type & val ) : atomic_itype( val.m_value ) {} - atomic_enum_type( atomic_enum_type & val ) : atomic_itype( val.m_value ) {} - - // \ru Операторы присваивания. \en Assignment operators. - atomic_enum_type & operator = ( const atomic_enum_type & t ) { ScopedLock l( &m_lock ); m_value = t.m_value; return *this; } - atomic_enum_type & operator = ( const Type & t ) { ScopedLock l( &m_lock ); m_value = t; return *this; } - - // \ru Операторы сравнения. \en Comparison operators. - bool operator == ( const atomic_enum_type & t ) const { return m_value == t.m_value; } - bool operator == ( const Type & t ) const { return m_value == t; } - bool operator != ( const atomic_enum_type & t ) const { return m_value != t.m_value; } - bool operator != ( const Type & t ) const { return m_value != t; } - bool operator < ( const atomic_enum_type & t ) const { return m_value < t.m_value; } - bool operator < ( Type t ) const { return m_value < t; } - bool operator > ( const atomic_enum_type & t ) const { return m_value > t.m_value; } - bool operator > ( const Type & t ) const { return m_value > t; } - bool operator <= ( const atomic_enum_type & t ) const { return m_value <= t.m_value; } - bool operator <= ( const Type & t ) const { return m_value <= t; } - bool operator >= ( const atomic_enum_type & t ) const { return m_value >= t.m_value; } - bool operator >= ( const Type & t ) const { return m_value >= t; } - - // \ru Доступ к данным. \en Data access. - Type operator()() const { return static_cast( m_value ); } -}; - -#endif // C3D_USE_CXX11_ATOMIC - #endif // __SYSTEM_ATOMIC_H diff --git a/C3d/Include/system_cpp_standard.h b/C3d/Include/system_cpp_standard.h index 434d3c2..c747530 100644 --- a/C3d/Include/system_cpp_standard.h +++ b/C3d/Include/system_cpp_standard.h @@ -99,10 +99,6 @@ #define C3D_STANDARD_CXX_11 #endif -#if defined(C3D_STANDARD_CXX_11) || ((defined(_MSC_VER) && (_MSC_VER > 1600)) && C3D_STANDARD_CXX_LIMIT >= 2011) - #define C3D_STANDARD_CXX_11_PARTIAL -#endif - #if C3D_STANDARD_CXX_LIMIT >= 2014 && C3D_STANDARD_CXX >= 2014 #define C3D_STANDARD_CXX_14 #endif @@ -151,15 +147,6 @@ // C++ standard dependent syntax. ////////////////////////////////////////////////////////////////////////////////////////// -//------------------------------------------------------------------------------ -/// \ru Обертка для override. \en Wrapper for override. -//--- -#if defined(C3D_STANDARD_CXX_11_PARTIAL) - #define c3d_override override -#else - #define c3d_override -#endif - //------------------------------------------------------------------------------ /// \ru Обертка для constexpr. \en Wrapper for constexpr. //--- @@ -169,27 +156,6 @@ #define c3d_constexpr const #endif // C3D_STANDARD_CXX_11 -//------------------------------------------------------------------------------ -// \ru Нулевой указатель. \en Null pointer. -//--- -#ifdef C3D_STANDARD_CXX_11_PARTIAL - #define c3d_null nullptr -#else - #if !defined(NULL) - #define NULL 0 - #endif - #define c3d_null NULL -#endif // C3D_STANDARD_CXX_11_PARTIAL - -//------------------------------------------------------------------------------ -// \ru Обертка для final. \en Wrapper for final. -//--- -#ifdef C3D_STANDARD_CXX_11 - #define c3d_final final -#else - #define c3d_final -#endif // C3D_STANDARD_CXX_11 - //------------------------------------------------------------------------------ // \ru Спецификатор для потоко-зависимого хранения данных. \en Specifier for thread-depended storage duration. //--- diff --git a/C3d/Include/system_dependency.h b/C3d/Include/system_dependency.h index c5c227e..0191f8a 100644 --- a/C3d/Include/system_dependency.h +++ b/C3d/Include/system_dependency.h @@ -100,11 +100,9 @@ inline uint8 GetBValue(COLORREF rgb_color) #include -#ifdef C3D_STANDARD_CXX_11_PARTIAL - #include - // #error is not supported when compiling with /clr or /clr:pure. - // #include -#endif +#include +// #error is not supported when compiling with /clr or /clr:pure. +// #include #ifndef threadLocal # if (__STDC_VERSION__ >= 201112) && !defined(__STDC_NO_THREADS__) @@ -134,15 +132,11 @@ inline uint8 GetBValue(COLORREF rgb_color) */ // --- class MbAccurateTimer { -#ifdef C3D_STANDARD_CXX_11_PARTIAL - typedef std::chrono::high_resolution_clock::time_point TimePoint; -#endif +typedef std::chrono::high_resolution_clock::time_point TimePoint; protected: double lastTime; ///< \ru Время в секундах. \en Time in seconds. private: -#ifdef C3D_STANDARD_CXX_11_PARTIAL TimePoint begTime; ///< \ru Засечка времени. \en Time stamp. -#endif public: /// \ru Конструктор. \en Constructor. @@ -171,9 +165,7 @@ public: //--- inline void MbAccurateTimer::Begin() { -#ifdef C3D_STANDARD_CXX_11_PARTIAL begTime = std::chrono::high_resolution_clock::now(); -#endif } //------------------------------------------------------------------------------ @@ -181,11 +173,9 @@ inline void MbAccurateTimer::Begin() // --- inline void MbAccurateTimer::End() { -#ifdef C3D_STANDARD_CXX_11_PARTIAL TimePoint endTime = std::chrono::high_resolution_clock::now(); double t = std::chrono::duration_cast< std::chrono::duration >(endTime - begTime).count(); SetTime( t ); -#endif } diff --git a/C3d/Include/system_types.h b/C3d/Include/system_types.h index 64dad0e..4b489bd 100644 --- a/C3d/Include/system_types.h +++ b/C3d/Include/system_types.h @@ -74,36 +74,6 @@ typedef uint32 VERSION; ///< \ru Версия. \en Version. \~ #include -//------------------------------------------------------------------------------ -// \ru Умный указатель, единолично владеющий объектом. -// \en Smart pointer that solely owns the object. -//--- -#ifdef C3D_STANDARD_CXX_11_PARTIAL - #define std_unique_ptr std::unique_ptr -#else - #define std_unique_ptr std::auto_ptr -#endif - -//------------------------------------------------------------------------------ -// \ru Умный указатель, обеспечивающий совместное владение объектом. -// \en Smart pointer that retains shared ownership of an object. -//--- -#define std_shared_ptr std::shared_ptr - -//------------------------------------------------------------------------------ -// \ru Шаблон функции, генерирующей обертку для объекта функции-члена. -// \en Template function generating a member function wrapper object. -//--- -#ifdef C3D_STANDARD_CXX_11_PARTIAL -// \ru Замена работает в большинстве случаев (в остальных случаях требуется напрямую использовать шаблоны STL). -// \en The replacement works in most cases (in the rest cases you need to use STL templates directly). - #define c3d_mem_fun std::mem_fn - #define c3d_mem_fun_ref std::mem_fn -#else - #define c3d_mem_fun std::mem_fun - #define c3d_mem_fun_ref std::mem_fun_ref -#endif - //------------------------------------------------------------------------------ // \ru Системные лимиты \en System limits //--- diff --git a/C3d/Include/templ_array2.h b/C3d/Include/templ_array2.h index 3c394ff..d3f1857 100644 --- a/C3d/Include/templ_array2.h +++ b/C3d/Include/templ_array2.h @@ -65,8 +65,8 @@ public: ~Array2() { set_array_size( *this, 0, 0 ); } public: - /// \ru Создать массив заданной размерности (возвращает c3d_null в случае неудачи). - /// \en Create an array of a given dimension (returns c3d_null in case of failure). + /// \ru Создать массив заданной размерности (возвращает nullptr в случае неудачи). + /// \en Create an array of a given dimension (returns nullptr in case of failure). static Array2 * Create( size_t lSize, size_t cSize ); public: // Общие методы матриц (двумерных массивов) @@ -221,13 +221,13 @@ inline Array2::Array2( const Array2 & source ) template inline Array2 * Array2::Create( size_t lSize, size_t cSize ) { - Array2 * arr = c3d_null; + Array2 * arr = nullptr; if ( lSize * cSize < c3d::MATRIX_MAX_COUNT ) { try { arr = new Array2( lSize, cSize ); } catch ( const std::bad_alloc & ) { - arr = c3d_null; + arr = nullptr; } } return arr; @@ -285,7 +285,7 @@ const Type * Array2::GetLine( size_t i ) const { PRECONDITION( i < l ); if ( i < l ) return parr[i]; - return c3d_null; + return nullptr; } //------------------------------------------------------------------------------ @@ -296,7 +296,7 @@ Type * Array2::SetLine( size_t i ) { PRECONDITION( i < l ); if ( i < l ) return parr[i]; - return c3d_null; + return nullptr; } //------------------------------------------------------------------------------ @@ -468,7 +468,7 @@ inline bool Array2::CatchLinePointers( size_t newCount ) } catch ( ... ) { if ( newCount == 0 ) {// \ru Не смогли удалить parr. \en Failed to delete parr. - parr = c3d_null; + parr = nullptr; l = c = 0; } C3D_CONTROLED_THROW; @@ -529,7 +529,7 @@ inline bool realloc_line( Type *& line, size_t oldSize, size_t newSize ) } catch ( ... ) { if ( newSize == 0 )// \ru Не смогли удалить line. \en Failed to delete line. - line = c3d_null; + line = nullptr; C3D_CONTROLED_THROW; return false; } @@ -602,7 +602,7 @@ bool set_array_size( Array2 & arr, size_t lSize, size_t cSize ) else if ( arr.l > oldL && arr.c > 0 ) { // \ru BUG_46010 KYA K12 А кто будет выделять память для новых строк \en BUG_46010 KYA K12 And who will allocate memory for new rows Type * newLine = 0; // \ru указатель на содержимое новой строки \en pointer to contents of new row for ( i = oldL; res && i < arr.l; i++ ) { - newLine = c3d_null; + newLine = nullptr; res = ::realloc_line( newLine, 0, arr.c ); // \ru захватить память под строку \en allocate memory for one row if ( res ) { ::memset( newLine, 0, arr.c * sizeof(Type) ); diff --git a/C3d/Include/templ_balance_tree.h b/C3d/Include/templ_balance_tree.h index 1615c67..0a697a2 100644 --- a/C3d/Include/templ_balance_tree.h +++ b/C3d/Include/templ_balance_tree.h @@ -120,7 +120,7 @@ static size_t countIsSame; ///< \ru Число сравнений (для от public: /// \ru Конструктор. \en Constructor. - BalanceTree( Compare_t c_t = SimplePointCompFuncT, Compare_v c_v = c3d_null/*SimplePointCompFuncV*/, + BalanceTree( Compare_t c_t = SimplePointCompFuncT, Compare_v c_v = nullptr/*SimplePointCompFuncV*/, bool shouldDelete = true ); /// \ru Деструктор. \en Destructor. virtual ~BalanceTree(); @@ -204,7 +204,7 @@ public: BalanceTreeNode * node_m; PPNodeType typeRAB_m; public: - PPNode( BalanceTreeNode * node = c3d_null, PPNodeType t = iRoot ) + PPNode( BalanceTreeNode * node = nullptr, PPNodeType t = iRoot ) : node_m(node) , typeRAB_m(t) {} @@ -321,8 +321,8 @@ inline void BalanceTreeNode::operator delete ( void * ptr, size_t size ) { template inline BalanceTreeNode::BalanceTreeNode( BalanceTree & parent, Type * content ) : parent_m ( parent ), - left_m ( c3d_null ), - right_m ( c3d_null ), + left_m ( nullptr ), + right_m ( nullptr ), // \ru КВН K8+ count_m ( 0 ), \en КВН K8+ count_m ( 0 ), balance_m ( ts_neutral ), content_m ( content ) @@ -367,7 +367,7 @@ inline void BalanceTreeNode::SetRight( BalanceTreeNode * p ){ // --- template inline BalanceTree::BalanceTree( Compare_t c_t, Compare_v c_v, bool shouldDelete ) : - root_m ( c3d_null ), + root_m ( nullptr ), allCount_m ( 0 ), owns_m ( shouldDelete ), isBranchGrew_m( false ), @@ -418,7 +418,7 @@ inline void BalanceTree::Flush( DelType del ) { if( root_m ) { destroy_tree_node( *root_m, del ); delete root_m; - root_m = c3d_null; + root_m = nullptr; } allCount_m = 0; @@ -464,7 +464,7 @@ inline bool BalanceTree::FindIt ( const Type * content ) const { #endif // C3D_DEBUG - Type * t = compT_m ? find_tree( *this, (void *)content, true/*compT*/ ) : c3d_null; + Type * t = compT_m ? find_tree( *this, (void *)content, true/*compT*/ ) : nullptr; return !!t; } @@ -479,7 +479,7 @@ inline Type * BalanceTree::Find ( void * content ) const { countIsSame = 0; #endif // C3D_DEBUG - return compV_m ? find_tree( *this, content, false/*compT*/ ) : c3d_null; + return compV_m ? find_tree( *this, content, false/*compT*/ ) : nullptr; } @@ -579,8 +579,8 @@ inline bool BalanceTree::AddToBalanceTree( Type & content, BalanceTreeNod case ts_neutral : node->balance_m = ts_negative; break; // \ru балансировка \en balancing case ts_negative : { - BalanceTreeNode * p1 = c3d_null; - BalanceTreeNode * p2 = c3d_null; + BalanceTreeNode * p1 = nullptr; + BalanceTreeNode * p2 = nullptr; p1 = node->left_m; if ( p1 ){ if ( p1->balance_m == ts_negative ) { // \ru однократный LL поворот \en single LL rotation @@ -612,8 +612,8 @@ inline bool BalanceTree::AddToBalanceTree( Type & content, BalanceTreeNod case ts_neutral : node->balance_m = ts_positive; break; // \ru балансировка \en balancing case ts_positive : { - BalanceTreeNode * p1 = c3d_null; - BalanceTreeNode * p2 = c3d_null; + BalanceTreeNode * p1 = nullptr; + BalanceTreeNode * p2 = nullptr; p1 = node->right_m; if ( p1 ) { if ( p1->balance_m == ts_positive ) { // \ru однократный RR поворот \en single RR rotation @@ -652,8 +652,8 @@ inline void BalanceTree::BalanceL( BalanceTreeNode *& node, bool & case ts_neutral : node->balance_m = ts_positive; isBranchGrew = false; break; // \ru балансировка \en balancing case ts_positive : { - BalanceTreeNode * p1 = c3d_null; - BalanceTreeNode * p2 = c3d_null; + BalanceTreeNode * p1 = nullptr; + BalanceTreeNode * p2 = nullptr; p1 = node->right_m; if ( p1 ) { if ( p1->balance_m >= ts_neutral ) { // \ru однократный RR поворот \en single RR rotation @@ -691,8 +691,8 @@ inline void BalanceTree::BalanceR( BalanceTreeNode *& node, bool & case ts_neutral : node->balance_m = ts_negative; isBranchGrew = false; break; // \ru балансировка \en balancing case ts_negative : { - BalanceTreeNode * p1 = c3d_null; - BalanceTreeNode * p2 = c3d_null; + BalanceTreeNode * p1 = nullptr; + BalanceTreeNode * p2 = nullptr; p1 = node->left_m; if ( p1 ) { if ( p1->balance_m <= ts_neutral ) { // \ru однократный LL поворот \en single LL rotation @@ -791,8 +791,8 @@ inline bool BalanceTree::DeleteFromBalanceTree( Type & content, BalanceTr } bool oldowns = owns_m; owns_m = del == Delete ? true : del == noDelete ? false : owns_m; - q->left_m = c3d_null; - q->right_m = c3d_null; + q->left_m = nullptr; + q->right_m = nullptr; delete q; owns_m = oldowns; allCount_m--; // \ru подсчитываем общее кол-во узлов \en compute the total count of nodes @@ -813,14 +813,14 @@ template void destroy_tree_node( BalanceTreeNode& treeNode, DelType del ) { delete treeNode.left_m; - treeNode.left_m = c3d_null; + treeNode.left_m = nullptr; delete treeNode.right_m; - treeNode.right_m = c3d_null; + treeNode.right_m = nullptr; bool shouldDelete = del == Delete || ( del == defDelete && treeNode.parent_m.owns_m ); if ( shouldDelete ) { delete treeNode.content_m; - treeNode.content_m = c3d_null; + treeNode.content_m = nullptr; } } @@ -830,7 +830,7 @@ void destroy_tree_node( BalanceTreeNode& treeNode, DelType del ) { // --- template Type * find_tree( const BalanceTree& tree, void * content, bool compT ) { - Type * res = c3d_null; + Type * res = nullptr; const BalanceTreeNode * node = tree.root_m; if ( node ) { ThreeStates compRres = ts_negative; @@ -881,7 +881,7 @@ inline void BalanceTreeIterator::Restart( IteratorType t ) { // --- template inline Type * BalanceTreeIterator::operator ++(int) { - Type * res = m_CurNode ? m_CurNode->content_m : c3d_null; + Type * res = m_CurNode ? m_CurNode->content_m : nullptr; if ( m_CurNode ) Iterate( m_CurNode ); @@ -894,7 +894,7 @@ inline Type * BalanceTreeIterator::operator ++(int) { // --- template inline BalanceTreeIterator::operator Type * () const { - return m_CurNode ? m_CurNode->content_m : c3d_null; + return m_CurNode ? m_CurNode->content_m : nullptr; } @@ -1016,10 +1016,10 @@ inline void BalanceTreeIterator::Iterate( BalanceTreeNode * node ) { Iterate( m_CurNode ); } else - m_CurNode = c3d_null; + m_CurNode = nullptr; } else - m_CurNode = c3d_null; + m_CurNode = nullptr; fRepeat = false; break; } diff --git a/C3d/Include/templ_c_array.h b/C3d/Include/templ_c_array.h index 2410768..246854d 100644 --- a/C3d/Include/templ_c_array.h +++ b/C3d/Include/templ_c_array.h @@ -66,7 +66,7 @@ public : /// \ru Оператор доступа. \en An access operator. Type & operator []( size_t idx ) const { PRECONDITION( idx < count ); return parr[idx]; } // SKIP_SA /// \ru Выделена ли память? \en Is memory allocated? - bool IsNull () const { return parr == c3d_null; } + bool IsNull () const { return parr == nullptr; } /// \ru Выдать адрес начала массива. \en Get address of the beginning of an array. const Type * GetAddr() const { return parr; } @@ -125,7 +125,7 @@ inline CcArray::CcArray( size_t _count ) template inline void CcArray::Copy( const void * from, size_t cnt, size_t offset ) { - PRECONDITION( (offset + cnt <= count) && (cnt ? from != c3d_null : true) ); + PRECONDITION( (offset + cnt <= count) && (cnt ? from != nullptr : true) ); memcpy( parr + offset, from, cnt * sizeof(Type) ); // SKIP_SA } @@ -147,12 +147,12 @@ inline bool CcArray::SetArraySize( size_t newCount ) #endif #ifdef USE_REALLOC_IN_ARRAYS - if ( parr != c3d_null || newCount != 0 ) { - // \ru показывает утечки памяти, если parr==c3d_null и newCount==0 \en Memory leaks happen if parr==c3d_null and newCount==0 + if ( parr != nullptr || newCount != 0 ) { + // \ru показывает утечки памяти, если parr==nullptr и newCount==0 \en Memory leaks happen if parr==nullptr and newCount==0 parr = static_cast( REALLOC_ARRAY_SIZE(parr, newCount * sizeof(Type), true/*clear*/) ); } #else - Type * p_tmp = newCount ? new Type[newCount] : c3d_null; + Type * p_tmp = newCount ? new Type[newCount] : nullptr; delete[] parr; // \ru Удалять parr, если оператор new выполнился успешно. \en Delete parr if operator new is succeeded. parr = p_tmp; @@ -171,7 +171,7 @@ inline bool CcArray::SetArraySize( size_t newCount ) } catch ( ... ) { if ( newCount == 0 )// \ru Не смогли удалить parr. \en Failed to delete parr. - parr = c3d_null; + parr = nullptr; C3D_CONTROLED_THROW; return false; } diff --git a/C3d/Include/templ_csp_array.h b/C3d/Include/templ_csp_array.h index a123902..9cf6f86 100644 --- a/C3d/Include/templ_csp_array.h +++ b/C3d/Include/templ_csp_array.h @@ -49,7 +49,7 @@ private: public: /// \ru Конструктор. \en Constructor. - CSPArray( size_t maxCnt = 0, uint16 delt = 1, bool shouldDelete = true, bool _keepEq = false, LessFuncPtr func = c3d_null ) + CSPArray( size_t maxCnt = 0, uint16 delt = 1, bool shouldDelete = true, bool _keepEq = false, LessFuncPtr func = nullptr ) : SPArray( maxCnt, delt, shouldDelete ) , m_sort( true ) , m_keepEq( _keepEq ) @@ -181,9 +181,9 @@ inline void CSPArray::Sort( LessFuncPtr lessFunc ) template inline Type * CSPArray::RemoveObj( Type * delObject, DelType del ) { - C3D_ASSERT( SPArray::nowDeletedElem == c3d_null ); // \ru Bременно, для отладки \en Temporarily, for debugging. + C3D_ASSERT( SPArray::nowDeletedElem == nullptr ); // \ru Bременно, для отладки \en Temporarily, for debugging. size_t i = Find( delObject ); - return ( i != SYS_MAX_T ) ? RemoveInd(i, del) : c3d_null; + return ( i != SYS_MAX_T ) ? RemoveInd(i, del) : nullptr; } @@ -248,7 +248,7 @@ void qp_sort_r2( Type ** arr, size_t minIndex, size_t maxIndex ) ptrdiff_t minInd = minIndex, maxInd = maxIndex; ptrdiff_t i = minInd, j = maxInd; ptrdiff_t im = 0; - Type *middle = c3d_null; + Type *middle = nullptr; for ( ;; ) { i = minInd, j = maxInd; diff --git a/C3d/Include/templ_css_array.h b/C3d/Include/templ_css_array.h index b6c7c74..d785a5b 100644 --- a/C3d/Include/templ_css_array.h +++ b/C3d/Include/templ_css_array.h @@ -53,14 +53,14 @@ public: , m_sort( other.m_sort ) {} /// \ru Конструктор копирования. \en Copy constructor. - CSSArray( const SArray & other, SArray * del = c3d_null ) + CSSArray( const SArray & other, SArray * del = nullptr ) : SSArray( other ) , m_sort( false ) { ::q_sort( *this, del ); } /// \ru Конструктор копирования. \en Copy constructor. - CSSArray( const SArray< std::pair > & other, bool addFirst, SArray * del = c3d_null ) + CSSArray( const SArray< std::pair > & other, bool addFirst, SArray * del = nullptr ) : SSArray( other.Count(), 1 ) , m_sort( false ) { @@ -100,7 +100,7 @@ public: Type * Add ( const Type & ); ///< \ru Добавить элемент с упорядочиванием по массиву. \en Add element with sorting. Type * Add ( const Type &, size_t & indexEnt ); ///< \ru Добавить элемент с упорядочиванием по массиву, возвращает индекс. \en Add element with sorting by array, returns index of the element. size_t Find( const Type & ); ///< \ru Найти элемент в упорядоченном массиве. \en Find an element in ordered array. - void Sort( SArray * del = c3d_null ); ///< \ru Выполнить сортировку элементов массива. \en Sort elements of array. + void Sort( SArray * del = nullptr ); ///< \ru Выполнить сортировку элементов массива. \en Sort elements of array. size_t RemoveObj( const Type & delObject ); ///< \ru Удалить элемент из массива. \en Delete an element from array. void SetNoSort() { m_sort = false; } ///< \ru Сбросить флаг сортированности. \en Reset the flag of being sorted. @@ -121,7 +121,7 @@ public: // --- template inline Type * CSSArray::Add( const Type & el ) { - ::q_sort( *this, (SArray *)c3d_null ); + ::q_sort( *this, (SArray *)nullptr ); return SSArray::Add( el ); } @@ -131,7 +131,7 @@ inline Type * CSSArray::Add( const Type & el ) { // --- template inline Type * CSSArray::Add( const Type & el, size_t & indexEl ) { - ::q_sort( *this, (SArray *)c3d_null ); + ::q_sort( *this, (SArray *)nullptr ); return SSArray::Add( el, indexEl ); } @@ -146,7 +146,7 @@ inline void CSSArray::AddArray( const CSSArray & arr, bool doSort ) m_sort = false; (*this) += arr; if ( doSort ) - ::q_sort( *this, (SArray *)c3d_null ); + ::q_sort( *this, (SArray *)nullptr ); } } @@ -161,7 +161,7 @@ inline void CSSArray::AddArray( const SArray & arr, bool doSort ) m_sort = false; (*this) += arr; if ( doSort ) - ::q_sort( *this, (SArray *)c3d_null ); + ::q_sort( *this, (SArray *)nullptr ); } } @@ -171,7 +171,7 @@ inline void CSSArray::AddArray( const SArray & arr, bool doSort ) // --- template inline size_t CSSArray::Find( const Type & el ) { - ::q_sort( *this, (SArray *)c3d_null ); + ::q_sort( *this, (SArray *)nullptr ); return SSArray::Find( el ); } diff --git a/C3d/Include/templ_dptr.h b/C3d/Include/templ_dptr.h index 16335e4..f85b781 100644 --- a/C3d/Include/templ_dptr.h +++ b/C3d/Include/templ_dptr.h @@ -25,7 +25,7 @@ template class DPtr { public: /// \ru Конструктор по умолчанию. \en Default constructor. - DPtr() : m_Ptr ( c3d_null ), m_Owner( c3d_null ) {} + DPtr() : m_Ptr ( nullptr ), m_Owner( nullptr ) {} /// \ru Конструктор по указателю на объект. \en Constructor by pointer to an object. /*explicit*/ DPtr( T * obj ); /// \ru Конструктор по автоматическому указателю на объект. \en Constructor by smart pointer to an object. @@ -55,12 +55,11 @@ public: /// \ru Выдать количество владеющих экземпляров DPtr. \en Get the number of DPtr objects that share ownership. refcount_t use_count() const { return m_Owner ? m_Owner->use_count() : 0; } -#ifdef C3D_STANDARD_CXX_11_PARTIAL /// \ru Конструктор перемещения. \en Moving constructor. DPtr( DPtr && src ) : m_Ptr( src.m_Ptr ), m_Owner( src.m_Owner ) { - src.m_Ptr = c3d_null; - src.m_Owner = c3d_null; + src.m_Ptr = nullptr; + src.m_Owner = nullptr; } /// \ru Оператор перемещения. \en Moving operator. DPtr & operator = ( DPtr && src ) @@ -69,7 +68,6 @@ public: std::swap( m_Owner, src.m_Owner ); return *this; } -#endif // C3D_STANDARD_CXX_11_PARTIAL private: /// \ru Счетчик ссылок на объект. \en A counter of references to an object. @@ -79,7 +77,7 @@ private: : m_Ptr( obj ) , useCount( 0 ) { - PRECONDITION( obj != c3d_null ); + PRECONDITION( obj != nullptr ); } void AddRef() const { ++useCount; } void Release() const @@ -112,9 +110,9 @@ private: template DPtr::DPtr( T * obj ) : m_Ptr( obj ) - , m_Owner( c3d_null ) + , m_Owner( nullptr ) { - if ( obj != c3d_null ) + if ( obj != nullptr ) { m_Owner = new Owner( obj ); m_Owner->AddRef(); @@ -129,7 +127,7 @@ DPtr::DPtr( const DPtr & dptr ) : m_Ptr( dptr.m_Ptr ) , m_Owner( dptr.m_Owner ) { - if ( m_Owner != c3d_null ) + if ( m_Owner != nullptr ) m_Owner->AddRef(); // SKIP_SA } @@ -142,7 +140,7 @@ DPtr & DPtr::operator = ( T * pObj ) if ( m_Ptr != pObj ) { reset(); - if ( pObj != c3d_null ) + if ( pObj != nullptr ) { m_Ptr = pObj; m_Owner = new Owner( pObj ); @@ -162,7 +160,7 @@ DPtr & DPtr::operator = ( const DPtr & dptr ) if ( m_Ptr != dptr.m_Ptr ) { reset(); - if ( dptr.m_Ptr != c3d_null ) + if ( dptr.m_Ptr != nullptr ) { m_Ptr = dptr.m_Ptr; m_Owner = dptr.m_Owner; @@ -179,12 +177,12 @@ DPtr & DPtr::operator = ( const DPtr & dptr ) template DPtr & DPtr::reset() { - if ( m_Ptr == c3d_null ) + if ( m_Ptr == nullptr ) return *this; - m_Ptr = c3d_null; + m_Ptr = nullptr; m_Owner->Release(); // SKIP_SA - m_Owner = c3d_null; + m_Owner = nullptr; return *this; } diff --git a/C3d/Include/templ_fdp_array.h b/C3d/Include/templ_fdp_array.h index 50324e9..b30c79e 100644 --- a/C3d/Include/templ_fdp_array.h +++ b/C3d/Include/templ_fdp_array.h @@ -55,14 +55,14 @@ public : /// \ru Конструктор. \en Constructor. FDPArray() : RPArray() - , fDestroy( c3d_null ) - , nowDeletedElem(c3d_null) + , fDestroy( nullptr ) + , nowDeletedElem(nullptr) {} /// \ru Конструктор. \en Constructor. FDPArray( size_t i_upper, uint16 i_delta, DestroyFunc fd ) : RPArray( i_upper, i_delta) , fDestroy( fd ) - , nowDeletedElem(c3d_null) + , nowDeletedElem(nullptr) {} /// \ru Деструктор. \en Destructor. virtual ~FDPArray(); @@ -105,11 +105,9 @@ public: void operator delete ( void *, size_t ); #endif // __DEBUG_MEMORY_ALLOCATE_FREE_ -#ifdef C3D_STANDARD_CXX_11_PARTIAL public: FDPArray( FDPArray && ); ///< \ru Конструктор перемещения массива. \en Constructor of an array moving. FDPArray & operator = ( FDPArray && ); ///< \ru Оператор перемещения массива. \en Operator of an array moving. -#endif // C3D_STANDARD_CXX_11_PARTIAL }; @@ -131,7 +129,6 @@ inline void FDPArray::operator delete( void * ptr, size_t size ) { } #endif // __DEBUG_MEMORY_ALLOCATE_FREE_ -#ifdef C3D_STANDARD_CXX_11_PARTIAL //------------------------------------------------------------------------------ // \ru Конструктор перемещения массива. \en Constructor of an array moving. // --- @@ -141,8 +138,8 @@ FDPArray::FDPArray( FDPArray && _Right ) , fDestroy ( std::move(_Right.fDestroy) ) , nowDeletedElem( std::move(_Right.nowDeletedElem) ) { - _Right.fDestroy = c3d_null; - _Right.nowDeletedElem = c3d_null; + _Right.fDestroy = nullptr; + _Right.nowDeletedElem = nullptr; } //------------------------------------------------------------------------------ @@ -160,13 +157,13 @@ FDPArray & FDPArray::operator = ( FDPArray && _Right ) } return (*this); } -#endif // C3D_STANDARD_CXX_11_PARTIAL + //------------------------------------------------------------------------------ // \ru деструктор массива \en destructor of array // --- template inline FDPArray::~FDPArray() { - PRECONDITION( nowDeletedElem == c3d_null ); + PRECONDITION( nowDeletedElem == nullptr ); destroy_array( *this ); } @@ -177,7 +174,7 @@ inline FDPArray::~FDPArray() { // --- template inline void FDPArray::Flush( DelType del ) { - PRECONDITION( nowDeletedElem == c3d_null ); + PRECONDITION( nowDeletedElem == nullptr ); if ( del==Delete || (del==defDelete && fDestroy) ) destroy_array( *this ); @@ -191,7 +188,7 @@ inline void FDPArray::Flush( DelType del ) { // --- template inline void FDPArray::Clear( typename FDPArray::TotalDestroyFunc fd ) { - PRECONDITION( nowDeletedElem == c3d_null ); + PRECONDITION( nowDeletedElem == nullptr ); size_t oldCount = RPArray::count; RPArray::count = 0; // \ru сначала приведем в порядок массив ... \en put an array in order at first ... @@ -250,9 +247,9 @@ inline Type* FDPArray::RemoveInd( size_t delIndex, DelType del ) { template inline Type * FDPArray::RemoveObj( Type * delObject, DelType del ) { - PRECONDITION( nowDeletedElem == c3d_null ); + PRECONDITION( nowDeletedElem == nullptr ); size_t i = find_in_array( *this, delObject ); - return (i != SYS_MAX_T) ? RemoveInd(i, del) : c3d_null; + return (i != SYS_MAX_T) ? RemoveInd(i, del) : nullptr; } @@ -295,9 +292,9 @@ inline Type* FDPArray::DestroyInd( size_t delIndex, typename FDPArray inline Type * FDPArray::DestroyObj( Type * delObject, typename FDPArray::DestroyFunc fd ) { - PRECONDITION( nowDeletedElem == c3d_null ); + PRECONDITION( nowDeletedElem == nullptr ); size_t i = find_in_array( *this, delObject ); - return ( i != SYS_MAX_T ) ? DestroyInd( i, fd ) : c3d_null; + return ( i != SYS_MAX_T ) ? DestroyInd( i, fd ) : nullptr; } @@ -334,7 +331,7 @@ void destroy_array( FDPArray & arr ) template bool set_Farray_size( FDPArray & arr, size_t newSize, bool clear ) { - PRECONDITION( arr.nowDeletedElem == c3d_null ); + PRECONDITION( arr.nowDeletedElem == nullptr ); if ( clear && arr.count ) arr.Flush(); // \ru будет arr.count = 0; \en arr.count will be equal 0; diff --git a/C3d/Include/templ_fdp_array_rw.h b/C3d/Include/templ_fdp_array_rw.h index 569ec30..39eb716 100644 --- a/C3d/Include/templ_fdp_array_rw.h +++ b/C3d/Include/templ_fdp_array_rw.h @@ -46,11 +46,11 @@ reader & operator >> ( reader & in, FDPArray & ref ) const Type ** parr = ref.GetAddr(); - if ( parr != c3d_null ) { + if ( parr != nullptr ) { size_t i; // \ru поочередное чтение объектов массива \en successive reading of objects from an array for ( i = 0; i < count && in.good(); i++ ) { - Type * el = c3d_null; + Type * el = nullptr; in >> el; parr[i] = el; } @@ -98,7 +98,7 @@ writer & operator << ( writer & out, const FDPArray & ref ) template reader & operator >> ( reader & in, FDPArray *& ptr ) { - ptr = c3d_null; + ptr = nullptr; if ( in.good() ) { if ( in.MathVersion() < 0x06000012L ) ptr = new FDPArray; @@ -168,7 +168,7 @@ static void TotalDestroy( Type ** arr, size_t count ) { size_t i = 0; for ( Type** parr = arr; i < count; i++, parr++ ) { Type *del = *parr; - *parr = c3d_null; // \ru Cначала обнулить ... \en Set to null at first... + *parr = nullptr; // \ru Cначала обнулить ... \en Set to null at first... delete del; // \ru ... потом удалить \en ... then delete } } diff --git a/C3d/Include/templ_ifc_array.h b/C3d/Include/templ_ifc_array.h index 6402f21..e0bdca0 100644 --- a/C3d/Include/templ_ifc_array.h +++ b/C3d/Include/templ_ifc_array.h @@ -50,7 +50,7 @@ public: typedef const value_type * pointer; public: - iterator() { m_curr = c3d_null; } + iterator() { m_curr = nullptr; } iterator( const stored_type * ptr ) { m_curr = ptr; } iterator( const iterator & iter ) { m_curr = iter.m_curr; } stored_type operator*() const { return *m_curr; } @@ -152,11 +152,9 @@ private: TEMPLATE_FRIEND reader & CALL_DECLARATION operator >> TEMPLATE_SUFFIX ( reader & in, IFC_Array & ref ); TEMPLATE_FRIEND writer & CALL_DECLARATION operator << TEMPLATE_SUFFIX ( writer & out, const IFC_Array & ref ); -#ifdef C3D_STANDARD_CXX_11_PARTIAL public: IFC_Array( IFC_Array && ); ///< \ru Конструктор перемещения массива. \en Constructor of an array moving. IFC_Array & operator = ( IFC_Array && ); ///< \ru Оператор перемещения массива. \en Operator of an array moving. -#endif // C3D_STANDARD_CXX_11_PARTIAL }; //------------------------------------------------------------------------------ @@ -165,14 +163,13 @@ public: template inline void IFCArray_Release( Type * & el ) { - if ( el != c3d_null && el->Release() == 0 ) + if ( el != nullptr && el->Release() == 0 ) { // AS K11 27.05.2008 Обнулять, только если объект действительно удален. - el = c3d_null; + el = nullptr; } } -#ifdef C3D_STANDARD_CXX_11_PARTIAL //------------------------------------------------------------------------------ // \ru Конструктор перемещения массива. \en Constructor of an array moving. // --- @@ -195,7 +192,6 @@ IFC_Array & IFC_Array::operator = ( IFC_Array && _Right ) } return (*this); } -#endif // C3D_STANDARD_CXX_11_PARTIAL //------------------------------------------------------------------------------ // \ru Деструктор массива. \en Destructor of array @@ -211,7 +207,7 @@ inline IFC_Array::~IFC_Array() // --- template inline void IFC_Array::Add( Type* ent ) { - if ( ent != c3d_null ) + if ( ent != nullptr ) ent->AddRef(); RPArray::Add( ent ); } @@ -222,7 +218,7 @@ inline void IFC_Array::Add( Type* ent ) { // --- template inline void IFC_Array::AddAt( stored_type ent, size_t ind ) { - if ( ent != c3d_null ) + if ( ent != nullptr ) ent->AddRef(); RPArray::AddAt( ent, ind ); } @@ -233,7 +229,7 @@ inline void IFC_Array::AddAt( stored_type ent, size_t ind ) { // --- template inline void IFC_Array::AddAfter( stored_type ent, size_t ind ) { - if ( ent != c3d_null ) + if ( ent != nullptr ) ent->AddRef(); RPArray::AddAfter( ent, ind ); } @@ -244,10 +240,10 @@ inline void IFC_Array::AddAfter( stored_type ent, size_t ind ) { // --- template inline void IFC_Array::SetAt( stored_type ent, size_t ind ) { - if ( ent != c3d_null ) + if ( ent != nullptr ) ent->AddRef(); Type * & el = RPArray::operator[](ind); - if ( el != c3d_null ) + if ( el != nullptr ) el->Release(); el = ent; } diff --git a/C3d/Include/templ_im_array.h b/C3d/Include/templ_im_array.h index 5e625e0..f55e029 100644 --- a/C3d/Include/templ_im_array.h +++ b/C3d/Include/templ_im_array.h @@ -73,8 +73,8 @@ public: void RemoveInd ( size_t delIndex, bool completely = true ); // \ru удалить элемент из массива \en delete an element from array void RemoveObj ( const size_t & delObject, bool completely = true ); // \ru удалить элемент из массива \en delete an element from array - Type * ReindexInd( size_t ind, size_t * = c3d_null ); // \ru заменить элемент с упорядочиванием по массиву \en replace element with sorting - size_t ReindexObj( Type * ent, size_t * = c3d_null ); // \ru заменить элемент с упорядочиванием по массиву \en replace element with sorting + Type * ReindexInd( size_t ind, size_t * = nullptr ); // \ru заменить элемент с упорядочиванием по массиву \en replace element with sorting + size_t ReindexObj( Type * ent, size_t * = nullptr ); // \ru заменить элемент с упорядочиванием по массиву \en replace element with sorting Type * ReindexMyInd( size_t ); // \ru заменить элемент с упорядочиванием по массиву \en replace element with sorting diff --git a/C3d/Include/templ_iterator.h b/C3d/Include/templ_iterator.h index 5377d21..787519f 100644 --- a/C3d/Include/templ_iterator.h +++ b/C3d/Include/templ_iterator.h @@ -53,9 +53,9 @@ public: /// \ru Сброс итератора. \en Reset iterator. virtual void Restart() { index = 0; } /// \ru Получить текущий элемент и сдвинуть итератор на следующий. \en Get the current element and move an iterator to the next. - virtual Type * operator ++(int) { return (index < items.Count()) ? items[index++] : c3d_null; } + virtual Type * operator ++(int) { return (index < items.Count()) ? items[index++] : nullptr; } /// \ru Получить текущий элемент \en Get the current element - virtual Type * operator() () const { return (index < items.Count()) ? items[index] : c3d_null; } + virtual Type * operator() () const { return (index < items.Count()) ? items[index] : nullptr; } private: // \ru не реализовано \en not implemented PointersArrayIterator & operator = ( const PointersArrayIterator & ); diff --git a/C3d/Include/templ_kdtree.h b/C3d/Include/templ_kdtree.h index ba3c8f4..5ffe68e 100644 --- a/C3d/Include/templ_kdtree.h +++ b/C3d/Include/templ_kdtree.h @@ -235,7 +235,7 @@ inline bool PriorityQueue::Initialize( size_t _maxSize ) elements = new Element[maxSize]; } catch ( ... ) { - elements = c3d_null; + elements = nullptr; maxSize = count = 0; C3D_CONTROLED_THROW; return false; diff --git a/C3d/Include/templ_lis_array.h b/C3d/Include/templ_lis_array.h index 208f252..0fa84d5 100644 --- a/C3d/Include/templ_lis_array.h +++ b/C3d/Include/templ_lis_array.h @@ -176,7 +176,7 @@ inline LiSArray & LiSArray::operator = ( const LiSArray & o ) set_array_size( *this, o.count ); // \ru обеспечить память на такое кол-во элементов \en allocate memory for the given number of elements count = o.count; C3D_ASSERT( count < 254 ); - if ( count > 0 && parr != c3d_null ) + if ( count > 0 && parr != nullptr ) memcpy( parr, o.parr, count * sizeof(Type) ); // SKIP_SA return *this; @@ -190,7 +190,7 @@ inline LiSArray & LiSArray::operator += ( const LiSArray & o ) { if ( o.count ) { set_array_size( *this, count + o.count ); // \ru обеспечить память на такое кол-во элементов \en allocate memory for the given number of elements - if ( parr != c3d_null ) + if ( parr != nullptr ) memcpy( parr+count, o.parr, o.count * sizeof(Type) ); count = (uint8)(count + o.count); diff --git a/C3d/Include/templ_multimap.h b/C3d/Include/templ_multimap.h index 07e72fa..852f823 100644 --- a/C3d/Include/templ_multimap.h +++ b/C3d/Include/templ_multimap.h @@ -94,7 +94,7 @@ private: }; template struct Null { // \ru Нуль указателей. \en Null of pointers. - static inline T* val() { return c3d_null; } + static inline T* val() { return nullptr; } }; // \ru LF_Linux: 25.03.11 g++ выдает ошибку на этот код - не использованы KeyType, ValType в полной специализации шаблона. // Однако непонятно, зачем нужна эта полная специализация - общая частичная специализация для тривиальных типов вполне подойдет. @@ -113,9 +113,9 @@ public: Pair * m_MaxPtr; public: - Iterator() : m_Ptr( c3d_null ), m_MaxPtr( c3d_null ) {} + Iterator() : m_Ptr( nullptr ), m_MaxPtr( nullptr ) {} Iterator( const Iterator & iter ) : m_Ptr( iter.m_Ptr ), m_MaxPtr( iter.m_MaxPtr ) {} - Iterator( const SArray & m_Pairs, const Pair & pair ) : m_Ptr( c3d_null ), m_MaxPtr( c3d_null ) + Iterator( const SArray & m_Pairs, const Pair & pair ) : m_Ptr( nullptr ), m_MaxPtr( nullptr ) { const size_t count = m_Pairs.Count(); if ( count > 0 ) { @@ -135,10 +135,10 @@ public: } } Iterator( const SArray & m_Pairs, const Iterator & iter1, const Iterator & iter2 ) // range - : m_Ptr( c3d_null ), m_MaxPtr( c3d_null ) + : m_Ptr( nullptr ), m_MaxPtr( nullptr ) { const size_t count = m_Pairs.Count(); - if ( count > 0 && iter1.m_Ptr != c3d_null ) { + if ( count > 0 && iter1.m_Ptr != nullptr ) { size_t idx1 = MultiMap::LowerBoundEx( m_Pairs, iter1.m_Ptr->m_key ); size_t temp = idx1; while ( temp < m_Pairs.Count() && m_Pairs[temp].m_key == iter1.m_Ptr->m_key ) { @@ -149,7 +149,7 @@ public: temp++; } size_t idx2 = SYS_MAX_T; - if ( iter2.m_Ptr != c3d_null ) { + if ( iter2.m_Ptr != nullptr ) { idx2 = MultiMap::UpperBoundEx( m_Pairs, iter2.m_Ptr->m_key ); if ( idx2 < m_Pairs.Count() ) { if ( idx2 > 0) diff --git a/C3d/Include/templ_p_array.h b/C3d/Include/templ_p_array.h index ddfc5cc..a58a047 100644 --- a/C3d/Include/templ_p_array.h +++ b/C3d/Include/templ_p_array.h @@ -52,13 +52,13 @@ public : PArray() : RPArray() , owns( true ) - , nowDeletedElem(c3d_null) + , nowDeletedElem(nullptr) {} /// \ru Конструктор. \en Constructor. PArray( size_t i_upper, uint16 i_delta = 1, bool shouldDelete = true )//, bool shouldNullSet = false ) : RPArray( i_upper, i_delta )//, shouldNullSet ) , owns( shouldDelete ) - , nowDeletedElem(c3d_null) + , nowDeletedElem(nullptr) {} /// \ru Деструктор. \en Destructor. virtual ~PArray(); @@ -221,7 +221,7 @@ private: // --- template inline PArray::~PArray() { - PRECONDITION( nowDeletedElem == c3d_null ); + PRECONDITION( nowDeletedElem == nullptr ); if ( owns ) destroy_array( *this ); } @@ -232,7 +232,7 @@ inline PArray::~PArray() { // --- template inline void PArray::Flush( DelType del ) { - PRECONDITION( nowDeletedElem == c3d_null ); + PRECONDITION( nowDeletedElem == nullptr ); if ( del==Delete || (del==defDelete && owns) ) destroy_array( *this ); @@ -289,10 +289,10 @@ inline Type * PArray::RemoveInd( size_t delIndex, DelType del ) { // --- template inline Type * PArray::RemoveObj( Type * delObject, DelType del ) { - PRECONDITION( nowDeletedElem == c3d_null ); // \ru временно, для отладки \en temporarily, for debugging + PRECONDITION( nowDeletedElem == nullptr ); // \ru временно, для отладки \en temporarily, for debugging size_t i = find_in_array( *this, delObject ); - return (i != SYS_MAX_T) ? RemoveInd(i, del) : c3d_null; + return (i != SYS_MAX_T) ? RemoveInd(i, del) : nullptr; } @@ -326,7 +326,7 @@ void destroy_array( PArray & arr ) { // --- template bool set_Parray_size( PArray & arr, size_t newSize, bool clear ) { - PRECONDITION( arr.nowDeletedElem == c3d_null ); // \ru временно \en temporarily + PRECONDITION( arr.nowDeletedElem == nullptr ); // \ru временно \en temporarily if ( clear && arr.count ) arr.Flush(); // \ru будет arr.count = 0; \en arr.count will be equal 0; @@ -354,7 +354,7 @@ bool set_Parray_size( PArray & arr, size_t newSize, bool clear ) { // --- //template //inline void PIArray::ForEachI( IteratorFunc func ) const { -// \ru C3D_ASSERT( PArray::nowDeletedElem == c3d_null ); // временно \en C3D_ASSERT( PArray::nowDeletedElem == c3d_null ); // temporarily +// \ru C3D_ASSERT( PArray::nowDeletedElem == nullptr ); // временно \en C3D_ASSERT( PArray::nowDeletedElem == nullptr ); // temporarily //#if !defined ( __INTEL_COMPILER ) /// for Intel C++ Compiler // for_each_in_array( *this, func ); //#endif // __INTEL_COMPILER @@ -366,7 +366,7 @@ bool set_Parray_size( PArray & arr, size_t newSize, bool clear ) { // --- template inline void PIArray::ForEachI( ParIteratorFunc func, void * pars ) const { - PRECONDITION( PArray::nowDeletedElem == c3d_null ); + PRECONDITION( PArray::nowDeletedElem == nullptr ); for_each_in_array( *this, func, pars ); } @@ -376,7 +376,7 @@ inline void PIArray::ForEachI( ParIteratorFunc func, void * pars ) const { // --- template inline size_t PIArray::FirstThatI( CompareFunc func, void * pars, size_t from ) const { - PRECONDITION( PArray::nowDeletedElem == c3d_null ); + PRECONDITION( PArray::nowDeletedElem == nullptr ); return first_that_in_array( *this, func, pars, from ); } @@ -386,7 +386,7 @@ inline size_t PIArray::FirstThatI( CompareFunc func, void * pars, size_t f // --- //template //inline void PMIArray::ForEach( IteratorMemFunc func ) const { -// \ru C3D_ASSERT( PArray::nowDeletedElem == c3d_null ); +// \ru C3D_ASSERT( PArray::nowDeletedElem == nullptr ); //#if !defined ( __INTEL_COMPILER ) /// for Intel C++ Compiler // for_each_in_array( *this, func ); //#endif // __INTEL_COMPILER @@ -398,7 +398,7 @@ inline size_t PIArray::FirstThatI( CompareFunc func, void * pars, size_t f // --- template inline void PMIArray::ForEach( ParIteratorMemFunc func, void * pars ) const { - PRECONDITION( PArray::nowDeletedElem == c3d_null ); + PRECONDITION( PArray::nowDeletedElem == nullptr ); for_each_in_array( *this, func, pars ); } @@ -408,7 +408,7 @@ inline void PMIArray::ForEach( ParIteratorMemFunc func, void * pars ) cons // --- template inline size_t PMIArray::FirstThat( CompareMemFunc func, void * pars, size_t from ) const { - PRECONDITION( PArray::nowDeletedElem == c3d_null ); + PRECONDITION( PArray::nowDeletedElem == nullptr ); return first_that_in_array( *this, func, pars, from ); } diff --git a/C3d/Include/templ_p_array_rw.h b/C3d/Include/templ_p_array_rw.h index 0757c5a..80ff170 100644 --- a/C3d/Include/templ_p_array_rw.h +++ b/C3d/Include/templ_p_array_rw.h @@ -45,7 +45,7 @@ reader & operator >> ( reader & in, PArray & ref ) const Type ** parr = ref.GetAddr(); - if ( parr != c3d_null ) + if ( parr != nullptr ) { ref.count = 0; // \ru Err #69421 сколько штук реально прочитано \en Err #69421 how many elements were actually counted @@ -53,7 +53,7 @@ reader & operator >> ( reader & in, PArray & ref ) // \ru поочередное чтение объектов массива \en successive reading of objects from an array for ( i = 0; i < count && in.good(); i++ ) { - Type * el = c3d_null; + Type * el = nullptr; in >> el; parr[i] = el; @@ -121,7 +121,7 @@ writer & operator << ( writer& out, const PArray & ref ) template reader & operator >> ( reader & in, PArray *& ptr ) { - ptr = c3d_null; + ptr = nullptr; if ( in.good() ) { if ( in.MathVersion() < 0x06000012L ) ptr = new PArray; diff --git a/C3d/Include/templ_pointer.h b/C3d/Include/templ_pointer.h index 4a42560..396bfa5 100644 --- a/C3d/Include/templ_pointer.h +++ b/C3d/Include/templ_pointer.h @@ -38,34 +38,32 @@ public: T & operator * () const { return *P; } operator T* () const { return P; } - int operator ! () const { return (P == c3d_null);} - T * Relinquish() {T * p = P; P = c3d_null; return p;} + int operator ! () const { return (P == nullptr);} + T * Relinquish() {T * p = P; P = nullptr; return p;} T * Get() { return P; } const T * Get() const { return P; } protected: TPointerBase( T * pointer ) : P(pointer) {} - TPointerBase() : P( c3d_null ) {} + TPointerBase() : P( nullptr ) {} protected: T * P; private: void * operator new( size_t ); // prohibit use of new - void operator delete( void * p ) { ((TPointerBase*)p)->P = c3d_null; } + void operator delete( void * p ) { ((TPointerBase*)p)->P = nullptr; } // СМВ К15 MVS 2012 private: TPointerBase( const TPointerBase & other ); -#ifdef C3D_STANDARD_CXX_11_PARTIAL public: - TPointerBase( TPointerBase && _Right ): P( _Right.P ) { _Right.P = c3d_null; } + TPointerBase( TPointerBase && _Right ): P( _Right.P ) { _Right.P = nullptr; } TPointerBase & operator = ( TPointerBase && _Right ) { if ( this != &_Right ) - { P = _Right.P; _Right.P = c3d_null; } + { P = _Right.P; _Right.P = nullptr; } return *this; } -#endif // C3D_STANDARD_CXX_11_PARTIAL }; @@ -98,8 +96,8 @@ public: } return *this; } - T * operator ->() { return TPointerBase::P; } // Could throw exception if P==c3d_null - const T * operator ->() const { return TPointerBase::P; } // Could throw exception if P==c3d_null + T * operator ->() { return TPointerBase::P; } // Could throw exception if P==nullptr + const T * operator ->() const { return TPointerBase::P; } // Could throw exception if P==nullptr // СМВ К15 MVS 2012 #ifndef __MOBILE_VERSION__ @@ -107,7 +105,6 @@ private: #endif // __MOBILE_VERSION__ TPointer( const TPointer & other ); -#ifdef C3D_STANDARD_CXX_11_PARTIAL public: TPointer( TPointer && _Right ) : TPointerBase( std::move(_Right) ) @@ -118,11 +115,10 @@ public: { delete TPointerBase::P; TPointerBase::P = _Right.P; - _Right.P = c3d_null; + _Right.P = nullptr; } return *this; } -#endif // C3D_STANDARD_CXX_11_PARTIAL }; @@ -160,7 +156,7 @@ public: } return *this; } - T * operator ->() { return TPointerBase::P; } // Could throw exception if P==c3d_null + T * operator ->() { return TPointerBase::P; } // Could throw exception if P==nullptr bool GetOwn() const { return own; } void SetOwn( bool val ) { own = val; } @@ -168,7 +164,6 @@ public: private: TOwnPointer( const TOwnPointer & other ); TOwnPointer & operator = ( const TOwnPointer & _Right ); -#ifdef C3D_STANDARD_CXX_11_PARTIAL public: TOwnPointer( TOwnPointer && _Right ) : TPointerBase( std::move(_Right) ) @@ -182,11 +177,10 @@ public: delete TPointerBase::P; TPointerBase::P = _Right.P; own = _Right.own; - _Right.P = c3d_null; + _Right.P = nullptr; } return *this; } -#endif // C3D_STANDARD_CXX_11_PARTIAL }; @@ -221,12 +215,11 @@ public: } return *this; } - T & operator []( size_t i ) { return TPointerBase::P[i]; } // Could throw exception if P==c3d_null + T & operator []( size_t i ) { return TPointerBase::P[i]; } // Could throw exception if P==nullptr // СМВ К15 MVS 2012 //private: // g++4.7 KUbuntu TAPointer( const TAPointer & other ); -#ifdef C3D_STANDARD_CXX_11_PARTIAL public: TAPointer(TAPointer && _Right) : TPointerBase( std::move(_Right) ) @@ -237,11 +230,10 @@ public: { delete[] TPointerBase::P; TPointerBase::P = _Right.P; - _Right.P = c3d_null; + _Right.P = nullptr; } return *this; } -#endif // C3D_STANDARD_CXX_11_PARTIAL }; @@ -273,12 +265,11 @@ public: delete[] P; return P = src.P; } - return c3d_null; + return nullptr; } char & operator []( size_t i ) { return P[i]; } -#ifdef C3D_STANDARD_CXX_11_PARTIAL public: TPointer( TPointer && _Right ) : TPointerBase( std::move(_Right) ) @@ -289,11 +280,10 @@ public: { delete[] P; P = _Right.P; - _Right.P = c3d_null; + _Right.P = nullptr; } return *this; } -#endif // C3D_STANDARD_CXX_11_PARTIAL }; diff --git a/C3d/Include/templ_psrt_array.h b/C3d/Include/templ_psrt_array.h index fcdd487..feeeed4 100644 --- a/C3d/Include/templ_psrt_array.h +++ b/C3d/Include/templ_psrt_array.h @@ -108,13 +108,13 @@ public: void DetachRng ( size_t, size_t ); // \ru отцепить из массива диапазон указателей \en detach a range of pointers from array typedef int (*PArSortCompFunc)( const Type **, const Type ** ); - void Sort ( PArSortCompFunc, PArrayReg * = c3d_null ); // \ru быстрая сортировка в любом диапазоне \en quick sorting in any range + void Sort ( PArSortCompFunc, PArrayReg * = nullptr ); // \ru быстрая сортировка в любом диапазоне \en quick sorting in any range void Sort ( const void *, PArSortRangeCompFunc, size_t armin = 0, size_t armax = SYS_MAX_T ); // \ru быстрая сортировка в заданном диапазоне \en quick sorting in a given range bool Find ( const Type *, PArSortAddress, size_t &, size_t armin = 0, size_t armax = SYS_MAX_T ); // \ru найти адрес в любом поле объекта \en find address in any field of object bool Find ( const size_t, PArSortAddress, size_t &, size_t armin = 0, size_t armax = SYS_MAX_T ); // \ru найти адрес в любом поле объекта \en find address in any field of object bool Find ( const void *, PArSortObj, size_t &, size_t armin = 0, size_t armax = SYS_MAX_T ); // \ru найти данный объект в сортированном массиве \en find a given object in sorted array - int FindObj ( const Type *, PArSortCompFunc, size_t &, PArrayReg * = c3d_null ) const; // \ru найти данный объект в сортированном массиве \en find a given object in sorted array + int FindObj ( const Type *, PArSortCompFunc, size_t &, PArrayReg * = nullptr ) const; // \ru найти данный объект в сортированном массиве \en find a given object in sorted array Type * AddSort ( Type *, PArSortCompFunc, size_t & ); // \ru добавить элемент в сортированном порядке \en add element in sorted order void Inverse (); // \ru инверсия массива \en inversion of array @@ -210,7 +210,7 @@ inline void PArraySort::Insert( size_t index, Type * ent ) template void PArraySort::RemoveRng( size_t startIndex, size_t countRng, DelType del ) { - C3D_ASSERT( PArray::nowDeletedElem == c3d_null ); // \ru ЯТ - временно \en ЯТ - temporarily + C3D_ASSERT( PArray::nowDeletedElem == nullptr ); // \ru ЯТ - временно \en ЯТ - temporarily // \ru если диапазон не пуст и индекс принадлежит массиву \en if range is not empty and index belongs to array if ( countRng && startIndex < PArray::count ) { @@ -226,14 +226,14 @@ void PArraySort::RemoveRng( size_t startIndex, size_t countRng, DelType de size_t i = 0; for( const Type ** parr = PArray::GetAddr() + startIndex; i < countRng; i++, parr++ ) { Type * d = (Type*)*parr; - *parr = c3d_null; // \ru сначала обнулим указатель ... \en set pointer to null ... + *parr = nullptr; // \ru сначала обнулим указатель ... \en set pointer to null ... C3D_ASSERT( !d || PArray::nowDeletedElem != d ); // \ru ЯТ - временно \en ЯТ - temporarily PArray::nowDeletedElem = d; delete d; - PArray::nowDeletedElem = c3d_null; + PArray::nowDeletedElem = nullptr; } } @@ -293,7 +293,7 @@ inline size_t PArraySort::CalculateDelta() template inline void PArraySort::CatchMemory() { - PRECONDITION( PArray::nowDeletedElem == c3d_null ); // \ru ЯТ - временно \en ЯТ - temporarily + PRECONDITION( PArray::nowDeletedElem == nullptr ); // \ru ЯТ - временно \en ЯТ - temporarily if ( PArray::upper == PArray::count ) set_Parray_size( *this, PArray::upper + CalculateDelta(), false/*clear*/ ); } @@ -305,7 +305,7 @@ inline void PArraySort::CatchMemory() template inline void PArraySort::Reserve( size_t n ) { - C3D_ASSERT( PArray::nowDeletedElem == c3d_null ); // \ru ЯТ - временно \en ЯТ - temporarily + C3D_ASSERT( PArray::nowDeletedElem == nullptr ); // \ru ЯТ - временно \en ЯТ - temporarily // \ru если требуется памяти больше, чем есть сейчас, и больше, чем оказалось бы \en if there is required more memory that exists at the moment and more than it would become // \ru при следующем захвате, то захватить ее \en on the next allocation then allocate it size_t space = PArray::upper - PArray::count; @@ -320,7 +320,7 @@ inline void PArraySort::Reserve( size_t n ) template inline void PArraySort::Sort( PArSortCompFunc fcmp, PArrayReg * arReg ) { - PRECONDITION( PArray::nowDeletedElem == c3d_null ); // \ru ЯТ - временно \en ЯТ - temporarily + PRECONDITION( PArray::nowDeletedElem == nullptr ); // \ru ЯТ - временно \en ЯТ - temporarily if ( PArray::count > 1 ) { // \ru если хотя бы два элемента в массиве \en if there are at least two elements in array typedef int (*QCompFunc)( const void*, const void* ); if ( !arReg ) { @@ -345,7 +345,7 @@ inline void PArraySort::Sort( PArSortCompFunc fcmp, PArrayReg * arReg ) template inline void PArraySort::Sort( const void * obj, PArSortRangeCompFunc fcmp, size_t armin, size_t armax ) { - C3D_ASSERT( PArray::nowDeletedElem == c3d_null ); // \ru ЯТ - временно \en ЯТ - temporarily + C3D_ASSERT( PArray::nowDeletedElem == nullptr ); // \ru ЯТ - временно \en ЯТ - temporarily if ( PArray::count > 1 ) { // \ru если хотя бы два элемента в массиве \en if there are at least two elements in array if ( armax > armin ) { // \ru если диапазон сортировки правильный \en if the sorting range is correct if ( armin < PArray::count - 1 ) { // \ru если минимальная граница меньше максимального элемента в массиве \en if the minimum bound is less than the maximum element in array @@ -364,7 +364,7 @@ inline void PArraySort::Sort( const void * obj, PArSortRangeCompFunc fcmp, template void PArraySort::SortRange( const void * obj, PArSortRangeCompFunc fcmp, size_t ilo, size_t ihi ) { - C3D_ASSERT( PArray::nowDeletedElem == c3d_null ); // \ru ЯТ - временно \en ЯТ - temporarily + C3D_ASSERT( PArray::nowDeletedElem == nullptr ); // \ru ЯТ - временно \en ЯТ - temporarily size_t lo = ilo; // \ru нижняя граница \en lower bound size_t hi = ihi; // \ru верхняя граница \en upper bound @@ -404,7 +404,7 @@ template inline bool PArraySort::Find( const size_t address, PArSortAddress fadr, size_t & findedAddress, size_t armin, size_t armax ) { - C3D_ASSERT( PArray::nowDeletedElem == c3d_null ); // \ru ЯТ - временно \en ЯТ - temporarily + C3D_ASSERT( PArray::nowDeletedElem == nullptr ); // \ru ЯТ - временно \en ЯТ - temporarily bool res = false; findedAddress = SYS_MAX_T/*OV_x64 -1*/; @@ -432,7 +432,7 @@ inline bool PArraySort::Find( const size_t address, PArSortAddress fadr, s template inline bool PArraySort::Find( const Type * member, PArSortAddress fadr, size_t & findedAddress, size_t armin, size_t armax ) { - C3D_ASSERT( PArray::nowDeletedElem == c3d_null ); // \ru ЯТ - временно \en ЯТ - temporarily + C3D_ASSERT( PArray::nowDeletedElem == nullptr ); // \ru ЯТ - временно \en ЯТ - temporarily return Find( fadr(member), fadr, findedAddress, armin, armax ); } @@ -443,7 +443,7 @@ inline bool PArraySort::Find( const Type * member, PArSortAddress fadr, si template inline bool PArraySort::Find( const void * obj, PArSortObj fobj, size_t & findedId, size_t armin, size_t armax ) { - C3D_ASSERT( PArray::nowDeletedElem == c3d_null ); // \ru ЯТ - временно \en ЯТ - temporarily + C3D_ASSERT( PArray::nowDeletedElem == nullptr ); // \ru ЯТ - временно \en ЯТ - temporarily bool res = false; @@ -472,7 +472,7 @@ inline bool PArraySort::Find( const void * obj, PArSortObj fobj, size_t & template bool PArraySort::FindObject( const void * obj, PArSortObj fobj, size_t & findedId, size_t armin, size_t armax ) { - C3D_ASSERT( PArray::nowDeletedElem == c3d_null ); // \ru ЯТ - временно \en ЯТ - temporarily + C3D_ASSERT( PArray::nowDeletedElem == nullptr ); // \ru ЯТ - временно \en ЯТ - temporarily bool res = false; // \ru флаг, который указывает существует ли искомый объект в массиве \en flag which specifies whether the required object is in array @@ -513,7 +513,7 @@ bool PArraySort::FindObject( const void * obj, PArSortObj fobj, size_t & f template bool PArraySort::FindAddress( const size_t address, PArSortAddress fadr, size_t & findedAddress, size_t armin, size_t armax ) { - C3D_ASSERT( PArray::nowDeletedElem == c3d_null ); // \ru ЯТ - временно \en ЯТ - temporarily + C3D_ASSERT( PArray::nowDeletedElem == nullptr ); // \ru ЯТ - временно \en ЯТ - temporarily bool res = false; // \ru флаг, который указывает существует ли искомый адресс в массиве \en flag which specifies whether the required address is in array size_t id = armax - armin; // \ru количество элементов в диапазоне \en the number of elements in range @@ -612,7 +612,7 @@ bool PArraySort::FindAddress( const size_t address, PArSortAddress fadr, s template int PArraySort::FindObj( const Type * obj, PArSortCompFunc fcmp, size_t & iFnd, PArrayReg * arReg ) const { - PRECONDITION( PArray::nowDeletedElem == c3d_null ); // \ru ЯТ - временно \en ЯТ - temporarily + PRECONDITION( PArray::nowDeletedElem == nullptr ); // \ru ЯТ - временно \en ЯТ - temporarily if ( (PArray::count) > 0 ) { size_t id = PArray::count; // \ru количество элементов в диапазоне \en the number of elements in range id--; @@ -686,7 +686,7 @@ int PArraySort::FindObj( const Type * obj, PArSortCompFunc fcmp, size_t & template inline Type * PArraySort::AddSort( Type * obj, PArSortCompFunc fcmp, size_t & iFnd ) { - PRECONDITION( PArray::nowDeletedElem == c3d_null ); // \ru ЯТ - временно \en ЯТ - temporarily + PRECONDITION( PArray::nowDeletedElem == nullptr ); // \ru ЯТ - временно \en ЯТ - temporarily int ires = FindObj( obj, fcmp, iFnd ); if ( (ires == -2) || (ires == 2) ) { iFnd = ( (ires == -2) ? 0 : PArray::count ); @@ -696,7 +696,7 @@ inline Type * PArraySort::AddSort( Type * obj, PArSortCompFunc fcmp, size_ if ( ires == -1 ) AddAt( obj, iFnd ); - return ires ? (*this)/*parr*/[iFnd] : c3d_null; + return ires ? (*this)/*parr*/[iFnd] : nullptr; } @@ -706,7 +706,7 @@ inline Type * PArraySort::AddSort( Type * obj, PArSortCompFunc fcmp, size_ template void PArraySort::Inverse() { - C3D_ASSERT( PArray::nowDeletedElem == c3d_null ); // \ru ЯТ - временно \en ЯТ - temporarily + C3D_ASSERT( PArray::nowDeletedElem == nullptr ); // \ru ЯТ - временно \en ЯТ - temporarily if ( PArray::count ) { size_t endI = PArray::count - 1; // \ru проверено count > 0 \en count > 0 validated diff --git a/C3d/Include/templ_rp_array.h b/C3d/Include/templ_rp_array.h index 5b37136..fae3197 100644 --- a/C3d/Include/templ_rp_array.h +++ b/C3d/Include/templ_rp_array.h @@ -105,7 +105,7 @@ public: /// \ru Оператор доступа по индексу. \en Access by index operator. Type *& operator []( size_t loc ) const; /// \ru Получить адрес последнего элемента в массиве. \en Get the address of the last element in the array. - Type * GetLast() const { return ((count > 0) ? parr[count-1] : (Type*)c3d_null); } + Type * GetLast() const { return ((count > 0) ? parr[count-1] : (Type*)nullptr); } public: // \ru унификация с вектором STL \en unification with STL vector bool empty() const { return count == 0; } @@ -167,11 +167,9 @@ public: void operator delete ( void *, size_t ); #endif // __DEBUG_MEMORY_ALLOCATE_FREE_ -#ifdef C3D_STANDARD_CXX_11_PARTIAL public: RPArray( RPArray && ); ///< \ru Конструктор перемещения массива. \en Constructor of an array moving. RPArray & operator = ( RPArray && ); ///< \ru Оператор перемещения массива. \en Operator of an array moving. -#endif // C3D_STANDARD_CXX_11_PARTIAL }; @@ -227,7 +225,6 @@ inline RPArray::RPArray( size_t i_upper, uint16 i_delta )//, bool shouldNu } -#ifdef C3D_STANDARD_CXX_11_PARTIAL //------------------------------------------------------------------------------ // \ru Конструктор перемещения массива. \en Constructor of an array moving. // --- @@ -241,7 +238,7 @@ inline RPArray::RPArray( RPArray && _Right ) _Right.count = 0; _Right.upper = 0; _Right.delta = 1; - _Right.parr = c3d_null; + _Right.parr = nullptr; } //------------------------------------------------------------------------------ @@ -257,7 +254,6 @@ RPArray & RPArray::operator = ( RPArray && _Right ) } return (*this); } -#endif // C3D_STANDARD_CXX_11_PARTIAL //------------------------------------------------------------------------------ @@ -691,7 +687,7 @@ bool set_Rarray_size( RPArray & arr, size_t newSize ) } catch ( ... ) { if ( newSize == 0 )// \ru Не смогли корректно удалить arr.parr. \en Failed to delete arr.parr correctly. - arr.parr = c3d_null; + arr.parr = nullptr; C3D_CONTROLED_THROW; return false; } diff --git a/C3d/Include/templ_rp_array_rw.h b/C3d/Include/templ_rp_array_rw.h index b34a3c2..a2feb6a 100644 --- a/C3d/Include/templ_rp_array_rw.h +++ b/C3d/Include/templ_rp_array_rw.h @@ -38,7 +38,7 @@ reader & operator >> ( reader & in, RPArray & ref ) const Type ** parr = ref.GetAddr(); - if ( parr != c3d_null ) { + if ( parr != nullptr ) { size_t i; // \ru поочередное чтение объектов массива \en successive reading of objects from an array for ( i = 0; i < count && in.good(); i++ ) { @@ -88,7 +88,7 @@ writer& operator << ( writer& out, const RPArray& ref ) { // --- template reader& operator >> ( reader& in, RPArray*& ptr ) { - ptr = c3d_null; + ptr = nullptr; if ( in.good() ) { uint8 existPtr; in >> existPtr; diff --git a/C3d/Include/templ_rp_stack.h b/C3d/Include/templ_rp_stack.h index a71110b..a46f170 100644 --- a/C3d/Include/templ_rp_stack.h +++ b/C3d/Include/templ_rp_stack.h @@ -31,7 +31,7 @@ public: public: void Push( Type & obj ); ///< \ru Добавить элемент в стек. \en Add an element to the stack. - Type * Pop(); ///< \ru Извлечь один элемент стека, если возвращаетя c3d_null, значит достигнуто дно стека. \en Retrieve one element from the stack, if c3d_null is returned then the bottom of stack is reached. + Type * Pop(); ///< \ru Извлечь один элемент стека, если возвращаетя nullptr, значит достигнуто дно стека. \en Retrieve one element from the stack, if nullptr is returned then the bottom of stack is reached. Type * Top() const; ///< \ru Верхний элемент стека. \en The top element of the stack. // \ru Оставить доступными следующие методы: \en Leave an access to the next methods: @@ -65,7 +65,7 @@ Type * RPStack::Pop() { RPArray::count--; return ret; } - return c3d_null; + return nullptr; } @@ -77,7 +77,7 @@ Type * RPStack::Top() const { if ( RPArray::count > 0 ) { return (*this)[RPArray::count-1]; } - return c3d_null; + return nullptr; } diff --git a/C3d/Include/templ_rw_operator.h b/C3d/Include/templ_rw_operator.h index aefad2e..93ed61f 100644 --- a/C3d/Include/templ_rw_operator.h +++ b/C3d/Include/templ_rw_operator.h @@ -21,7 +21,7 @@ template inline reader & ReadPtrByRefDCtor ( reader & in, Type *& ptr ) { - ptr = c3d_null; + ptr = nullptr; char exist; in >> exist; @@ -42,7 +42,7 @@ inline reader & ReadPtrByRefDCtor ( reader & in, Type *& ptr ) template inline reader & ReadPtrByRefRWCtor ( reader & in, Type *& ptr ) { - ptr = c3d_null; + ptr = nullptr; char exist; in >> exist; @@ -62,7 +62,7 @@ inline reader & ReadPtrByRefRWCtor ( reader & in, Type *& ptr ) template inline writer & WritePtrByRef ( writer & out, const Type * ptr ) { - char exist = (ptr != c3d_null); + char exist = (ptr != nullptr); out << exist; if ( exist ) diff --git a/C3d/Include/templ_s_array.h b/C3d/Include/templ_s_array.h index f9214db..448b6cb 100644 --- a/C3d/Include/templ_s_array.h +++ b/C3d/Include/templ_s_array.h @@ -393,7 +393,7 @@ inline void SArray::resize( size_t n, Type val ) if ( n > count ) { size_t n0 = count; if ( AddItems( n - count ) != 0 ) { - if ( parr != c3d_null ) { + if ( parr != nullptr ) { for ( size_t k = n0; k < n; ++k ) parr[k] = val; } @@ -423,7 +423,7 @@ template inline Type * SArray::Add() { if ( CatchMemory() ) return &parr[ count++ ]; - return c3d_null; + return nullptr; } @@ -444,7 +444,7 @@ inline Type * SArray::Add( const Type & ent ) { if ( CatchMemory() ) return static_cast( memcpy(static_cast(parr+count++), static_cast(&ent), sizeof(Type)) ); - return c3d_null; + return nullptr; } @@ -461,7 +461,7 @@ inline Type * SArray::AddAfter( const Type & ent, size_t index ) { return (Type*)memcpy( parr + index + 1, &ent, sizeof(Type) ); } - return c3d_null; + return nullptr; } @@ -483,7 +483,7 @@ inline Type * SArray::InsertInd( size_t index, const Type & ent ) { return (Type*)memcpy( parr + index, &ent, sizeof(Type) ); // \ru записываем новый элемент \en writing new element } - return c3d_null; + return nullptr; } @@ -501,7 +501,7 @@ inline Type * SArray::InsertInd( size_t index ) { return (Type*)( parr + index ); // \ru записываем новый элемент \en writing new element } - return c3d_null; + return nullptr; } @@ -825,7 +825,7 @@ bool set_array_size( SArray & arr, size_t newSize, bool clear ) #else //YYK V15 #77319 Type * p_tmp = newSize ? (Type*)new char[ newSize * sizeOfType ] : 0; #ifdef C3D_WINDOWS //_MSC_VER // win - Type * p_tmp = newSize ? (Type*)_aligned_malloc( newSize * sizeOfType, 16 ) : c3d_null; + Type * p_tmp = newSize ? (Type*)_aligned_malloc( newSize * sizeOfType, 16 ) : nullptr; #else Type * p_tmp = newSize ? (Type*)new char[newSize * sizeOfType] : 0; #endif // win @@ -857,7 +857,7 @@ bool set_array_size( SArray & arr, size_t newSize, bool clear ) } catch ( ... ) { if ( newSize == 0 ) { // \ru Не смогли корректно удалить arr.parr. \en Failed to delete arr.parr correctly. - arr.parr = c3d_null; + arr.parr = nullptr; arr.upper = newSize; } newSize = 0; // \ru т.к. ниже есть код с применением newSize \en because there is a code with using of newSize below diff --git a/C3d/Include/templ_s_array_rw.h b/C3d/Include/templ_s_array_rw.h index 5527664..a87747a 100644 --- a/C3d/Include/templ_s_array_rw.h +++ b/C3d/Include/templ_s_array_rw.h @@ -41,7 +41,7 @@ reader & operator >> ( reader & in, SArray & ref ) ref.SetSize( count, true/*clear*/ ); C3D_ASSERT( ref.upper >= count ); - if ( ref.GetAddr() != c3d_null ) { + if ( ref.GetAddr() != nullptr ) { size_t i; for ( i = 0; i < count && in.good(); i++ ) { @@ -95,7 +95,7 @@ writer& operator << ( writer& out, const SArray& ref ) { // template reader& operator >> ( reader& in, SArray*& ptr ) { - ptr = c3d_null; + ptr = nullptr; if ( in.good() ) { if ( in.MathVersion() < 0x06000012L ) ptr = new SArray; diff --git a/C3d/Include/templ_s_list.h b/C3d/Include/templ_s_list.h index de0460d..cb1aa5d 100644 --- a/C3d/Include/templ_s_list.h +++ b/C3d/Include/templ_s_list.h @@ -101,10 +101,10 @@ public: explicit List( bool ownsEl = true ) : owns( ownsEl ) , count( 0 ) - , first( c3d_null ) - , last( c3d_null ) - , nowDelItem( c3d_null ) - , nowDelElem( c3d_null ) + , first( nullptr ) + , last( nullptr ) + , nowDelItem( nullptr ) + , nowDelElem( nullptr ) {} virtual ~List(); @@ -138,21 +138,21 @@ public: void Split(); // \ru разомкнуть список \en split the list size_t Count() const { - PRECONDITION( nowDelItem == c3d_null && nowDelElem == c3d_null ); + PRECONDITION( nowDelItem == nullptr && nowDelElem == nullptr ); return count; } // \ru дать количество элементов в списке \en get the number of elements in the list size_t ReCalc() { return recalc_list(*this); }// \ru пересчитать количество элементов в списке \en count the number of elements in the list bool IsEmpty () const { - PRECONDITION( nowDelItem == c3d_null && nowDelElem == c3d_null ); + PRECONDITION( nowDelItem == nullptr && nowDelElem == nullptr ); return first == 0; } // \ru проверить, пустой ли список \en check whether the list is empty bool IsExist( const Type * d ) const { return is_exist_in_list(*this, d);} // \ru найти элемент по равенству указателей \en find an element by the equality of pointers Type * GetFirstData() const { - PRECONDITION( nowDelItem == c3d_null && nowDelElem == c3d_null ); + PRECONDITION( nowDelItem == nullptr && nowDelElem == nullptr ); PRECONDITION( first ); return first->data; } // \ru получить данные первого элемента списка \en get the data of the first element of the list Type * GetLastData() const { - PRECONDITION( nowDelItem == c3d_null && nowDelElem == c3d_null ); + PRECONDITION( nowDelItem == nullptr && nowDelElem == nullptr ); PRECONDITION( last ); return last->data; } // \ru получить данные последнего элемента списка \en get the data of the last element of the list protected: @@ -223,26 +223,26 @@ protected: ListItem * prev; public: - LIterator() : list( c3d_null ), curr( c3d_null ), prev( c3d_null ) {} - LIterator( const List & l ) : list( c3d_null ), curr( c3d_null ), prev( c3d_null ) { Set(l); } + LIterator() : list( nullptr ), curr( nullptr ), prev( nullptr ) {} + LIterator( const List & l ) : list( nullptr ), curr( nullptr ), prev( nullptr ) { Set(l); } LIterator( const LIterator &i ) : list( i.list ), curr( i.curr ), prev( i.prev ) {} virtual ~LIterator() {} void Set( const List& l ) { list = (List*)&l; Restart(); } - void Restart() { PRECONDITION(list); curr = list->first; prev = c3d_null; } - Type * GetData() const { return curr ? curr->data : c3d_null; } + void Restart() { PRECONDITION(list); curr = list->first; prev = nullptr; } + Type * GetData() const { return curr ? curr->data : nullptr; } Type * GetDataAndGo(); // \ru взять данные и продвинуть итератор \en take the data and move the iterator List * GetList() const { return list; } Type& operator* () const { PRECONDITION(curr && curr->data ); return *curr->data; } - Type* operator () () const { return curr ? curr->data : c3d_null; } + Type* operator () () const { return curr ? curr->data : nullptr; } operator ListItem* () const { return curr; } operator ListItem& () const { PRECONDITION(curr); return *curr; } - Type* operator ++() { prev = curr; if (curr) {curr=curr->next; return curr ? curr->data : c3d_null;} else return c3d_null; } - Type* operator ++(int) { prev = curr; if (curr) {Type* ret=curr->data; curr=curr->next; return ret;} else return c3d_null; } - Type* operator --() { PRECONDITION(list); curr=prev; prev=list->findPrev(prev); return curr ? curr->data : c3d_null; } - Type* operator --(int) { PRECONDITION(list); if (curr) {Type* ret=curr->data; curr=prev; prev=list->findPrev(prev); return ret;} else return c3d_null; } - Type* operator ->() { return curr ? curr->data : c3d_null; } + Type* operator ++() { prev = curr; if (curr) {curr=curr->next; return curr ? curr->data : nullptr;} else return nullptr; } + Type* operator ++(int) { prev = curr; if (curr) {Type* ret=curr->data; curr=curr->next; return ret;} else return nullptr; } + Type* operator --() { PRECONDITION(list); curr=prev; prev=list->findPrev(prev); return curr ? curr->data : nullptr; } + Type* operator --(int) { PRECONDITION(list); if (curr) {Type* ret=curr->data; curr=prev; prev=list->findPrev(prev); return ret;} else return nullptr; } + Type* operator ->() { return curr ? curr->data : nullptr; } bool operator == ( const LIterator &o ) const { return list==o.list && curr==o.curr; } bool operator != ( const LIterator &o ) const { return ! operator == (o); } @@ -258,7 +258,7 @@ public: void Remove( DelType = defDelete ); // \ru удалить элемент списка и продвинуть вперед \en delete an element from the list and move forward void Detach(); // \ru отсоединить элемент списка \en detach an element from the list - bool IsOK() const { return curr != c3d_null; } + bool IsOK() const { return curr != nullptr; } ListItem * Next() const { PRECONDITION(curr); return curr->next; } void Go() { prev = curr; if ( curr ) curr = curr->next; } void GoLast() { PRECONDITION(list); curr = list->last; prev = list->findPrev(curr); } @@ -279,7 +279,7 @@ public: //--- template inline List::~List() { - PRECONDITION( nowDelItem == c3d_null && nowDelElem == c3d_null ); + PRECONDITION( nowDelItem == nullptr && nowDelElem == nullptr ); Remove(); } @@ -290,7 +290,7 @@ inline List::~List() { //--- template inline void List::Add( Type* data ) { - PRECONDITION( nowDelItem == c3d_null && nowDelElem == c3d_null ); + PRECONDITION( nowDelItem == nullptr && nowDelElem == nullptr ); if ( last ) last = new ListItem( data, *last ); @@ -306,7 +306,7 @@ inline void List::Add( Type* data ) { //--- template inline void List::Add( Type* data, const Type* after ) { - PRECONDITION( nowDelItem == c3d_null && nowDelElem == c3d_null ); + PRECONDITION( nowDelItem == nullptr && nowDelElem == nullptr ); add_to_list( *this, data, after ); } @@ -318,7 +318,7 @@ inline void List::Add( Type* data, const Type* after ) { template inline void List::Add( Type * data, bool /*check*/ ) { - PRECONDITION( nowDelItem == c3d_null && nowDelElem == c3d_null ); + PRECONDITION( nowDelItem == nullptr && nowDelElem == nullptr ); if ( !IsExist(data) ) Add( data ); } @@ -330,8 +330,8 @@ inline void List::Add( Type * data, bool /*check*/ ) template inline void List::Add( ListItem & item ) { - PRECONDITION( nowDelItem == c3d_null && nowDelElem == c3d_null ); - item.next = c3d_null; + PRECONDITION( nowDelItem == nullptr && nowDelElem == nullptr ); + item.next = nullptr; if ( last ) last->next = &item; @@ -350,7 +350,7 @@ inline void List::Add( ListItem & item ) template inline void List::AddAndEat( List & list ) { - PRECONDITION( nowDelItem == c3d_null && nowDelElem == c3d_null ); + PRECONDITION( nowDelItem == nullptr && nowDelElem == nullptr ); if ( list.first ) { @@ -365,7 +365,7 @@ inline void List::AddAndEat( List & list ) count += list.count; list.count = 0; - list.first = list.last = c3d_null; + list.first = list.last = nullptr; } } @@ -376,7 +376,7 @@ inline void List::AddAndEat( List & list ) template inline void List::Insert( Type * data ) { - PRECONDITION( nowDelItem == c3d_null && nowDelElem == c3d_null ); + PRECONDITION( nowDelItem == nullptr && nowDelElem == nullptr ); Insert( *new ListItem(data) ); } @@ -387,7 +387,7 @@ inline void List::Insert( Type * data ) template inline void List::Insert( ListItem & item ) { - PRECONDITION( nowDelItem == c3d_null && nowDelElem == c3d_null ); + PRECONDITION( nowDelItem == nullptr && nowDelElem == nullptr ); ListItem* old = first; @@ -407,7 +407,7 @@ inline void List::Insert( ListItem & item ) template inline void List::InsertAndEat( List & list ) { - PRECONDITION( nowDelItem == c3d_null && nowDelElem == c3d_null ); + PRECONDITION( nowDelItem == nullptr && nowDelElem == nullptr ); if ( list.first ) { if ( first ) { @@ -422,7 +422,7 @@ inline void List::InsertAndEat( List & list ) count += list.count; list.count = 0; - list.first = list.last = c3d_null; + list.first = list.last = nullptr; } } @@ -433,13 +433,13 @@ inline void List::InsertAndEat( List & list ) template inline bool List::Remove( Type * del, DelType shdl ) { - PRECONDITION( nowDelItem == c3d_null && nowDelElem == c3d_null ); + PRECONDITION( nowDelItem == nullptr && nowDelElem == nullptr ); if ( Detach(del) ) { if ( shdl==Delete || (shdl==defDelete && owns) ) { nowDelElem = del; delete del; - nowDelElem = c3d_null; + nowDelElem = nullptr; } return true; @@ -455,7 +455,7 @@ inline bool List::Remove( Type * del, DelType shdl ) template inline void List::Close() { - PRECONDITION( nowDelItem == c3d_null && nowDelElem == c3d_null ); + PRECONDITION( nowDelItem == nullptr && nowDelElem == nullptr ); if ( last ) last->next = first; } @@ -467,9 +467,9 @@ inline void List::Close() template inline void List::Split() { - PRECONDITION( nowDelItem == c3d_null && nowDelElem == c3d_null ); + PRECONDITION( nowDelItem == nullptr && nowDelElem == nullptr ); if ( last ) - last->next = c3d_null; + last->next = nullptr; } @@ -485,7 +485,7 @@ inline void List::Split() template inline Type * LIterator::GetDataAndGo() { - PRECONDITION( list && list->nowDelItem == c3d_null && list->nowDelElem == c3d_null ); + PRECONDITION( list && list->nowDelItem == nullptr && list->nowDelElem == nullptr ); if ( curr ) { Type * ret = curr->data; @@ -494,7 +494,7 @@ inline Type * LIterator::GetDataAndGo() return ret; } - return c3d_null; + return nullptr; } @@ -504,7 +504,7 @@ inline Type * LIterator::GetDataAndGo() template inline void LIterator::Add( Type * data ) { - PRECONDITION( list && list->nowDelItem == c3d_null && list->nowDelElem == c3d_null ); + PRECONDITION( list && list->nowDelItem == nullptr && list->nowDelElem == nullptr ); if ( list ) { if ( curr ) { @@ -525,7 +525,7 @@ inline void LIterator::Add( Type * data ) template inline void LIterator::AddAndEat( List & l ) { - PRECONDITION( list && list->nowDelItem == c3d_null && list->nowDelElem == c3d_null ); + PRECONDITION( list && list->nowDelItem == nullptr && list->nowDelElem == nullptr ); if ( list && l.first ) { @@ -539,7 +539,7 @@ inline void LIterator::AddAndEat( List & l ) list->count += l.count; l.count = 0; - l.first = l.last = c3d_null; + l.first = l.last = nullptr; } else list->AddAndEat( l ); // \ru съесть список l в конец данного списка \en destroy a list l and add it to the end of the given list @@ -553,7 +553,7 @@ inline void LIterator::AddAndEat( List & l ) template inline void LIterator::Insert( Type * data ) { - PRECONDITION( list && list->nowDelItem == c3d_null && list->nowDelElem == c3d_null ); + PRECONDITION( list && list->nowDelItem == nullptr && list->nowDelElem == nullptr ); if ( list ) { if ( prev ) { @@ -577,7 +577,7 @@ inline void LIterator::Insert( Type * data ) template inline void LIterator::InsertAndEat( List & l ) { - PRECONDITION( list && list->nowDelItem == c3d_null && list->nowDelElem == c3d_null ); + PRECONDITION( list && list->nowDelItem == nullptr && list->nowDelElem == nullptr ); if ( list && l.first ) { @@ -590,7 +590,7 @@ inline void LIterator::InsertAndEat( List & l ) list->count += l.count; l.count = 0; - l.first = l.last = c3d_null; + l.first = l.last = nullptr; } else list->InsertAndEat( l ); // \ru съесть список l в конец данного списка \en destroy a list l and add it to the end of the given list @@ -604,13 +604,13 @@ inline void LIterator::InsertAndEat( List & l ) template inline void LIterator::Remove( DelType shdl ) { - PRECONDITION( list && list->nowDelItem == c3d_null && list->nowDelElem == c3d_null ); + PRECONDITION( list && list->nowDelItem == nullptr && list->nowDelElem == nullptr ); if ( list && curr ) { if ( shdl==Delete || (shdl==defDelete && list->owns) ) { list->nowDelElem = curr->data; delete curr->data; - list->nowDelElem = c3d_null; + list->nowDelElem = nullptr; } Detach(); @@ -624,7 +624,7 @@ inline void LIterator::Remove( DelType shdl ) template inline void LIterator::Detach() { - PRECONDITION( list && list->nowDelItem == c3d_null && list->nowDelElem == c3d_null ); + PRECONDITION( list && list->nowDelItem == nullptr && list->nowDelElem == nullptr ); if ( list && curr ) { ListItem* next = curr->next; @@ -639,7 +639,7 @@ inline void LIterator::Detach() list->nowDelItem = curr; delete curr; - list->nowDelItem = c3d_null; + list->nowDelItem = nullptr; curr = next; prev = list->findPrev( curr ); @@ -652,7 +652,7 @@ inline void LIterator::Detach() template void add_to_list( List & list, Type * data, const Type * after ) { - PRECONDITION( list.nowDelItem == c3d_null && list.nowDelElem == c3d_null ); + PRECONDITION( list.nowDelItem == nullptr && list.nowDelElem == nullptr ); if ( after ) { ListItem *c = list.first; @@ -678,8 +678,8 @@ void add_to_list( List & list, Type * data, const Type * after ) template void add_to_list( List & to, List & from ) { - PRECONDITION( to.nowDelItem == c3d_null && to.nowDelElem == c3d_null ); - PRECONDITION( from.nowDelItem == c3d_null && from.nowDelElem == c3d_null ); + PRECONDITION( to.nowDelItem == nullptr && to.nowDelElem == nullptr ); + PRECONDITION( from.nowDelItem == nullptr && from.nowDelElem == nullptr ); ListItem *curr = from.first; while ( curr ) { @@ -696,8 +696,8 @@ void add_to_list( List & to, List & from ) template void insert_to_list( List & to, List & from ) { - PRECONDITION( to.nowDelItem == c3d_null && to.nowDelElem == c3d_null ); - PRECONDITION( from.nowDelItem == c3d_null && from.nowDelElem == c3d_null ); + PRECONDITION( to.nowDelItem == nullptr && to.nowDelElem == nullptr ); + PRECONDITION( from.nowDelItem == nullptr && from.nowDelElem == nullptr ); ListItem *curr = from.first; while ( curr ) { @@ -716,13 +716,13 @@ void insert_to_list( List & to, List & from ) template void remove_from_list( List & list, DelType shdl ) { - PRECONDITION( list.nowDelItem == c3d_null && list.nowDelElem == c3d_null ); + PRECONDITION( list.nowDelItem == nullptr && list.nowDelElem == nullptr ); bool del = shdl==Delete || (shdl==defDelete && list.owns); ListItem *first = list.first; - list.first = c3d_null; - list.last = c3d_null; + list.first = nullptr; + list.last = nullptr; list.count = 0; while ( first ) { ListItem *temp = first; @@ -731,12 +731,12 @@ void remove_from_list( List & list, DelType shdl ) if ( del ) { list.nowDelElem = temp->data; delete temp->data; - list.nowDelElem = c3d_null; + list.nowDelElem = nullptr; } list.nowDelItem = temp; delete temp; - list.nowDelItem = c3d_null; + list.nowDelItem = nullptr; } } @@ -747,11 +747,11 @@ void remove_from_list( List & list, DelType shdl ) template void remove_from_list_release( List & list ) { - PRECONDITION( list.nowDelItem == c3d_null && list.nowDelElem == c3d_null ); + PRECONDITION( list.nowDelItem == nullptr && list.nowDelElem == nullptr ); ListItem *first = list.first; - list.first = c3d_null; - list.last = c3d_null; + list.first = nullptr; + list.last = nullptr; list.count = 0; while ( first ) { ListItem *temp = first; @@ -760,11 +760,11 @@ void remove_from_list_release( List & list ) list.nowDelElem = temp->data; if ( temp->data ) temp->data->Release(); - list.nowDelElem = c3d_null; + list.nowDelElem = nullptr; list.nowDelItem = temp; delete temp; - list.nowDelItem = c3d_null; + list.nowDelItem = nullptr; } } @@ -776,8 +776,8 @@ template size_t remove_from_list( List & list, List & deList, DelType shdl ) { PRECONDITION( &list != &deList ); - PRECONDITION( list.nowDelItem == c3d_null && list.nowDelElem == c3d_null ); - PRECONDITION( deList.nowDelItem == c3d_null && deList.nowDelElem == c3d_null ); + PRECONDITION( list.nowDelItem == nullptr && list.nowDelElem == nullptr ); + PRECONDITION( deList.nowDelItem == nullptr && deList.nowDelElem == nullptr ); if ( !list.first || !deList.first ) // \ru какой-то из списков пуст ! \en one of the lists is empty ! return 0; @@ -788,7 +788,7 @@ size_t remove_from_list( List & list, List & deList, DelType shdl ) ListItem *curr = list.first; // \ru начнем сначала \en start from the beginning ListItem *prev = list.last; ListItem *del = deList.first; // \ru текущий удаляемый \en the current deleted - ListItem *pdel = c3d_null; // \ru предыдущий удаляемый \en the previous deleted + ListItem *pdel = nullptr; // \ru предыдущий удаляемый \en the previous deleted size_t deleted = 0; // \ru отцепленных 0 \en there are 0 detached while( del && list.first ) { // \ru есть еще пока чего удалять и откуда \en there are elements to delete @@ -801,8 +801,8 @@ size_t remove_from_list( List & list, List & deList, DelType shdl ) if ( list.first == list.last ) { // \ru если всего один элемент, то ничего не останется \en if there is only one element then nothing will be left list.count = 0; - list.first = c3d_null; - list.last = c3d_null; + list.first = nullptr; + list.last = nullptr; // \ru curr продвигать не нужно - все равно заканчиваем \en 'curr' should not be moved } else { @@ -820,12 +820,12 @@ size_t remove_from_list( List & list, List & deList, DelType shdl ) if ( willDel ) { // \ru если надо - удалим данные \en delete the data if it is necessary list.nowDelElem = condemned->data; delete condemned->data; - list.nowDelElem = c3d_null; + list.nowDelElem = nullptr; } list.nowDelItem = condemned; delete condemned; // \ru удалим квартиру \en delete condemned - list.nowDelItem = c3d_null; + list.nowDelItem = nullptr; deleted++; // \ru еще один удалили \en another one has been deleted break; @@ -849,7 +849,7 @@ size_t remove_from_list( List & list, List & deList, DelType shdl ) deList.nowDelItem = del; delete del; // \ru помним, что данные мы уже удалили \en remember that the data has already been deleted - deList.nowDelItem = c3d_null; + deList.nowDelItem = nullptr; deList.count--; } @@ -860,7 +860,7 @@ size_t remove_from_list( List & list, List & deList, DelType shdl ) } if ( list.last ) - list.last->next = c3d_null; // \ru разорвать список \en split the list + list.last->next = nullptr; // \ru разорвать список \en split the list return deleted; } @@ -870,10 +870,10 @@ size_t remove_from_list( List & list, List & deList, DelType shdl ) template bool detach_from_list( List & from, const Type * del ) { - PRECONDITION( from.nowDelItem == c3d_null && from.nowDelElem == c3d_null ); + PRECONDITION( from.nowDelItem == nullptr && from.nowDelElem == nullptr ); ListItem* curr = from.first; - ListItem* prev = c3d_null; + ListItem* prev = nullptr; while( curr ) { if ( curr->data == del ) { // \ru нашли \en found @@ -888,7 +888,7 @@ bool detach_from_list( List & from, const Type * del ) from.nowDelItem = curr; delete curr; - from.nowDelItem = c3d_null; + from.nowDelItem = nullptr; from.count--; return true; @@ -907,7 +907,7 @@ bool detach_from_list( List & from, const Type * del ) template size_t recalc_list( List & list ) { - PRECONDITION( list.nowDelItem == c3d_null && list.nowDelElem == c3d_null ); + PRECONDITION( list.nowDelItem == nullptr && list.nowDelElem == nullptr ); list.count = 0; ListItem *curr = list.first; @@ -923,7 +923,7 @@ size_t recalc_list( List & list ) template bool is_exist_in_list( const List & list, const Type * what ) { - PRECONDITION( list.nowDelItem == c3d_null && list.nowDelElem == c3d_null ); + PRECONDITION( list.nowDelItem == nullptr && list.nowDelElem == nullptr ); bool exist = false; ListItem * curr = list.first; @@ -940,7 +940,7 @@ bool is_exist_in_list( const List & list, const Type * what ) template ListItem * find_prev_in_list( const List & list, ListItem * now ) { - PRECONDITION( list.nowDelItem == c3d_null && list.nowDelElem == c3d_null ); + PRECONDITION( list.nowDelItem == nullptr && list.nowDelElem == nullptr ); if ( now ) { ListItem *tmp = list.first; @@ -949,7 +949,7 @@ ListItem * find_prev_in_list( const List & list, ListItem * no return tmp; } - return c3d_null; + return nullptr; } diff --git a/C3d/Include/templ_s_queue.h b/C3d/Include/templ_s_queue.h index 20b96ad..8dfe77e 100644 --- a/C3d/Include/templ_s_queue.h +++ b/C3d/Include/templ_s_queue.h @@ -113,17 +113,17 @@ private: // --- template SQueue::SQueue( size_t capacity ) - : data( c3d_null ) - , qlast( c3d_null ) - , qp1( c3d_null ) - , qp2( c3d_null ) + : data( nullptr ) + , qlast( nullptr ) + , qp1( nullptr ) + , qp2( nullptr ) { if ( capacity > 0 ) { try { data = new Type[capacity]; } catch ( const std::bad_alloc & ) { - data = c3d_null; + data = nullptr; throw; } } @@ -212,7 +212,7 @@ inline Type & SQueue::First() const template inline bool SQueue::IsFull() const { - return data == c3d_null || _IncPtr( qp2 ) == qp1; + return data == nullptr || _IncPtr( qp2 ) == qp1; } @@ -336,7 +336,7 @@ bool SQueue::_NewCapacity( size_t max_len, bool clear ) { try { delete [] data; - data = qlast = qp1 = qp2 = c3d_null; + data = qlast = qp1 = qp2 = nullptr; if ( max_len > 0 ) { data = new Type[max_len]; qlast = data + max_len - 1; @@ -344,7 +344,7 @@ bool SQueue::_NewCapacity( size_t max_len, bool clear ) } } catch ( ... ) { - data = qlast = qp1 = qp2 = c3d_null; + data = qlast = qp1 = qp2 = nullptr; C3D_CONTROLED_THROW; return false; } @@ -352,7 +352,7 @@ bool SQueue::_NewCapacity( size_t max_len, bool clear ) else { PRECONDITION( qp1 != qp2 && max_len>0 && clear == false ); // \ru Выражение обязано быть истинным \en The expression should be true - Type * n_data = c3d_null; + Type * n_data = nullptr; try { n_data = new Type[max_len]; if ( qp1 < qp2 ) // \ru Вариант без фрагментации \en A variant without fragmentation diff --git a/C3d/Include/templ_sfdp_array.h b/C3d/Include/templ_sfdp_array.h index 79d0277..fcd39b1 100644 --- a/C3d/Include/templ_sfdp_array.h +++ b/C3d/Include/templ_sfdp_array.h @@ -145,8 +145,8 @@ using RPArray::back; \en Find the index of the element using the comparison function. \details \ru Найти индекс элемента, используя функцию сравнения. \en Find the index of the element using the comparison function. - \return \ru Вернет точно найденный элемент или c3d_null, если элемент не найден. - \en Returns the found element or c3d_null, if element not found. + \return \ru Вернет точно найденный элемент или nullptr, если элемент не найден. + \en Returns the found element or nullptr, if element not found. */ Type * FindExact ( const Type & el ) const; @@ -240,7 +240,7 @@ inline SFDPArray::~SFDPArray() {} // --- template bool SFDPArray::Init( const SFDPArray & other ) { - PRECONDITION( FDPArray::nowDeletedElem == c3d_null ); // \ru ЯТ - временно \en ЯТ - temporarily + PRECONDITION( FDPArray::nowDeletedElem == nullptr ); // \ru ЯТ - временно \en ЯТ - temporarily Flush(); // \ru сбросить себя \en reset itself @@ -253,7 +253,7 @@ bool SFDPArray::Init( const SFDPArray & other ) { // --- template inline size_t SFDPArray::AddTry( Type& ent, Type *&found ) { - PRECONDITION( FDPArray::nowDeletedElem == c3d_null ); // \ru ЯТ - временно \en ЯТ - temporarily + PRECONDITION( FDPArray::nowDeletedElem == nullptr ); // \ru ЯТ - временно \en ЯТ - temporarily // \ru CatchMemory(); ЯТ \en CatchMemory(); ЯТ bool added = true; @@ -267,10 +267,10 @@ inline size_t SFDPArray::AddTry( Type& ent, Type *&found ) { // --- template inline bool SFDPArray::AddExact( Type& ent ) { - PRECONDITION( FDPArray::nowDeletedElem == c3d_null ); // \ru ЯТ - временно \en ЯТ - temporarily + PRECONDITION( FDPArray::nowDeletedElem == nullptr ); // \ru ЯТ - временно \en ЯТ - temporarily // \ru CatchMemory(); ЯТ \en CatchMemory(); ЯТ - Type * found = c3d_null; + Type * found = nullptr; bool added = true; add_to_array( *this, ent, found, added ); return ( &ent == found ); // \ru вернет true - добавлен, false - не добавлен \en if returns true then the element has been added, it has not been added otherwise @@ -283,10 +283,10 @@ inline bool SFDPArray::AddExact( Type& ent ) { // --- template inline bool SFDPArray::AddIfNotExist( Type& ent ) { - PRECONDITION( FDPArray::nowDeletedElem == c3d_null ); // \ru ЯТ - временно \en ЯТ - temporarily + PRECONDITION( FDPArray::nowDeletedElem == nullptr ); // \ru ЯТ - временно \en ЯТ - temporarily // \ru CatchMemory(); ЯТ \en CatchMemory(); ЯТ - Type * found = c3d_null; + Type * found = nullptr; bool added = true; add_to_array( *this, ent, found, added ); return ( added ); // \ru вернет true - добавлен, false - не добавлен \en if returns true then the element has been added, it has not been added otherwise @@ -298,7 +298,7 @@ inline bool SFDPArray::AddIfNotExist( Type& ent ) { // --- template inline size_t SFDPArray::FindNearest( const Type &el, Type *&found ) const { - PRECONDITION( FDPArray::nowDeletedElem == c3d_null ); // \ru ЯТ - временно \en ЯТ - temporarily + PRECONDITION( FDPArray::nowDeletedElem == nullptr ); // \ru ЯТ - временно \en ЯТ - temporarily return find_in_array( *this, el, found ); } @@ -309,10 +309,10 @@ inline size_t SFDPArray::FindNearest( const Type &el, Type *&found ) const // --- template inline Type * SFDPArray::FindExact( const Type &el ) const { - PRECONDITION( FDPArray::nowDeletedElem == c3d_null ); // \ru ЯТ - временно \en ЯТ - temporarily - Type * found = c3d_null; + PRECONDITION( FDPArray::nowDeletedElem == nullptr ); // \ru ЯТ - временно \en ЯТ - temporarily + Type * found = nullptr; size_t foundInd = find_in_array( *this, el, found ); - return ( foundInd != SYS_MAX_T ) ? found : c3d_null; + return ( foundInd != SYS_MAX_T ) ? found : nullptr; } @@ -321,13 +321,13 @@ inline Type * SFDPArray::FindExact( const Type &el ) const { // --- template inline Type* SFDPArray::RemoveObj( Type *delObject, DelType del ) { - PRECONDITION( FDPArray::nowDeletedElem == c3d_null ); // \ru ЯТ - временно \en ЯТ - temporarily + PRECONDITION( FDPArray::nowDeletedElem == nullptr ); // \ru ЯТ - временно \en ЯТ - temporarily if ( !delObject ) - return c3d_null; + return nullptr; - Type * found = c3d_null; + Type * found = nullptr; size_t i = find_in_array( *this, *delObject, found ); - return ( i != SYS_MAX_T ) ? RemoveInd(i, del) : c3d_null; + return ( i != SYS_MAX_T ) ? RemoveInd(i, del) : nullptr; } @@ -338,7 +338,7 @@ template inline bool SFDPArray::DetachObj( const Type *delObject ) { if ( !delObject ) return false; - Type * found = c3d_null; + Type * found = nullptr; size_t i = find_in_array( *this, *delObject, found ); if ( i != SYS_MAX_T ) { @@ -355,8 +355,8 @@ inline bool SFDPArray::DetachObj( const Type *delObject ) { // --- template inline bool SFDPArray::IsExist( const Type &el ) const { - PRECONDITION( FDPArray::nowDeletedElem == c3d_null ); // \ru ЯТ - временно \en ЯТ - temporarily - Type * found = c3d_null; + PRECONDITION( FDPArray::nowDeletedElem == nullptr ); // \ru ЯТ - временно \en ЯТ - temporarily + Type * found = nullptr; return find_in_array( *this, el, found ) != SYS_MAX_T; } @@ -513,7 +513,7 @@ size_t find_in_array( const SFDPArray& arr, const Type& el, Type *&found ) // --- template size_t SFDPArray::SearchIt ( size_t data, typename SFDPArray::SearchFunc fSearch, Type *&found ) const { - PRECONDITION( FDPArray::nowDeletedElem == c3d_null ); // \ru ЯТ - временно \en ЯТ - temporarily + PRECONDITION( FDPArray::nowDeletedElem == nullptr ); // \ru ЯТ - временно \en ЯТ - temporarily PRECONDITION( fSearch ); // \ru без функции сравнения массив бессмысленен \en the array is useless without comparison function if ( !FDPArray::count ) diff --git a/C3d/Include/templ_sfp_array.h b/C3d/Include/templ_sfp_array.h index 8cb8b3b..75c264c 100644 --- a/C3d/Include/templ_sfp_array.h +++ b/C3d/Include/templ_sfp_array.h @@ -180,10 +180,10 @@ inline Type * SFPArray::FindByKey( void * key, size_t & index ) { // --- template inline Type * SFPArray::RemoveObj( Type *delObject, DelType del ) { - PRECONDITION( PArray::nowDeletedElem == c3d_null ); // \ru Bременно, для отладки \en Temporarily, for debugging + PRECONDITION( PArray::nowDeletedElem == nullptr ); // \ru Bременно, для отладки \en Temporarily, for debugging ::qp_sort( *this, false ); size_t i = find_in_array( *this, delObject ); - return ( i != SYS_MAX_T ) ? RemoveInd(i, del) : c3d_null; + return ( i != SYS_MAX_T ) ? RemoveInd(i, del) : nullptr; } @@ -425,14 +425,14 @@ Type * find_from_array_by_key( const SFPArray & arr, void * key, size_t & res = (*arr.fSearch_m)( arr[0], key ); switch ( res ) { case 0 : index = 0; return arr[0]; - case 1 : index = SYS_MAX_T; return c3d_null; + case 1 : index = SYS_MAX_T; return nullptr; case -1 : break; } res = (*arr.fSearch_m)( arr[mxc], key ); switch ( res ) { case 0 : index = mxc; return arr[mxc]; - default : index = SYS_MAX_T; return c3d_null; + default : index = SYS_MAX_T; return nullptr; } } else { @@ -440,14 +440,14 @@ Type * find_from_array_by_key( const SFPArray & arr, void * key, size_t & for( size_t i = 0, count = (size_t)arr.count; i < count; i++ ) { switch ( (*arr.fSearch_m)( arr[i], key ) ) { case 0 : index = i; return arr[i]; - case 1 : index = SYS_MAX_T; return c3d_null; + case 1 : index = SYS_MAX_T; return nullptr; case -1 : break; } } } index = SYS_MAX_T; - return c3d_null; + return nullptr; } diff --git a/C3d/Include/templ_sp_array.h b/C3d/Include/templ_sp_array.h index 4f139d8..25848ae 100644 --- a/C3d/Include/templ_sp_array.h +++ b/C3d/Include/templ_sp_array.h @@ -150,9 +150,9 @@ inline bool SPArray::IsExist( const Type * el ) const { template inline Type * SPArray::RemoveObj( Type * delObject, DelType del ) { - PRECONDITION( PArray::nowDeletedElem == c3d_null ); // \ru Bременно, для отладки \en Temporarily, for debugging + PRECONDITION( PArray::nowDeletedElem == nullptr ); // \ru Bременно, для отладки \en Temporarily, for debugging size_t i = find_from_array( *this, delObject ); - return ( i != SYS_MAX_T ) ? RemoveInd( i, del ) : c3d_null; + return ( i != SYS_MAX_T ) ? RemoveInd( i, del ) : nullptr; } @@ -172,8 +172,8 @@ inline size_t SPArray::PossibleIndex( const Type * el, bool & isPresent ) template Type * add_to_array( SPArray & arr, Type * el, size_t & indexEl ) { - if ( el == c3d_null ) // \ru LF_Linux: добавил проверку на c3d_null \en LF_Linux: added a check for c3d_null - return c3d_null; + if ( el == nullptr ) // \ru LF_Linux: добавил проверку на nullptr \en LF_Linux: added a check for nullptr + return nullptr; size_t mx = arr.count - 1; size_t mxc = mx; size_t mn = 0; @@ -286,7 +286,7 @@ size_t find_from_array_spec( const SPArray & arr, const Type * el, bool & { isPresent = false; - if ( el == c3d_null ) // \ru LF_Linux: добавил проверку на c3d_null \en LF_Linux: added a check for c3d_null + if ( el == nullptr ) // \ru LF_Linux: добавил проверку на nullptr \en LF_Linux: added a check for nullptr return SYS_MAX_T; if ( !arr.count || *el < *arr/*.parr*/[0] ) @@ -355,7 +355,7 @@ size_t find_from_array_spec( const SPArray & arr, const Type * el, bool & template size_t find_from_array( const SPArray & arr, const Type * el ) { - if ( el == c3d_null ) // \ru LF_Linux: добавил проверку на c3d_null \en LF_Linux: added a check for c3d_null + if ( el == nullptr ) // \ru LF_Linux: добавил проверку на nullptr \en LF_Linux: added a check for nullptr return SYS_MAX_T; // \ru общий случай - элементов больше 11 //LF_Linux: откуда 11??? \en the common case - the number of elements is more than 11 //LF_Linux: why 11?? if ( arr.count > 11 ) { diff --git a/C3d/Include/templ_sparse_array2.h b/C3d/Include/templ_sparse_array2.h index bc6cbf9..34e286a 100644 --- a/C3d/Include/templ_sparse_array2.h +++ b/C3d/Include/templ_sparse_array2.h @@ -506,7 +506,7 @@ inline SparseArray2 * SparseArray2::Create( size_t lsz, size_t csz ) { if ( lsz*csz <= c3d::MATRIX_MAX_COUNT ) return new SparseMatrix( lsz, csz ); - return c3d_null; + return nullptr; } @@ -554,7 +554,7 @@ inline bool SparseArray2::SetElem( size_t ln, size_t cn, const Type & item template inline SparseArray2 & SparseArray2::SetZero() { - std::for_each( data.begin(), data.end(), c3d_mem_fun_ref( &SparseRow::Clear ) ); + std::for_each( data.begin(), data.end(), std::mem_fn( &SparseRow::Clear ) ); return *this; } @@ -607,7 +607,7 @@ inline bool SparseArray2::NzIndices( size_t ln, const NumberRange & search template inline void SparseArray2::NzUpdate() { - std::for_each( data.begin(), data.end(), c3d_mem_fun_ref( &SparseRow::NzUpdate ) ); + std::for_each( data.begin(), data.end(), std::mem_fn( &SparseRow::NzUpdate ) ); } diff --git a/C3d/Include/templ_sptr.h b/C3d/Include/templ_sptr.h index 81d5924..ad5a80d 100644 --- a/C3d/Include/templ_sptr.h +++ b/C3d/Include/templ_sptr.h @@ -15,14 +15,14 @@ //------------------------------------------------------------------------------ -/** \brief \ru Отладочная проверка на c3d_null. - \en Debug check for c3d_null. \~ - \details \ru Отладочная проверка на c3d_null. \n - \en Debug check for c3d_null. \n \~ +/** \brief \ru Отладочная проверка на nullptr. + \en Debug check for nullptr. \~ + \details \ru Отладочная проверка на nullptr. \n + \en Debug check for nullptr. \n \~ \ingroup Base_Tools_SmartPointers */ // --- -#define NULL_CHECK PRECONDITION( m_pI != c3d_null ); +#define NULL_CHECK PRECONDITION( m_pI != nullptr ); //------------------------------------------------------------------------------ @@ -42,18 +42,21 @@ class SPtr public: /// \ru Конструктор. \en Constructor. - SPtr () : m_pI( c3d_null ) {} + SPtr () : m_pI( nullptr ) {} + + /// \ru Конструктор по нулевому указателю. \en Constructor by the null pointer. + SPtr( std::nullptr_t ) : m_pI( nullptr ) {} /// \ru Конструктор по указателю. \en Constructor by pointer. explicit SPtr ( T * elem ) { - if ( (m_pI = elem) != c3d_null ) + if ( (m_pI = elem) != nullptr ) m_pI->AddRef(); } /// \ru Конструктор копирования. \en Copy constructor. - SPtr( const SPtr & ptr ) : m_pI( c3d_null ) { assign(ptr.m_pI); } // SKIP_SA + SPtr( const SPtr & ptr ) : m_pI( nullptr ) { assign(ptr.m_pI); } // SKIP_SA /// \ru Конструктор по совместимому указателю \en Constructor by compatible pointer template - SPtr( const SPtr<_T> & ptr ) : m_pI( c3d_null ) { assign(ptr.get()); } + SPtr( const SPtr<_T> & ptr ) : m_pI( nullptr ) { assign(ptr.get()); } /// \ru Деструктор. \en Destructor. ~SPtr() { reset(); } @@ -101,17 +104,31 @@ public: // \ru Перегрузка операторов \en Operators overloadi public: /// \ru Функция присваивания указателем. \en A function of assignment by pointer. - SPtr & assign( T * elem ); - /// \ru Функция освобождения объекта. \en A function of release an object. - SPtr & reset( void ) { if( m_pI != c3d_null ) { m_pI->Release(); m_pI = c3d_null; } return *this; } // SKIP_SA + template + SPtr & assign( _T * elem ) + { + if ( m_pI != elem ) + { + if ( elem != nullptr ) { elem->AddRef(); } // SKIP_SA + if ( m_pI != nullptr ) { m_pI->Release(); } // SKIP_SA + m_pI = elem; + } + return *this; // SKIP_SA + } + /// \ru Функция присваивания указателем. \en A function of assignment by pointer. + template + SPtr & assign( const SPtr<_T> & elem ) { return assign( elem.get() ); } + /// \ru Функция освобождения объекта. \en A function of release an object. + SPtr & assign( std::nullptr_t ) { return reset(); } + /// \ru Функция освобождения объекта. \en A function of release an object. + SPtr & reset( void ) { if ( m_pI != nullptr ) { m_pI->Release(); m_pI = nullptr; } return *this; } // SKIP_SA /// \ru Функция доступа к элементу данных. \en A function of access to data element. T * get() const { return m_pI; } // SKIP_SA /// \ru Функция отсоединяет объект. \en A function detaches an object. - T * detach() { T * obj = m_pI; m_pI = c3d_null; if ( obj != c3d_null ) obj->DecRef(); return obj; } // SKIP_SA + T * detach() { T * obj = m_pI; m_pI = nullptr; if ( obj != nullptr ) obj->DecRef(); return obj; } // SKIP_SA /// \ru Нулевой указатель? \en Is null pointer? - bool is_null() const { return (( c3d_null == m_pI ) ? true : false ); } + bool is_null() const { return nullptr == m_pI; } -#ifdef C3D_STANDARD_CXX_11_PARTIAL public: /// \ru Конструктор перемещения. \en Moving constructor. SPtr( SPtr && src ) : m_pI ( src.m_pI ) @@ -126,34 +143,23 @@ public: src.m_pI = tmp; return *this; } -#endif // C3D_STANDARD_CXX_11_PARTIAL }; //------------------------------------------------------------------------------ // \ru Функция присваивания указателем \en A function of assignment by pointer. // --- -template -inline SPtr & SPtr::assign( T * elem ) -{ - if ( m_pI != elem ) - { - if ( elem != c3d_null ) { elem->AddRef(); } // SKIP_SA - if ( m_pI != c3d_null ) { m_pI->Release(); } // SKIP_SA - m_pI = elem; - } - return *this; -} + //------------------------------------------------------------------------------ /** \brief \ru Автоматическая ссылка на объекты с подсчетом ссылок. \en Smart reference to objects with reference counter. \~ \details \ru Автоматическая ссылка (smart reference) на объекты с подсчетом ссылок. - Фактически тоже самое, что и SPtr, но без возможности равенства c3d_null.\n + Фактически тоже самое, что и SPtr, но без возможности равенства nullptr.\n Требует от параметра шаблона реализации функций AddRef() и Release(). \n \en Smart reference to objects with reference counter. - Actually it is the same as SPtr but without the possibility of equality to c3d_null \n + Actually it is the same as SPtr but without the possibility of equality to nullptr \n It requires Implementation of functions AddRef() and Release() from the template parameter. \n \~ \ingroup Base_Tools_SmartPointers */ diff --git a/C3d/Include/templ_stack.h b/C3d/Include/templ_stack.h index 4acf739..9fbec5b 100644 --- a/C3d/Include/templ_stack.h +++ b/C3d/Include/templ_stack.h @@ -28,7 +28,7 @@ */ // --- template -class SStack c3d_final: private SArray +class SStack final: private SArray { public: /// \ru Конструктор. \en Constructor. @@ -37,7 +37,7 @@ public: {} public: void Push( const Type & obj ); ///< \ru Добавить элемент в стек. \en Add an element to the stack. - Type & Pop(); ///< \ru Извлечь один элемент стека, если возвращаетя c3d_null, значит достигнуто дно стека. \en Retrieve one element from the stack, if c3d_null is returned then the bottom of stack is reached. + Type & Pop(); ///< \ru Извлечь один элемент стека, если возвращаетя nullptr, значит достигнуто дно стека. \en Retrieve one element from the stack, if nullptr is returned then the bottom of stack is reached. Type & Top() const; ///< \ru Верхний элемент стека (последний внесенный). \en The top element of the stack (the last added). // \ru Оставить доступными следующие методы: \en Leave an access to the next methods: diff --git a/C3d/Include/templ_t_list.h b/C3d/Include/templ_t_list.h index e6d90f8..e9df91d 100644 --- a/C3d/Include/templ_t_list.h +++ b/C3d/Include/templ_t_list.h @@ -86,7 +86,7 @@ writer& operator << ( writer& out, const List& ref ) { // template reader& operator >> ( reader& in, List*& ptr ) { - ptr = c3d_null; + ptr = nullptr; if ( in.good() ) { if ( in.MathVersion() < 0x06000012L ) diff --git a/C3d/Include/tool_log.h b/C3d/Include/tool_log.h index 6a385e5..3cea65b 100644 --- a/C3d/Include/tool_log.h +++ b/C3d/Include/tool_log.h @@ -156,7 +156,7 @@ public: #ifdef C3D_DEBUG // \ru Параметр enable определяет, стартовать ли логирование. // \en The enable parameter defines whether to start logging. - LogHelper( bool enable = true, const TCHAR* file = c3d_null ); + LogHelper( bool enable = true, const TCHAR* file = nullptr ); // \ru Если в конструкторе было указано имя файла, то деструктор записывает накопленный лог в файл. // \en If a file name was defined in the contructor, the destructor writes the collected log to the file. \~ diff --git a/C3d/Include/tool_memory_debug.h b/C3d/Include/tool_memory_debug.h index ac4e5cd..66fe4ee 100644 --- a/C3d/Include/tool_memory_debug.h +++ b/C3d/Include/tool_memory_debug.h @@ -66,7 +66,7 @@ public: virtual void ReallocArrayStatistic( void * oldParr, size_t oldSize, void * newParr, size_t newSize, uint arrayType ) = 0; /// \ru Отчет по статистике изменений размера массива. \en A report by the statistics of array size changes. \~ \ingroup Base_Tools - virtual void ReallocReport( bool clear, const char * title = c3d_null ) = 0; + virtual void ReallocReport( bool clear, const char * title = nullptr ) = 0; }; @@ -242,7 +242,7 @@ inline void * ReallocArraySize( void * arr_parr, size_t newBytesCount, bool ) void * tmp_parr = ::realloc( arr_parr, newBytesCount ); #endif - PRECONDITION( newBytesCount == 0 || tmp_parr != c3d_null ); // \ru проверка на нехватку памяти в массивах \en check the memory deficit in arrays + PRECONDITION( newBytesCount == 0 || tmp_parr != nullptr ); // \ru проверка на нехватку памяти в массивах \en check the memory deficit in arrays #ifdef __MEMSET_USED_FREE_HEAP_HEAR__ if ( clear ) { diff --git a/C3d/Include/tool_multithreading.h b/C3d/Include/tool_multithreading.h index 2ae41f6..c8a5ced 100644 --- a/C3d/Include/tool_multithreading.h +++ b/C3d/Include/tool_multithreading.h @@ -222,19 +222,19 @@ class CacheManager : public CacheCleaner { bool _valid; List( unsigned int id, T* data ) : _id( id ), - _data( data != c3d_null ? data : new T() ), // Always _data != c3d_null. - _next( c3d_null ), + _data( data != nullptr ? data : new T() ), // Always _data != nullptr. + _next( nullptr ), _valid( true ) {} ~List() { - if ( _data != c3d_null ) + if ( _data != nullptr ) delete _data; - _data = c3d_null; - if ( _next != c3d_null ) // Also deletes linked List. + _data = nullptr; + if ( _next != nullptr ) // Also deletes linked List. delete _next; - _next = c3d_null; + _next = nullptr; } private: - List() : _id( 0 ), _data( c3d_null ), _next( c3d_null ) {} + List() : _id( 0 ), _data( nullptr ), _next( nullptr ) {} }; private: @@ -278,7 +278,7 @@ public: /** \brief \ru Функция очистки, используемая сборщиком мусора. \en Cleaning function, used by the garbage collector. \~ */ - virtual bool ResetCacheData() { CleanAll( true); return true; } + virtual bool ResetCacheData() { CleanAll( true, true ); return true; } /** \brief \ru Принудительное удаление всех кэшей (используется сборщиком мусора). \en Forced deletion of all caches (used by the garbage collector). \~ @@ -310,9 +310,9 @@ private: // --- template inline CacheManager::CacheManager( bool createLock ) - : longTerm ( c3d_null ) - , tcache ( c3d_null ) - , lock ( c3d_null ) + : longTerm ( nullptr ) + , tcache ( nullptr ) + , lock ( nullptr ) { if ( createLock ) lock = new CommonMutex(); @@ -325,11 +325,11 @@ inline CacheManager::CacheManager( bool createLock ) // --- template inline CacheManager::CacheManager( const CacheManager & item ) - : longTerm ( c3d_null ) - , tcache ( c3d_null ) - , lock ( c3d_null ) + : longTerm ( nullptr ) + , tcache ( nullptr ) + , lock ( nullptr ) { - if ( item.longTerm != c3d_null ) + if ( item.longTerm != nullptr ) longTerm = new T( *item.longTerm ); #ifndef CACHE_DELETE_LOCK lock = new CommonMutex(); @@ -344,9 +344,9 @@ template inline CacheManager::~CacheManager() { CleanAll( false, true ); - if ( longTerm != c3d_null ) + if ( longTerm != nullptr ) delete longTerm; - if ( lock != c3d_null ) + if ( lock != nullptr ) delete lock; } @@ -360,7 +360,7 @@ template inline T* CacheManager::LongTerm () { try { - if ( longTerm == c3d_null ) + if ( longTerm == nullptr ) longTerm = new T(); } catch ( const std::bad_alloc & ) { @@ -376,10 +376,10 @@ inline T* CacheManager::LongTerm () template inline CommonMutex* CacheManager::GetLockHard() { - if ( lock == c3d_null ) { + if ( lock == nullptr ) { CommonMutex* ll = GetGlobalLock(); ll->lock(); - if ( lock == c3d_null ) + if ( lock == nullptr ) lock = new CommonMutex(); ll->unlock(); } @@ -394,27 +394,27 @@ template inline T * CacheManager::operator()() { // \ru Создать данные по данным кэша главного потока. \en Create data using the data of the main thread cache. -#define INIT_BY_LONGTERM ( longTerm != c3d_null ? new T( *longTerm ) : new T() ) +#define INIT_BY_LONGTERM ( longTerm != nullptr ? new T( *longTerm ) : new T() ) if ( !IsSafeMultithreading() || !IsInParallel() ) { CleanAll( true ); return LongTerm(); } - T * res = c3d_null; + T * res = nullptr; unsigned int threadKey = GetThreadKey(); if ( FatalErrorHandler::HasError() ) return LongTerm(); - if ( tcache == c3d_null ) { + if ( tcache == nullptr ) { // \ru Подписаться на сборку мусора, так как используются многопоточные кэши. // \en Subscribe on garbage collection because using multithreaded caches. SubcribeOnCleaning(); { // \ru Используется блокировка при изменении списка кэшей. \en Use lock when changing the cache list. ScopedLock sl( GetLock(), false ); - if ( tcache == c3d_null ) { + if ( tcache == nullptr ) { try { tcache = new List( threadKey, INIT_BY_LONGTERM ); return tcache->_data; @@ -428,7 +428,7 @@ inline T * CacheManager::operator()() } List* entry = tcache; - while( entry != c3d_null ) { + while( entry != nullptr ) { if ( entry->_id == threadKey ) { if ( !entry->_valid ) { try { @@ -448,7 +448,7 @@ inline T * CacheManager::operator()() } // \ru Если кэш не найден в списке, 'entry' содержит последний (на данный момент) элемент в списке. // \en If cache not found in the list, 'entry' contains the last element in the list (at that point). - if ( entry->_next == c3d_null ) + if ( entry->_next == nullptr ) break; entry = entry->_next; } @@ -460,7 +460,7 @@ inline T * CacheManager::operator()() List * newList = new List( threadKey, res ); // \ru На данный момент, entry может быть не последним элементом в списке. // \en At that point, entry could be not a last element in the list. - while ( entry->_next != c3d_null ) { + while ( entry->_next != nullptr ) { entry = entry->_next; } entry->_next = newList; @@ -483,10 +483,10 @@ inline T * CacheManager::operator()() template inline void CacheManager::Reset( bool resetLongTerm ) { - if ( tcache != c3d_null ) { + if ( tcache != nullptr ) { ScopedLock sl( GetLock() ); List* entry = tcache; - while ( entry != c3d_null ) { + while ( entry != nullptr ) { entry->_valid = false; entry = entry->_next; } @@ -494,13 +494,13 @@ inline void CacheManager::Reset( bool resetLongTerm ) if ( resetLongTerm ) { ScopedLock sl( GetLock() ); delete longTerm; - longTerm = c3d_null; + longTerm = nullptr; // \ru Если нет параллельности, удаляется блокировка. \en If no parallelism, delete the lock. #ifdef CACHE_DELETE_LOCK if ( !sl.IsLocked() ) { - if ( lock != c3d_null ) + if ( lock != nullptr ) delete lock; - lock = c3d_null; + lock = nullptr; } #endif } @@ -514,16 +514,16 @@ template inline void CacheManager::CleanAll( bool doPostproc, bool force ) { if ( force || CacheCleanupAllowed() ) { - if ( tcache != c3d_null ) { + if ( tcache != nullptr ) { if ( doPostproc ) Postprocess(); delete tcache; - tcache = c3d_null; + tcache = nullptr; } #ifdef CACHE_DELETE_LOCK - if ( lock != c3d_null ) { + if ( lock != nullptr ) { delete lock; - lock = c3d_null; + lock = nullptr; } #endif if ( IsSubscribed() ) @@ -538,11 +538,11 @@ inline void CacheManager::CleanAll( bool doPostproc, bool force ) template inline void CacheManager::Postprocess() { - if ( tcache != c3d_null ) { + if ( tcache != nullptr ) { LongTerm(); // Create longTerm List * entry = tcache; // Incorporate thread data into main thread data. - while ( entry != c3d_null && longTerm->MergeWith( entry->_data ) ) { + while ( entry != nullptr && longTerm->MergeWith( entry->_data ) ) { entry = entry->_next; } } @@ -555,18 +555,18 @@ inline void CacheManager::Postprocess() template inline void CacheManager::HardReset() { - if ( tcache != c3d_null ) { + if ( tcache != nullptr ) { delete tcache; - tcache = c3d_null; + tcache = nullptr; } - if ( longTerm != c3d_null ) { + if ( longTerm != nullptr ) { delete longTerm; - longTerm = c3d_null; + longTerm = nullptr; } - if ( lock != c3d_null ) { + if ( lock != nullptr ) { delete lock; - lock = c3d_null; + lock = nullptr; } } diff --git a/C3d/Include/tool_mutex.h b/C3d/Include/tool_mutex.h index 571ed92..2cc0f82 100644 --- a/C3d/Include/tool_mutex.h +++ b/C3d/Include/tool_mutex.h @@ -421,8 +421,8 @@ public: */ void Unlock() const; - // \ru Выдать указатель на объект мьютекса. Возращает c3d_null, если параллельности нет. Для использования в ScopedLock. - // \en Get a pointer to the mutex object. Return c3d_null if no parallelism. For use in ScopedLock. + // \ru Выдать указатель на объект мьютекса. Возращает nullptr, если параллельности нет. Для использования в ScopedLock. + // \en Get a pointer to the mutex object. Return nullptr if no parallelism. For use in ScopedLock. CommonMutex * GetLock() const; }; @@ -453,8 +453,8 @@ public: */ void Unlock() const; - /** \brief \ru Выдать указатель на объект мьютекса. Возращает c3d_null, если параллельности нет. Для использования в ScopedLock. - \en Get a pointer to the mutex object. Return c3d_null if no parallelism. For use in ScopedLock. + /** \brief \ru Выдать указатель на объект мьютекса. Возращает nullptr, если параллельности нет. Для использования в ScopedLock. + \en Get a pointer to the mutex object. Return nullptr if no parallelism. For use in ScopedLock. */ CommonRecursiveMutex * GetLock() const; }; diff --git a/C3d/Include/tool_quick_sort.h b/C3d/Include/tool_quick_sort.h index 5750ddb..22832b9 100644 --- a/C3d/Include/tool_quick_sort.h +++ b/C3d/Include/tool_quick_sort.h @@ -222,17 +222,17 @@ void Swap( Type* arr, size_t ind1, size_t ind2 ) Analog of strcmp for strings, supplied by user for comparing the array elements. Accepts 2 pointers to elements and returns: negative value, if 1<2; 0, if 1=2; positive value, if 1>2. \~ - \param[out] base2 - \ru Указатель на второй массив (может быть c3d_null). - \en Pointer to the second array (could be c3d_null). \~ - \param[out] base3 - \ru Указатель на третий массив (может быть c3d_null). - \en Pointer to the third array (could be c3d_null). \~ + \param[out] base2 - \ru Указатель на второй массив (может быть nullptr). + \en Pointer to the second array (could be nullptr). \~ + \param[out] base3 - \ru Указатель на третий массив (может быть nullptr). + \en Pointer to the third array (could be nullptr). \~ \ingroup Base_Algorithms */ //--- template void InsertSort( Type * base, size_t num, - KsQSortCompFunc compareFunc, Type2* base2 = c3d_null, Type3* base3 = c3d_null ) + KsQSortCompFunc compareFunc, Type2* base2 = nullptr, Type3* base3 = nullptr ) { if ( num < 2 ) @@ -241,9 +241,9 @@ void InsertSort( Type * base, if ( num == 2 ) { if ( compareFunc( base, base + 1 ) >= 0 ) { Swap( base, 0, 1 ); - if ( base2 != c3d_null ) { + if ( base2 != nullptr ) { Swap( base2, 0, 1 ); - if ( base3 != c3d_null ) + if ( base3 != nullptr ) Swap( base3, 0, 1 ); } } @@ -253,9 +253,9 @@ void InsertSort( Type * base, for ( ptrdiff_t i = 1; i < (ptrdiff_t)num; ++i ) { for ( ptrdiff_t j = i; j > 0 && compareFunc( base + j - 1, base + j ) >= 0; j-- ) { Swap( base, j - 1, j ); - if ( base2 != c3d_null ) { + if ( base2 != nullptr ) { Swap( base2, j - 1, j ); - if ( base3 != c3d_null ) + if ( base3 != nullptr ) Swap( base3, j - 1, j ); } } @@ -291,17 +291,17 @@ void InsertSort( Type * base, negative value, if 1<2; 0, if 1=2, positive value, if 1>2. \~ - \param[out] base2 - \ru Указатель на второй массив (может быть c3d_null). - \en Pointer to the second array (could be c3d_null). \~ - \param[out] base3 - \ru Указатель на третий массив (может быть c3d_null). - \en Pointer to the third array (could be c3d_null). \~ + \param[out] base2 - \ru Указатель на второй массив (может быть nullptr). + \en Pointer to the second array (could be nullptr). \~ + \param[out] base3 - \ru Указатель на третий массив (может быть nullptr). + \en Pointer to the third array (could be nullptr). \~ \ingroup Base_Algorithms */ //--- template void QuickSort( Type * base, size_t num, - KsQSortCompFunc compareFunc, Type2* base2 = c3d_null, Type3* base3 = c3d_null ) + KsQSortCompFunc compareFunc, Type2* base2 = nullptr, Type3* base3 = nullptr ) { #define QSORT_THRESHOLD 25 // \ru Порог перехода на другой тип сортировки.\en Threshold of transition to another sorting. @@ -317,9 +317,9 @@ void QuickSort( Type * base, if ( num == 2 ) { if ( compareFunc( base, base + 1 ) >= 0 ) { Swap( base, 0, 1 ); - if ( base2 != c3d_null ) { + if ( base2 != nullptr ) { Swap( base2, 0, 1 ); - if ( base3 != c3d_null ) + if ( base3 != nullptr ) Swap( base3, 0, 1 ); } } @@ -338,9 +338,9 @@ void QuickSort( Type * base, // \ru Выбирается базовый элемент (используется средний). \en Select a base element (use the middle one). midIndex = ( rightIndex + leftIndex ) / 2; Swap( base, midIndex, leftIndex ); - if ( base2 != c3d_null ) { + if ( base2 != nullptr ) { Swap( base2, midIndex, leftIndex ); - if ( base3 != c3d_null ) + if ( base3 != nullptr ) Swap( base3, midIndex, leftIndex ); } @@ -369,17 +369,17 @@ void QuickSort( Type * base, break; Swap( base, lInd, rInd ); - if ( base2 != c3d_null ) { + if ( base2 != nullptr ) { Swap( base2, lInd, rInd ); - if ( base3 != c3d_null ) + if ( base3 != nullptr ) Swap( base3, lInd, rInd ); } } Swap( base, leftIndex, rInd ); - if ( base2 != c3d_null ) { + if ( base2 != nullptr ) { Swap( base2, leftIndex, rInd ); - if ( base3 != c3d_null ) + if ( base3 != nullptr ) Swap( base3, leftIndex, rInd ); } diff --git a/C3d/Include/tool_string_util.h b/C3d/Include/tool_string_util.h index 22d77d3..09a1c44 100644 --- a/C3d/Include/tool_string_util.h +++ b/C3d/Include/tool_string_util.h @@ -44,7 +44,7 @@ inline const char* strret( const char* str ) { return str; } /// \ru Возвр inline char * strnewdup( const char * str, size_t minLen = 0 ) { if ( !str ) - return c3d_null; + return nullptr; size_t len = strlen( str ); @@ -65,7 +65,7 @@ inline char * strnewdup( const char * str, size_t minLen = 0 ) inline wchar_t * wcsnewdup( const wchar_t * str, size_t minLen = 0 ) { if ( !str ) - return c3d_null; + return nullptr; size_t len = wcslen( str ); @@ -85,15 +85,15 @@ inline wchar_t * wcsnewdup( const wchar_t * str, size_t minLen = 0 ) //--- inline wchar_t * mbsnewwcs( const char * str ) { - wchar_t * res = c3d_null; + wchar_t * res = nullptr; if ( str ) { #ifndef __MOBILE_VERSION__ #ifdef C3D_WINDOWS // _MSC_VER - size_t n = mbstowcs( c3d_null, str, 0 ); + size_t n = mbstowcs( nullptr, str, 0 ); #else // C3D_WINDOWS - size_t n = std::mbstowcs( c3d_null, str, 0 ); + size_t n = std::mbstowcs( nullptr, str, 0 ); #endif // C3D_WINDOWS if ( n != NSIZE ) @@ -154,15 +154,15 @@ inline wchar_t * mbsnewwcs( const char * str ) //--- inline char * wcsnewmbs( const wchar_t * str ) { - char * res = c3d_null; + char * res = nullptr; if ( str ) { // \ru один WCHAR может занять более одного CHAR! \en one WCHAR may replace more than one CHAR! #ifdef C3D_WINDOWS // _MSC_VER - size_t n = wcstombs( c3d_null, str, 0 ); + size_t n = wcstombs( nullptr, str, 0 ); #else // C3D_WINDOWS - size_t n = std::wcstombs( c3d_null, str, 0 ); + size_t n = std::wcstombs( nullptr, str, 0 ); #endif // C3D_WINDOWS if ( n != NSIZE ) @@ -371,10 +371,10 @@ inline const char * strret( const char * str ) { return str; } /// \ru В \ingroup Base_Tools_String */ //--- -inline uint32* Utf16ToUcs4( uint16* source, size_t* calculateCountSymbol = c3d_null ) +inline uint32* Utf16ToUcs4( uint16* source, size_t* calculateCountSymbol = nullptr ) { size_t count = 0; // \ru количество символов в строке \en a number of symbols in string - uint32 * outBuf = c3d_null; + uint32 * outBuf = nullptr; if ( source ) { while (source[count] != 0) @@ -400,10 +400,10 @@ inline uint32* Utf16ToUcs4( uint16* source, size_t* calculateCountSymbol = c3d_n \ingroup Base_Tools_String */ //--- -inline uint16* Ucs4ToUtf16( uint32* source, size_t* calculateCountSymbol = c3d_null ) +inline uint16* Ucs4ToUtf16( uint32* source, size_t* calculateCountSymbol = nullptr ) { size_t count = 0; // \ru количество символов в строке \en a number of symbols in string - uint16 * outBuf = c3d_null; + uint16 * outBuf = nullptr; if ( source ) { while (source[count] != 0) diff --git a/C3d/Include/topology.h b/C3d/Include/topology.h index 59e2e0d..491f960 100644 --- a/C3d/Include/topology.h +++ b/C3d/Include/topology.h @@ -250,10 +250,10 @@ public : virtual MbeTopologyType IsA() const; // \ru Тип элемента. \en A type of element. /// \ru Создать новую вершину копированием всех данных исходной вершины. \en Create new vertex by copying all data of the initial vertex. - virtual MbVertex * DataDuplicate( MbRegDuplicate * = c3d_null ) const; - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать согласно матрице. \en Transform according to the matrix. - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвинуть вдоль вектора. \en Move along a vector. - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси. \en Rotate around an axis. + virtual MbVertex * DataDuplicate( MbRegDuplicate * = nullptr ) const; + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать согласно матрице. \en Transform according to the matrix. + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвинуть вдоль вектора. \en Move along a vector. + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси. \en Rotate around an axis. virtual double DistanceToPoint( const MbCartPoint3D & ) const; // \ru Вычислить расстояние до точки. \en Calculate the distance to a point. virtual void AddYourGabaritTo( MbCube & ) const; // \ru Добавить свой габарит в присланный габарит. \en Add your own bounding box into the sent bounding box. virtual void CalculateLocalGabarit( const MbMatrix3D & into, MbCube & cube ) const; // \ru Рассчитать габарит в локальной системы координат. \en Calculate bounding box in the local coordinate system. @@ -316,10 +316,10 @@ IMPL_PERSISTENT_OPS( MbVertex ) // --- class MATH_CLASS MbEdge : public MbTopologyItem { protected : - MbCurve3D * curve; ///< \ru Кривая, по которой проходит ребро (всегда не c3d_null). \en A curve, an edge passes by (it is always not c3d_null). + MbCurve3D * curve; ///< \ru Кривая, по которой проходит ребро (всегда не nullptr). \en A curve, an edge passes by (it is always not nullptr). bool sameSense; ///< \ru Признак совпадения направления ребра с направлением кривой. \en An attribute of coincidence between direction of curve and direction of edge. - MbVertex * begVertex; ///< \ru Вершина-начало (всегда не c3d_null). \en Start vertex (always not c3d_null). - MbVertex * endVertex; ///< \ru Вершина-конец (всегда не c3d_null). \en End vertex (always not c3d_null). + MbVertex * begVertex; ///< \ru Вершина-начало (всегда не nullptr). \en Start vertex (always not nullptr). + MbVertex * endVertex; ///< \ru Вершина-конец (всегда не nullptr). \en End vertex (always not nullptr). protected : /// \ru Конструктор копирования. \en Copy constructor. @@ -359,10 +359,10 @@ public : virtual MbeTopologyType IsA() const; // \ru Тип элемента. \en A type of element. /// \ru Создать новое ребро копированием всех данных исходного ребра. \en Create new edge by copying all data of the initial edge. - virtual MbEdge * DataDuplicate( MbRegDuplicate * = c3d_null ) const; - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Трансформация. \en Transformation. - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Перемещение. \en Moving. - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Вращение. \en Rotation. + virtual MbEdge * DataDuplicate( MbRegDuplicate * = nullptr ) const; + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Трансформация. \en Transformation. + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Перемещение. \en Moving. + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Вращение. \en Rotation. virtual double DistanceToPoint( const MbCartPoint3D & ) const; // \ru Вычислить расстояние до точки. \en Calculate the distance to a point. virtual void AddYourGabaritTo( MbCube & ) const; // \ru Добавить свой габарит в присланный габарит. \en Add your own bounding box into the sent bounding box. virtual void CalculateLocalGabarit( const MbMatrix3D & into, MbCube & cube ) const; // \ru Рассчитать габарит в локальной системы координат. \en Calculate bounding box in the local coordinate system. @@ -444,7 +444,7 @@ public : bool IsClosed() const; /// \ru Установить метку себе и вершинам. \en Set a label for self and vertices. - void SetLabelThrough( MbeLabelState l, void * key = c3d_null ) const; + void SetLabelThrough( MbeLabelState l, void * key = nullptr ) const; /// \ru Установить метку себе и вершинам. \en Set a label for self and vertices. void SetLabelThrough( MbeLabelState l, void * key, bool setLock ) const; /// \ru Удалить частную метку себе и вершинам. \en Remove private label for self and vertices. @@ -586,7 +586,7 @@ public : virtual MbeTopologyType IsA() const; // \ru Тип элемента. \en A type of element. /// \ru Создать новое ребро копированием всех данных исходного ребра. \en Create new edge by copying all data of the initial edge. - virtual MbCurveEdge * DataDuplicate( MbRegDuplicate * = c3d_null ) const; + virtual MbCurveEdge * DataDuplicate( MbRegDuplicate * = nullptr ) const; virtual void SetOwnChangedThrough( MbeChangedType ); // \ru Установить флаг изменения в положение измененного объекта. \en Set the flag that the object has been changed. virtual void Reverse(); // \ru Изменить направление ребра на противоположной, не изменяя кривую. \en Change direction of edge without changing a curve. /// \ru Являются ли объекты равными? \en Determine whether objects are equal. @@ -628,7 +628,7 @@ public : bool IsUsual( bool tolerantIsUsual ) const; /// \ru Установить метки ориентированных ребер. \en Set labels of oriented edges. - void SetOrientedEdgesLabel( MbeLabelState, void * key = c3d_null ); + void SetOrientedEdgesLabel( MbeLabelState, void * key = nullptr ); /// \ru Найти ориентированное ребро. \en Find an oriented edge. bool FindOrientedEdge( bool orient, const MbFace * face, MbLoop *& findLoop, size_t & index ) const; /// \ru Найти ориентированное ребро. \en Find an oriented edge. @@ -712,7 +712,7 @@ public : The calculation is correct for edges which do not change a convexity. Returns ts_neutral for smooth edges. \~ */ - ThreeStates IsConvex( double angleEps = EXTENT_EPSILON, const MbRect1D * tRange = c3d_null ) const; + ThreeStates IsConvex( double angleEps = EXTENT_EPSILON, const MbRect1D * tRange = nullptr ) const; /**\ru Скопировать из копии готовые метрические оценки, которые в оригинале не были рассчитаны. \en Copy from the copy ready estimates which were not calculated in the original. \~ @@ -950,7 +950,7 @@ IMPL_PERSISTENT_OPS( MbCurveEdge ) // --- class MATH_CLASS MbOrientedEdge : public MbTopItem { protected: - MbCurveEdge * curveEdge; ///< \ru Ребро грани (всегда не c3d_null). \en Face edge (always not c3d_null). + MbCurveEdge * curveEdge; ///< \ru Ребро грани (всегда не nullptr). \en Face edge (always not nullptr). bool orientation; ///< \ru Направление ребра грани в цикле. \en Direction of a face edge in the loop. mutable MbLabel label; ///< \ru Временная метка для выполнения операций. \en Temporary label for performing of operations. public : @@ -1019,7 +1019,7 @@ public : template void GetVerticesArray( VerticesVector & vertices, bool findSame = true ) const { - const MbVertex * lastVertex= c3d_null; + const MbVertex * lastVertex= nullptr; if ( vertices.size() > 0 ) lastVertex = vertices.back(); @@ -1046,15 +1046,15 @@ public : void SetOrientation( bool o ); /// \ru Получить метку. \en Get label. - MbeLabelState GetLabel( void * key = c3d_null ) const { return (MbeLabelState)label.GetLabel(key);} + MbeLabelState GetLabel( void * key = nullptr ) const { return (MbeLabelState)label.GetLabel(key);} /// \ru Установить свою метку. \en Set label. - void SetOwnLabel( MbeLabelState l, void * key = c3d_null ) const { label.SetLabel( l, key ); } + void SetOwnLabel( MbeLabelState l, void * key = nullptr ) const { label.SetLabel( l, key ); } /// \ru Установить метку ориентированному ребру, ребру грани и вершинам ребра. \en Set label for oriented edge, face edge and vertices of edge. - void SetLabelThrough( MbeLabelState l, void * key = c3d_null ) const; + void SetLabelThrough( MbeLabelState l, void * key = nullptr ) const; /// \ru Установить метку ориентированному ребру, ребру грани и вершинам ребра. \en Set label for oriented edge, face edge and vertices of edge. void SetLabelThrough( MbeLabelState l, void * key, bool setLock ) const; /// \ru Удалить частную метку. \en Remove private label. - void RemovePrivateLabel ( void * key = c3d_null ) const { label.DeletePrivate(key); } + void RemovePrivateLabel ( void * key = nullptr ) const { label.DeletePrivate(key); } /// \ru Удалить частную метку ориентированному ребру, ребру грани и вершинам ребра. \en Remove private label for oriented edge, face edge and vertices of edge. void RemovePrivateLabelThrough( void * key ) const; @@ -1151,21 +1151,21 @@ public : size_t GetEdgesCount() const { return edgeList.size(); } /// \ru Получить метку цикла. \en Get a label of the loop. - MbeLabelState GetLabel( void * key = c3d_null ) const { return (MbeLabelState)label.GetLabel(key); } + MbeLabelState GetLabel( void * key = nullptr ) const { return (MbeLabelState)label.GetLabel(key); } /// \ru Установить метку. \en Set a label of the loop. - void SetOwnLabel( MbeLabelState l, void * key = c3d_null ) const { label.SetLabel( l, key ); } + void SetOwnLabel( MbeLabelState l, void * key = nullptr ) const { label.SetLabel( l, key ); } /// \ru Установить метку себе и ребрам цикла. \en Set a label for self and loop vertices. - void SetLabelThrough( MbeLabelState l, void * key = c3d_null ) const; + void SetLabelThrough( MbeLabelState l, void * key = nullptr ) const; /// \ru Установить метку себе и ребрам цикла. \en Set a label for self and loop vertices. void SetLabelThrough( MbeLabelState l, void * key, bool setLock ) const; /// \ru Удалить частную метку себе и ребрам цикла. \en Remove private label for self and loop edges. void RemovePrivateLabelThrough( void * key ) const; /// \ru Установить метку ребрам. \en Set a label for edges. - void SetCurveEdgesLabel( MbeLabelState, void * key = c3d_null ) const; + void SetCurveEdgesLabel( MbeLabelState, void * key = nullptr ) const; /// \ru Проверить метки рёбер и установить свою метку. \en Check edges labels and set own label. - void CheckEdgesLabel( void * key = c3d_null ) const; + void CheckEdgesLabel( void * key = nullptr ) const; /// \ru Удалить частную метку. \en Remove private label. - void RemovePrivateLabel ( void * key = c3d_null ) const { label.DeletePrivate(key); } + void RemovePrivateLabel ( void * key = nullptr ) const { label.DeletePrivate(key); } /// \ru Выдать множество вершин цикла. \en Get a set of loop vertices. template @@ -1233,7 +1233,7 @@ public : /// \ru Замена базового ребра. \en Replacement of the basis edge. void InitOrientedEdge( size_t edgeIndex, MbCurveEdge & initEdge, bool initOrientation, bool replaceVertices ); /// \ru Выдать ориентированное ребро по номеру. \en Get an oriented edge by the number. - MbOrientedEdge * GetOrientedEdge( size_t index ) const { return (index < edgeList.size()) ? edgeList[index] : c3d_null; } + MbOrientedEdge * GetOrientedEdge( size_t index ) const { return (index < edgeList.size()) ? edgeList[index] : nullptr; } /// \ru Выдать ориентированное ребро по номеру без проверки корректности индекса. \en Get an oriented edge by the number without check of correctness of the index. MbOrientedEdge *_GetOrientedEdge( size_t index ) const { return edgeList[index]; } @@ -1270,7 +1270,7 @@ public : void Inverse(); /// \ru Принадлежит ли вершина пути. \en Does a vertex belong a path? - bool IsVertexOn( const MbVertex * vertex, size_t * index = c3d_null ) const; + bool IsVertexOn( const MbVertex * vertex, size_t * index = nullptr ) const; /// \ru Замена указателей на поверхность. \en Replacement of the pointers to a surface. void ChangeSurface( MbSurface & oldSurf, MbSurface & newSurf, bool orient ); @@ -1319,11 +1319,11 @@ public : void SetProperties( const MbProperties & ); /// \ru Преобразовать объект согласно матрице. \en Transform an object according to the matrix. - void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); + void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); /// \ru Сдвинуть объект вдоль вектора. \en Move an object along a vector. - void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); + void Move ( const MbVector3D &, MbRegTransform * = nullptr ); /// \ru Повернуть объект вокруг оси на заданный угол. \en Rotate an object at a given angle around an axis. - void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); + void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); /// \ru Сдвинуть двумерные кривые вдоль вектора в области параметров поверхности (все сразу). \en Move two-dimensional curves along the vector in the surface parameter region (all at once). void Move( MbVector &, const MbSurface &, bool ); /// \ru Является ли контур граничным? \en Is a contour boundary? @@ -1356,7 +1356,7 @@ public: const MbCurveEdge * edge; ///< \ru Ребро цикла. \en Loop edge. double curveParam; ///< \ru Параметр двумерной кривой ребра, лежащей на поверхности грани. \en The parameter of two-dimensional curve that lies on the surface of a face and is contained in the edge. public: - LoopCrossParam() : loopIndex( SYS_MAX_T), edge( c3d_null ), curveParam( UNDEFINED_DBL ) {} + LoopCrossParam() : loopIndex( SYS_MAX_T), edge( nullptr ), curveParam( UNDEFINED_DBL ) {} LoopCrossParam( size_t li, const MbCurveEdge * e, double t ) : loopIndex( li ), edge( e ), curveParam( t ) {} LoopCrossParam( const LoopCrossParam & obj ) : loopIndex( obj.loopIndex ), edge( obj.edge ), curveParam( obj.curveParam ) {} @@ -1415,7 +1415,7 @@ public: // --- class MATH_CLASS MbFace : public MbTopologyItem, public MbSyncItem { protected: - MbSurface * surface; ///< \ru Поверхность грани (всегда не c3d_null). \en Face surface (always not c3d_null). + MbSurface * surface; ///< \ru Поверхность грани (всегда не nullptr). \en Face surface (always not nullptr). bool sameSense; ///< \ru Признак совпадения направления нормали грани с нормалью поверхности. \en An attribute of coincidence between the face normal direction and the surface normal direction. RPArray loops; ///< \ru Границы грани (первая граница должна быть внешней). \en Face boundaries (the first boundary should be external). private: @@ -1435,11 +1435,11 @@ public: , loops( bnds.size(), 1 ) , surface( const_cast(&surf) ) , sameSense( sense ) // признак совпадения нормали - , temporal( c3d_null ) + , temporal( nullptr ) { surface->AddRef(); for ( size_t i = 0, cnt = bnds.size(); i < cnt; ++i ) { - if ( bnds[i] != c3d_null ) + if ( bnds[i] != nullptr ) AddLoop( *bnds[i] ); } } @@ -1456,10 +1456,10 @@ public: virtual MbeTopologyType IsA() const; // \ru Тип элемента. \en A type of element. /// \ru Создать новую грань копированием всех данных исходной грани. \en Create new face by copying all data of the initial face. - virtual MbFace * DataDuplicate( MbRegDuplicate * = c3d_null ) const; - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Трансформация. \en Transformation. - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Перемещение. \en Moving. - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Вращение. \en Rotation. + virtual MbFace * DataDuplicate( MbRegDuplicate * = nullptr ) const; + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Трансформация. \en Transformation. + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Перемещение. \en Moving. + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Вращение. \en Rotation. virtual double DistanceToPoint( const MbCartPoint3D & ) const; // \ru Вычислить расстояние до точки. \en Calculate the distance to a point. virtual void AddYourGabaritTo( MbCube & ) const; // \ru Добавить свой габарит в присланный габарит. \en Add your own bounding box into the sent bounding box. virtual void CalculateLocalGabarit( const MbMatrix3D & into, MbCube & cube ) const; // \ru Рассчитать габарит в локальной системы координат. \en Calculate bounding box in the local coordinate system. @@ -1496,7 +1496,7 @@ public: /// \ru Выдать количество циклов (границ) грани . \en Get the number of loops (boundaries) of face. size_t GetLoopsCount() const { return loops.size(); } /// \ru Установить метку грани, циклам, рёбрам и вершинам. \en Set a label of face to its loops, edges and vertices. - void SetLabelThrough( MbeLabelState l, void * key = c3d_null ) const; + void SetLabelThrough( MbeLabelState l, void * key = nullptr ) const; /// \ru Установить метку грани, циклам, рёбрам и вершинам. \en Set a label of face to its loops, edges and vertices. void SetLabelThrough( MbeLabelState l, void * key, bool setLock ) const; /// \ru Удалить частную метку грани, циклам, рёбрам и вершинам. \en Remove a private label of face to its loops, edges and vertices. @@ -1512,7 +1512,7 @@ public: size_t loopsCnt = loops.size(); vertices.reserve( vertices.size() + loopsCnt * 4 ); for ( size_t i = 0; i < loopsCnt; ++i ) { - if ( loops[i] != c3d_null ) + if ( loops[i] != nullptr ) loops[i]->GetVertices( vertices ); } } @@ -1524,7 +1524,7 @@ public: void GetEdgesSet( EdgesSet & edges ) const { size_t loopsCnt = loops.size(); for ( size_t i = 0; i < loopsCnt; ++i ) { - if ( loops[i] != c3d_null ) + if ( loops[i] != nullptr ) loops[i]->GetEdgesSet( edges ); } } @@ -1533,7 +1533,7 @@ public: void GetEdges( EdgesVector & edges, EdgesSet & edgesCache ) const { size_t loopsCnt = loops.size(); for ( size_t i = 0; i < loopsCnt; ++i ) { - if ( loops[i] != c3d_null ) + if ( loops[i] != nullptr ) loops[i]->GetEdges( edges , edgesCache ); } } @@ -1547,7 +1547,7 @@ public: bool HasNeighborFace() const; /// \ru Выдать границу (цикл) с проверкой корректности индекса. \en Get a boundary (a loop) with a check of index correctness. - MbLoop * GetLoop( size_t index ) const { size_t cnt = loops.size(); return cnt ? loops[index % cnt] : c3d_null; } + MbLoop * GetLoop( size_t index ) const { size_t cnt = loops.size(); return cnt ? loops[index % cnt] : nullptr; } /// \ru Выдать границу (цикл) без проверки корректности индекса. \en Get a boundary (a loop) without a check of index correctness. MbLoop *_GetLoop( size_t index ) const { return loops[index]; } /// \ru Обнулить количество ребер в цикле с указанным индексом. \en Set to null the number of edges in loop with the given index. @@ -1571,9 +1571,9 @@ public: /// \ru Установить указатели ребер цикла на грань. \en Set the pointers of loop edges to the face. void SetFaceToLoopEdges( MbLoop & ); - /// \ru Установить указатели на грань слева или грань справа в ребрах цикла на c3d_null. \en Set to null the pointers to the face on the left or to the face on the right in edges of loop. + /// \ru Установить указатели на грань слева или грань справа в ребрах цикла на nullptr. \en Set to null the pointers to the face on the left or to the face on the right in edges of loop. void SetNullToLoopEdges( MbLoop & ); - /// \ru Установить указатели на грань слева или грань справа в ребрах циклов на c3d_null. \en Set to null the pointers to the face on the left or to the face on the right in edges of loops. + /// \ru Установить указатели на грань слева или грань справа в ребрах циклов на nullptr. \en Set to null the pointers to the face on the left or to the face on the right in edges of loops. void SetNullToLoopsEdges(); /// \ru Обнулить указатели на грань слева или грань справа, указывающие на смежную грань delFace, в ребрах циклов. \en Set to null pointers to the face on the left or to the face on the right which point to the adjacent face delFace in edges of loops. void SetNullToFace( const MbFace * delFace ); @@ -1583,7 +1583,7 @@ public: void MakeRight( bool setBounds = false ); /// \ru Принадлежит ли вершина грани? \en Does a vertex belong an edge? - bool IsVertexOn( const MbVertex * vertex, size_t * indLoop = c3d_null, size_t * indEdge = c3d_null ) const; + bool IsVertexOn( const MbVertex * vertex, size_t * indLoop = nullptr, size_t * indEdge = nullptr ) const; /** \brief \ru Изменить ориентацию грани. \en Change an orientation of a face. \~ @@ -1621,7 +1621,7 @@ public: void CalculateWire( const MbStepData & stepData, MbMesh & mesh ) const // The method deprecated. It will be removed at 2019. Use CalculateMesh( stepData, MbFormNote(true, false), mesh ); \~ { CalculateMesh( stepData, MbFormNote(true, false), mesh ); } /// \ru Связаны ли грани? \en Are faces connected? - bool IsConnectedWith( const MbFace * face, RPArray * commonEdges = c3d_null ) const; + bool IsConnectedWith( const MbFace * face, RPArray * commonEdges = nullptr ) const; /// \ru Подобны ли поверхности для объединения трансформацией по матрице (первичная проверка)? \en Are surfaces similar for merge by transformation by the matrix (a primary check)? bool IsSimilarToFace( const MbFace & face, bool & normal, bool & planeType, VERSION version, double precision = METRIC_PRECISION ) const; /// \ru Подобны ли поверхности для объединения путем замены (первичная проверка)? \en Are surfaces similar for merge by replacement (a primary check)? @@ -1635,7 +1635,7 @@ public: bool ChangeCarrierBorneSpecial( const MbFace & face ); /// \ru Подобны ли поверхности для замены с преобразованием по матрице двумерных кривых? \en Are surfaces similar for replacement with transformation of two-dimensional curves by the matrix? bool IsSimilarExactly( const MbFace & face, MbMatrix & matr, VERSION version, double precision = METRIC_PRECISION ) const; - bool IsSimilarExactly( const MbFace & face, MbMatrix & matr, c3d::ConstFacesVectorPair * similarPairs, + bool IsSimilarExactly( const MbFace & face, MbMatrix & matr, const c3d::ConstFacesVectorPair * similarPairs, VERSION version, double precision = METRIC_PRECISION ) const; /// \ru Подобны ли поверхности граней для замены с преобразованием двумерных кривых? \en Are surfaces similar for replacement with transformation of two-dimensional curves? bool IsSpecialSimilarExactly( const MbFace & face, bool doSwap, double precision = METRIC_PRECISION ) const; @@ -1674,7 +1674,7 @@ public: const MbCurveEdge * FindEdgeByHash( const SimpleName h ) const; /// \ru Установить метку ориентированного ребра. \en Set a label for an oriented edge. - void SetOrientedLabel ( const MbCurveEdge & edge, MbeLabelState n, void * key = c3d_null ); + void SetOrientedLabel ( const MbCurveEdge & edge, MbeLabelState n, void * key = nullptr ); /// \ru Вычислить ближайшее расстояние до ребра и ближайшие точки грани и ребра. \en Calculate the nearest distance to an edge and the nearest points of an edge. double DistanceToEdge ( const MbCurveEdge & edge, MbCartPoint3D & p, MbCartPoint3D & edgeP ) const; /// \ru Вычислить ближайшее расстояние до грани и ближайшие точки граней. \en Calculate the nearest distance to a face and the nearest points of faces. @@ -1788,7 +1788,7 @@ public: double metricNear, VERSION version ) const; /// \ru Построить нормальные ЛСК конструктивных плоскостей. \en Construct normal placements of constructive planes. - bool CreateNormalPlacements ( const MbVector3D & axisZ, double angle, SArray & places ) const; + bool CreateNormalPlacements ( const MbVector3D & axisZ, double angle, SArray & places, VERSION version = Math::DefaultMathVersion() ) const; /// \ru Построить касательные ЛСК конструктивных плоскостей. \en Construct tangent placements of constructive planes. bool CreateTangentPlacements( const MbVector3D & axisZ, SArray & places ) const; /// \ru Дать некоторую точку и нормаль на грани. \en Get some point and normal on face. @@ -1852,7 +1852,7 @@ public: public: /// \ru Создан ли временный объект сопровождения грани? \en Is a temporary object for the maintenance of a face created? - bool IsTemporal() const { return (temporal != c3d_null); } + bool IsTemporal() const { return (temporal != nullptr); } /// \ru Удалить временный объект сопровождения. \en Delete a temporary maintenance object. void RemoveTemporal() const; /// \ru Создать новый временный объект сопровождения. \en Create new temporary maintenance object. @@ -1883,7 +1883,7 @@ void MbFace::GetEdges( EdgesVector & edges, size_t mapThreshold ) const if ( edges.size() < 1 ) { size_t checkCnt = 0; for ( size_t i = 0; i < loopsCnt; ++i ) { - if ( loops[i] != c3d_null ) { + if ( loops[i] != nullptr ) { checkCnt += loops[i]->GetEdgesCount(); if ( checkCnt > mapThreshold ) { useMap = true; @@ -1899,9 +1899,9 @@ void MbFace::GetEdges( EdgesVector & edges, size_t mapThreshold ) const c3d::EdgeSPtr edge; for ( size_t i = 0; i < loopsCnt; ++i ) { MbLoop * loop = loops[i]; - if ( loop != c3d_null ) { + if ( loop != nullptr ) { for ( size_t j = 0, edgesCnt = loop->GetEdgesCount(); j < edgesCnt; ++j ) { - if ( loop->_GetOrientedEdge( j ) != c3d_null ) { + if ( loop->_GetOrientedEdge( j ) != nullptr ) { edge = &loop->_GetOrientedEdge( j )->GetCurveEdge(); mapIt = mapEdges.find( edge ); if ( mapIt == mapEdges.end() ) { @@ -1918,7 +1918,7 @@ void MbFace::GetEdges( EdgesVector & edges, size_t mapThreshold ) const } if ( !useMap ) { for ( size_t i = 0; i < loopsCnt; ++i ) { - if ( loops[i] != c3d_null ) + if ( loops[i] != nullptr ) loops[i]->GetEdges( edges ); } } @@ -1938,7 +1938,7 @@ void MbFace::GetOuterEdges( EdgesVector & edges, size_t mapThreshold ) const if ( edges.size() < 1 ) { size_t checkCnt = 0; - if ( loops.front() != c3d_null ) { + if ( loops.front() != nullptr ) { checkCnt += loops.front()->GetEdgesCount(); if ( checkCnt > mapThreshold ) useMap = true; @@ -1951,7 +1951,7 @@ void MbFace::GetOuterEdges( EdgesVector & edges, size_t mapThreshold ) const c3d::EdgeSPtr edge; MbLoop * loop = loops.front(); for ( size_t j = 0, edgesCnt = loop->GetEdgesCount(); j < edgesCnt; ++j ) { - if ( loop->_GetOrientedEdge( j ) != c3d_null ) { + if ( loop->_GetOrientedEdge( j ) != nullptr ) { edge = &loop->_GetOrientedEdge( j )->GetCurveEdge(); mapIt = mapEdges.find( edge ); if ( mapIt == mapEdges.end() ) { @@ -1965,7 +1965,7 @@ void MbFace::GetOuterEdges( EdgesVector & edges, size_t mapThreshold ) const } } if ( !useMap ) { - if ( loops.front() != c3d_null ) + if ( loops.front() != nullptr ) loops.front()->GetEdges( edges ); } } @@ -1979,12 +1979,12 @@ void MbFace::GetBoundaryEdges( ConstEdgesVector & boundaryEdges ) const { for ( size_t i = 0, loopsCnt = loops.size(); i < loopsCnt; ++i ) { const MbLoop * loop = loops[i]; - if ( loop == c3d_null ) + if ( loop == nullptr ) continue; c3d::EdgeSPtr edge; for ( size_t j = 0, edgesCnt = loop->GetEdgesCount(); j < edgesCnt; ++j ) { const MbOrientedEdge * orientEdge = loop->_GetOrientedEdge( j ); - if ( orientEdge == c3d_null ) + if ( orientEdge == nullptr ) continue; edge = const_cast( &orientEdge->GetCurveEdge() ); if ( edge->IsBoundaryFace() ) { @@ -2013,7 +2013,7 @@ void MbFace::GetNeighborFaces( FacesVector & neighborFaces ) const size_t neighborsCnt0 = neighborFaces.size(); for ( k = 0; k < neighborsCnt0; k++ ) { const MbFace * neighborFace = neighborFaces[k]; - if ( neighborFace != c3d_null ) + if ( neighborFace != nullptr ) facesLabels.push_back( std::make_pair( neighborFace, neighborFace->GetLabel() ) ); } neighborsCnt0 = facesLabels.size(); @@ -2021,14 +2021,14 @@ void MbFace::GetNeighborFaces( FacesVector & neighborFaces ) const // mark neighbour faces by the first label for ( k = 0; k < loopsCnt; ++k ) { const MbLoop * loop = loops[k]; - if ( loop == c3d_null ) + if ( loop == nullptr ) continue; for ( size_t edgeInd = 0, edgesCnt = loop->GetEdgesCount(); edgeInd < edgesCnt; ++edgeInd ) { const MbOrientedEdge * edge = loop->_GetOrientedEdge( edgeInd ); - if ( edge == c3d_null ) + if ( edge == nullptr ) continue; const MbFace * neighborFace = edge->GetFaceMinus(); - if ( neighborFace != c3d_null && neighborFace != this ) { + if ( neighborFace != nullptr && neighborFace != this ) { facesLabels.push_back( std::make_pair( neighborFace, neighborFace->GetLabel() ) ); // save initial label neighborFace->SetOwnLabel( ls_Used ); } diff --git a/C3d/Include/topology_faceset.h b/C3d/Include/topology_faceset.h index e01ded2..268eb53 100644 --- a/C3d/Include/topology_faceset.h +++ b/C3d/Include/topology_faceset.h @@ -163,7 +163,7 @@ public : \return \ru Копия объекта или оригинал(в случае режима копирования cm_Same). \en Copy of an object or original (in a case of the mode cm_Same). \~ */ - MbFaceShell * Copy( MbeCopyMode sameShell, MbShellHistory * history = c3d_null, MbRegDuplicate * iReg = c3d_null ); + MbFaceShell * Copy( MbeCopyMode sameShell, MbShellHistory * history = nullptr, MbRegDuplicate * iReg = nullptr ); /** \brief \ru Создать копию. \en Create a copy. \~ @@ -172,7 +172,7 @@ public : \return \ru Копия объекта. \en Copy of the object. \~ */ - MbFaceShell * Duplicate( MbRegDuplicate * iReg = c3d_null ) const; + MbFaceShell * Duplicate( MbRegDuplicate * iReg = nullptr ) const; /// \ru Замкнутая ли оболочка? \en Is shell closed? bool IsClosed() const { return closed; } @@ -192,7 +192,7 @@ public : bool delTemporal = false; for ( size_t i = 0, cnt = newFaces.size(); i < cnt; ++i ) { const MbFace * newFace = newFaces[i]; - if ( newFace == c3d_null ) + if ( newFace == nullptr ) continue; if ( justAdd || ( std::find( faceSet.begin(), faceSet.end(), newFace ) == faceSet.end() ) ) { faceSet.push_back( const_cast(newFace) ); @@ -231,7 +231,7 @@ public : for ( size_t k = 0; k < facesCnt; ++k ) { face = faceSet[k]; ::DecRefItem( faceSet[k] ); - faceSet[k] = c3d_null; + faceSet[k] = nullptr; detachFaces.push_back( face ); ::DetachItem( face ); } @@ -260,7 +260,7 @@ public : \param[in] iReg - \ru Регистратор объектов. \en Registrator of objects: \~ */ - void Transform( const MbMatrix3D & matr, MbRegTransform * iReg = c3d_null ); + void Transform( const MbMatrix3D & matr, MbRegTransform * iReg = nullptr ); /** \brief \ru Сдвинуть вдоль вектора. \en Move along a vector. \~ @@ -275,7 +275,7 @@ public : \param[in] iReg - \ru Регистратор. \en Registrator. \~ */ - void Move( const MbVector3D & to, MbRegTransform * iReg = c3d_null ); + void Move( const MbVector3D & to, MbRegTransform * iReg = nullptr ); /** \brief \ru Повернуть вокруг оси. \en Rotate around an axis. \~ @@ -292,7 +292,7 @@ public : \param[in] iReg - \ru Регистратор. \en Registrator. \~ */ - void Rotate( const MbAxis3D & axis, double angle, MbRegTransform * iReg = c3d_null ); + void Rotate( const MbAxis3D & axis, double angle, MbRegTransform * iReg = nullptr ); /// \ru Рассчитать расстояние до точки. \en Calculate the distance to a point. double DistanceToPoint( const MbCartPoint3D & to ) const; /// \ru Вывернуть оболочку наизнанку - переориентировать все грани. \en Revert the shell - reorientation of the whole set of faces. @@ -300,7 +300,7 @@ public : /// \ru Являются ли объекты равными. \en Determine whether objects are equal. bool IsSame( const MbFaceShell & faces, double accuracy ) const; /// \ru Установить метки всем объектам, имеющим таковые. \en Set labels for all objects which have them. - void SetLabelThrough( MbeLabelState, void * = c3d_null ) const; + void SetLabelThrough( MbeLabelState, void * = nullptr ) const; /// \ru Установить метки всем объектам, имеющим таковые. \en Set labels for all objects which have them. void SetLabelThrough( MbeLabelState, void *, bool ) const; /// \ru Удалить частные метки всем объектам, имеющим таковые. \en Remove private labels for all objects which have them. @@ -308,15 +308,15 @@ public : /// \ru Установить флаги изменённости объектов. \en Set flags that objects have been changed. void SetOwnChangedThrough( MbeChangedType n ); /// \ru Установить флаги в начальное состояние. \en Set flags to initial state. - void ResetFlags( void * = c3d_null ); + void ResetFlags( void * = nullptr ); /// \ru Забрать в оболочку множество граней из оболочки faces. \en Move a set of faces to the shell from another shell. - bool UnionWith( MbFaceShell & faces, c3d::FacesSet * sharedSet = c3d_null ); + bool UnionWith( MbFaceShell & faces, c3d::FacesSet * sharedSet = nullptr ); /// \ru Установить заданную метку всем вершинам оболочки. \en Set the given label for all vertices of the shell. - size_t SetVerticesLabel( MbeLabelState, void * = c3d_null) const; + size_t SetVerticesLabel( MbeLabelState, void * = nullptr) const; /// \ru Установить заданную метку всем рёбрам оболочки. \en Set the given label for all edges of the shell. - size_t SetEdgesLabel ( MbeLabelState, void * = c3d_null) const; + size_t SetEdgesLabel ( MbeLabelState, void * = nullptr) const; /// \ru Установить заданную метку всем граням оболочки. \en Set the given label for all faces of the shell. - void SetFacesLabel ( MbeLabelState, void * = c3d_null) const; + void SetFacesLabel ( MbeLabelState, void * = nullptr) const; /// \ru Выдать множество вершин оболочки. \en Get a set of vertices of the shell. template @@ -327,7 +327,7 @@ public : void GetEdgesSet( EdgesSet & edges ) const { size_t i, facesCnt = faceSet.size(); for ( i = 0; i < facesCnt; ++i ) { - if ( faceSet[i] != c3d_null ) + if ( faceSet[i] != nullptr ) faceSet[i]->GetEdgesSet( edges ); } } @@ -336,7 +336,7 @@ public : void GetEdges( EdgesVector & edges, EdgesSet & edgesCache ) const { size_t i, facesCnt = faceSet.size(); for ( i = 0; i < facesCnt; ++i ) { - if ( faceSet[i] != c3d_null ) + if ( faceSet[i] != nullptr ) faceSet[i]->GetEdges( edges, edgesCache ); } } @@ -352,11 +352,11 @@ public : size_t allEdgesCnt = 0; for ( i = 0; i < facesCnt; ++i ) { const MbFace * face = faceSet[i]; - if ( face != c3d_null ) { + if ( face != nullptr ) { size_t loopsCnt = face->GetLoopsCount(); for ( size_t j = 0; j < loopsCnt; ++j ) { const MbLoop * loop = face->_GetLoop( j ); - if ( loop != c3d_null ) + if ( loop != nullptr ) allEdgesCnt += loop->GetEdgesCount(); } } @@ -365,7 +365,7 @@ public : edges.reserve( edges.size() + allEdgesCnt ); for ( i = 0; i < facesCnt; ++i ) { - if ( faceSet[i] != c3d_null ) + if ( faceSet[i] != nullptr ) faceSet[i]->GetEdges( edges ); } } @@ -387,7 +387,7 @@ public : void GetFacesSet( FacesSet & faces ) const { for ( size_t k = 0, kcnt = faceSet.size(); k < kcnt; ++k ) { - if ( faceSet[k] != c3d_null ) + if ( faceSet[k] != nullptr ) faces.insert( faceSet[k] ); } } @@ -646,7 +646,7 @@ public : \param[out] extTolCubes - \ru Контейнер для расширенных габаритов граней оболочки с неточными ребрам. \en Container of extended bounding boxes of shell faces that contain inexact edges. \~ */ - void AddYourGabaritTo( MbCube & gab, c3d::IndexCubeVector * extTolCubes = c3d_null ) const; + void AddYourGabaritTo( MbCube & gab, c3d::IndexCubeVector * extTolCubes = nullptr ) const; /// \ru Рассчитать габарит оболочки. \en Calculate bounding box of the shell. void CalculateGabarit( MbCube & ) const; /// \ru Рассчитать габарит в локальной системы координат, заданной матрицей matrToLocal преобразования в неё \en Calculate bounding box in the local coordinate system which is given by the matrix 'matrToLocal ' of transformation to it. @@ -815,7 +815,7 @@ public : bool MergeSimilarFaces( SimpleName simMainName = c3d::SIMPLENAME_MAX ); /// \ru Создан ли временный объект сопровождения? \en Is a temporary object for the maintenance created? - bool IsTemporal() const { return (temporal != c3d_null); } + bool IsTemporal() const { return (temporal != nullptr); } /// \ru Удалить временный объект сопровождения. \en Delete a temporary maintenance object. void RemoveTemporal( bool removeFacesTemporal = false ) const; /// \ru Создать новый временный объект сопровождения. \en Create new temporary maintenance object. @@ -859,10 +859,10 @@ MbFaceShell::MbFaceShell( const Faces & initFaces ) : MbTopItem() , faceSet ( initFaces.size(), 1 ) , closed ( true ) - , temporal ( c3d_null ) + , temporal ( nullptr ) { for ( size_t i = 0, cnt = initFaces.size(); i < cnt; ++i ) { - if ( initFaces[i] != c3d_null ) + if ( initFaces[i] != nullptr ) AddFace( *initFaces[i] ); } } @@ -1014,12 +1014,12 @@ void MbFaceShell::GetItems( TopologyItemsVector & list ) const size_t i, fcount = faceSet.size(); for ( i = 0; i < fcount; ++i ) { const MbFace * face = faceSet[i]; - if ( face == c3d_null ) + if ( face == nullptr ) continue; for ( size_t j = 0, lcount = face->GetLoopsCount(); j < lcount; ++j ) { const MbLoop * loop = face->_GetLoop(j); - if ( loop == c3d_null ) + if ( loop == nullptr ) continue; size_t ecount = loop->GetEdgesCount(); @@ -1040,7 +1040,7 @@ void MbFaceShell::GetItems( TopologyItemsVector & list ) const // опускаем флаг // reset labels for ( i = 0; i < fcount; ++i ) { MbFace * face = faceSet[i]; - if ( face == c3d_null ) + if ( face == nullptr ) continue; list.push_back( face ); @@ -1050,7 +1050,7 @@ void MbFaceShell::GetItems( TopologyItemsVector & list ) const for ( size_t j = 0, lcount = face->GetLoopsCount(); j < lcount; ++j ) { const MbLoop * loop = face->_GetLoop(j); - if ( loop == c3d_null ) + if ( loop == nullptr ) continue; for ( size_t k = 0, ecount = loop->GetEdgesCount(); k < ecount; ++k ) { @@ -1104,7 +1104,7 @@ bool MbFaceShell::FindIndexByFaces( const FacesPointersVector & initFaces, ItemI for ( size_t i = 0; i < initFacesCount; ++i ) { const MbFace * face = initFaces[i]; - if ( face != c3d_null ) { + if ( face != nullptr ) { size_t i0 = SYS_MAX_T; c3d::ConstFaceIndexMap::iterator it = fiMap.find( face ); if ( it != fiMap.end() ) @@ -1120,7 +1120,7 @@ bool MbFaceShell::FindIndexByFaces( const FacesPointersVector & initFaces, ItemI if ( directFind ) { for ( size_t i = 0; i < initFacesCount; ++i ) { const MbFace * face = initFaces[i]; - if ( face != c3d_null ) { + if ( face != nullptr ) { size_t i0 = GetFaceIndex( *face ); if ( i0 != SYS_MAX_T ) { index.Init( *face, i0 ); @@ -1145,7 +1145,7 @@ bool MbFaceShell::FindConstFacesByIndex( const ItemIndices & indices, ConstFaces for ( size_t j = 0, indicesCnt = indices.size(); j < indicesCnt; ++j ) { MbItemIndex & index = const_cast(indices[j]); // у stl доступ честный как const, у SArray дает на редактирование findFace = FindFaceByIndex( index ); - if ( findFace != c3d_null ) { + if ( findFace != nullptr ) { initFaces.push_back( findFace ); ::DetachItem( findFace ); } @@ -1166,7 +1166,7 @@ bool MbFaceShell::FindFacesByIndex( const ItemIndices & indices, FacesPointersVe for ( size_t j = 0, indicesCnt = indices.size(); j < indicesCnt; ++j ) { MbItemIndex & index = const_cast(indices[j]); // у stl доступ честный как const, у SArray дает на редактирование findFace = const_cast(FindFaceByIndex( index )); - if ( findFace != c3d_null ) { + if ( findFace != nullptr ) { initFaces.push_back( findFace ); ::DetachItem( findFace ); } @@ -1185,15 +1185,15 @@ bool MbFaceShell::GetBoundaryEdges( ConstEdgesVector & boundaryEdges ) const const size_t boundaryCnt = boundaryEdges.size(); for ( size_t i = 0, facesCnt = faceSet.size(); i < facesCnt; ++i ) { const MbFace * face = faceSet[i]; - if ( face == c3d_null ) + if ( face == nullptr ) continue; for ( size_t j = 0, loopsCnt = face->GetLoopsCount(); j < loopsCnt; ++j ) { const MbLoop * loop = face->_GetLoop( j ); - if ( loop == c3d_null ) + if ( loop == nullptr ) continue; for ( size_t k = 0, edgesCnt = loop->GetEdgesCount(); k < edgesCnt; ++k ) { const MbOrientedEdge * orientEdge = loop->_GetOrientedEdge( k ); - if ( orientEdge != c3d_null ) { + if ( orientEdge != nullptr ) { c3d::ConstEdgeSPtr edge( &orientEdge->GetCurveEdge() ); if ( edge->IsBoundaryFace() ) boundaryEdges.push_back( edge ); @@ -1294,14 +1294,14 @@ public: if ( controlFaces.size() > 0 && sortedDelFaces.size() > 0 ) { for ( size_t k = controlFaces.size(); k--; ) { if ( std::binary_search( sortedDelFaces.begin(), sortedDelFaces.end(), controlFaces[k] ) ) { - controlFaces[k] = c3d_null; + controlFaces[k] = nullptr; res = true; } } if ( res ) { std::sort( controlFaces.begin(), controlFaces.end() ); controlFaces.erase( std::unique( controlFaces.begin(), controlFaces.end() ), controlFaces.end() ); - if ( controlFaces.front() == c3d_null ) + if ( controlFaces.front() == nullptr ) controlFaces.erase( controlFaces.begin() ); } } @@ -1335,19 +1335,19 @@ private: public: /// \ru Конструктор по умолчанию \en Default constructor - MbEdgeFunction () : edge(c3d_null), function(c3d_null), slideway(c3d_null) {} + MbEdgeFunction () : edge(nullptr), function(nullptr), slideway(nullptr) {} /// \ru Конструктор по ребру и функции. \en Constructor by an edge and function. - MbEdgeFunction ( const MbCurveEdge * e, const MbFunction * f ) : edge(e), function(f), slideway(c3d_null) {} + MbEdgeFunction ( const MbCurveEdge * e, const MbFunction * f ) : edge(e), function(f), slideway(nullptr) {} /// \ru Конструктор по ребру и опорной кривой. \en Constructor by an edge and a supporting curve. - MbEdgeFunction ( const MbCurveEdge * e, const MbCurve3D * c ) : edge(e), function(c3d_null), slideway(c) {} + MbEdgeFunction ( const MbCurveEdge * e, const MbCurve3D * c ) : edge(e), function(nullptr), slideway(c) {} /// \ru Конструктор по другому ребру с функцией. \en Constructor by other edge with a function. MbEdgeFunction ( const MbEdgeFunction & other ) : edge(other.edge), function(other.function), slideway(other.slideway) {} ~MbEdgeFunction() {} public: /// \ru Инициализация по ребру и функции. \en Initialization by an edge and a function. - void Init( const MbCurveEdge * e, const MbFunction * f ) { edge = e; function = f; slideway = c3d_null; } + void Init( const MbCurveEdge * e, const MbFunction * f ) { edge = e; function = f; slideway = nullptr; } /// \ru Инициализация по ребру и опорной кривой. \en Initialization by an edge and a supporting curve. - void Init( const MbCurveEdge * e, const MbCurve3D * c ) { edge = e; function = c3d_null; slideway = c; } + void Init( const MbCurveEdge * e, const MbCurve3D * c ) { edge = e; function = nullptr; slideway = c; } /// \ru Дать ребро. \en Get an edge. const MbCurveEdge * Edge() const { return edge; } /// \ru Дать функцию изменения радиуса. \en Get a function of radius changing. @@ -1545,7 +1545,7 @@ public: /// \ru Конструктор по умолчанию. \en Default constructor. MbPntLoc() : pntLoc ( iloc_Undefined ) - , shell ( c3d_null ) + , shell ( nullptr ) , ind ( SYS_MAX_T ) , dist ( MB_MAXDOUBLE ) , n ( MB_MAXDOUBLE ) @@ -1569,7 +1569,7 @@ public: /// \ru Получить положение пространственной точки. \en Get location of spatial point MbeItemLocation GetLocation() const { return pntLoc; } /// \ru Выбрана ли грань? \en Is a face chosen? - bool IsFaceSelected() const { return ((shell != c3d_null) && (ind < shell->GetFacesCount()) && (shell->GetFace(ind) != c3d_null)); } + bool IsFaceSelected() const { return ((shell != nullptr) && (ind < shell->GetFacesCount()) && (shell->GetFace(ind) != nullptr)); } /// \ru Выполнена ли классификация по грани? \en Is classification by the face performed? bool IsFaceData() const { return (IsFaceSelected() && !shell->IsTemporal(ind)) ? true : false; } /// \ru Выполнена ли классификация по грани сопровождения? \en Is classification by the face of maintenance performed? @@ -1578,7 +1578,7 @@ public: /// \ru Получить индекс грани. \en Get an index of a face. size_t GetFaceIndex() const { return ind; } /// \ru Получить грань. \en Get a face. - const MbFace * GetFace() const { return (IsFaceSelected() ? shell->GetFace(ind) : c3d_null); } + const MbFace * GetFace() const { return (IsFaceSelected() ? shell->GetFace(ind) : nullptr); } /// \ru Получить расстояние до точки проекции. \en Get the distance to projection point. double GetDistance() const { return dist; } /// \ru Получить двумерную точку проекции. \en Get two-dimensional projection point. @@ -1598,7 +1598,7 @@ public: bool IsCorner() const { return corn; } /// \ru Получить поверхности грани. \en Get surfaces of a face. - const MbSurface * GetFaceSurface() const { return (IsFaceSelected() ? &shell->GetFace(ind)->GetSurface() : c3d_null); } + const MbSurface * GetFaceSurface() const { return (IsFaceSelected() ? &shell->GetFace(ind)->GetSurface() : nullptr); } /// \ru Получить ориентацию грани относительно поверхности. \en Get face orientation relative a surface. bool GetFaceSense() const { return (IsFaceSelected() ? shell->GetFace(ind)->IsSameSense() : true); } /// \ru Получить поверхность смежной грани. \en Get a surface of adjacent face. @@ -1614,7 +1614,7 @@ public: void Reset() { pntLoc = iloc_Undefined; - shell = c3d_null; + shell = nullptr; ind = SYS_MAX_T; dist = MB_MAXDOUBLE; n = MB_MAXDOUBLE; @@ -1682,7 +1682,7 @@ public: */ // --- template -size_t SetEdgesLabel( const FacesVector & faceSet, MbeLabelState label, void * key = c3d_null ) +size_t SetEdgesLabel( const FacesVector & faceSet, MbeLabelState label, void * key = nullptr ) { size_t maxCount = 1; diff --git a/C3d/Include/topology_item.h b/C3d/Include/topology_item.h index 79f517a..63d2d8e 100644 --- a/C3d/Include/topology_item.h +++ b/C3d/Include/topology_item.h @@ -103,11 +103,11 @@ public: /// \ru Деструктор. \en Destructor without parameters. ~MbLabel(); /// \ru Установить частную или собственную метку (соответствующую ключу). \en Set own or private label (according to the key). - void SetLabel( const MbeLabelState, void * key = c3d_null ); + void SetLabel( const MbeLabelState, void * key = nullptr ); /// \ru Установить частную или собственную метку (соответствующую ключу). \en Set own or private label (according to the key). void SetLabel( const MbeLabelState, void * key, bool setLock ); /// \ru Получить частную или собственную метку (соответствующую ключу). \en Get own or private label (according to thew key). - int8 GetLabel( void * key = c3d_null ); + int8 GetLabel( void * key = nullptr ); /// \ru Удалить частные метки(освободить память) соответствующие ключу. \en Remove private labels (free memory) according to the key. void DeletePrivate( void * key ); /// \ru Присвоить значение собственной метке. \en Assign values to own label. @@ -232,7 +232,7 @@ public : \en Registrator. \~ \ingroup Topology_Items */ - virtual void Transform( const MbMatrix3D & matr, MbRegTransform * iReg = c3d_null ) = 0; + virtual void Transform( const MbMatrix3D & matr, MbRegTransform * iReg = nullptr ) = 0; /** \brief \ru Сдвинуть вдоль вектора. \en Move along a vector. \~ @@ -250,7 +250,7 @@ public : \en Registrator. \~ \ingroup Topology_Items */ - virtual void Move ( const MbVector3D & to, MbRegTransform * iReg = c3d_null ) = 0; + virtual void Move ( const MbVector3D & to, MbRegTransform * iReg = nullptr ) = 0; /** \brief \ru Повернуть вокруг оси. \en Rotate around an axis. \~ @@ -270,7 +270,7 @@ public : \en Registrator. \~ \ingroup Topology_Items */ - virtual void Rotate ( const MbAxis3D & axis, double angle, MbRegTransform * iReg = c3d_null ) = 0; + virtual void Rotate ( const MbAxis3D & axis, double angle, MbRegTransform * iReg = nullptr ) = 0; /// \ru Вычислить расстояние до точки. \en Calculate the distance to a point. virtual double DistanceToPoint( const MbCartPoint3D & ) const = 0; @@ -324,15 +324,15 @@ public : bool IsOwnChangedWeakly() const; /// \ru Получить метку. \en Get label. - MbeLabelState GetLabel( void * key = c3d_null ) const { return (MbeLabelState)label.GetLabel(key); } + MbeLabelState GetLabel( void * key = nullptr ) const { return (MbeLabelState)label.GetLabel(key); } /// \ru Установить метку. \en Set a label of the loop. - void SetOwnLabel( MbeLabelState l, void * key = c3d_null ) const { label.SetLabel( l, key ); } + void SetOwnLabel( MbeLabelState l, void * key = nullptr ) const { label.SetLabel( l, key ); } /// \ru Установить метку. \en Set a label of the loop. void SetOwnLabel( MbeLabelState l, void * key, bool setLock ) const { if ( setLock || GetUseCount() > 1 ) return SetOwnLabel( l, key ); label.SetLabel( l, key ); } /// \ru Предназначен ли объект для удаления? Определяется по меткам. \en Is this object intended for deletion? This is defined by labels. - bool ToDelete() const { return( (MbeLabelState)label.GetLabel(c3d_null) == ls_Delete || (MbeLabelState)label.GetLabel(c3d_null) == ls_Error ); } + bool ToDelete() const { return( (MbeLabelState)label.GetLabel(nullptr) == ls_Delete || (MbeLabelState)label.GetLabel(nullptr) == ls_Error ); } /// \ru Удалить частную метку. \en Remove private label. - void RemovePrivateLabel ( void * key = c3d_null ) const { label.DeletePrivate(key); } + void RemovePrivateLabel ( void * key = nullptr ) const { label.DeletePrivate(key); } /// \ru Копирование данных объекта. \en Copying of the object data. void Assign( const MbTopologyItem & ); @@ -403,11 +403,11 @@ public: /// \ru Тип элемента. \en A type of element. virtual MbeTopologyType IsA() const; // \ru Преобразовать согласно матрице. \en Transform according to the matrix. - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Сдвинуть вдоль вектора. \en Move along a vector. - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); //\ru Повернуть вокруг оси. \en Rotate around an axis. - virtual void Rotate ( const MbAxis3D &, double, MbRegTransform * = c3d_null ); + virtual void Rotate ( const MbAxis3D &, double, MbRegTransform * = nullptr ); public: // \ru Вычислить расстояние до точки. \en Calculate the distance to a point. virtual double DistanceToPoint( const MbCartPoint3D & ) const; diff --git a/C3d/Include/wire_frame.h b/C3d/Include/wire_frame.h index f863e6e..6e4af86 100644 --- a/C3d/Include/wire_frame.h +++ b/C3d/Include/wire_frame.h @@ -63,17 +63,17 @@ public : /// \ru Конструктор без параметров. \en Constructor without parameters. MbWireFrame(); /// \ru Конструктор по кривой и строителю. \en Constructor by a curve and creator. - MbWireFrame( const MbCurve3D &, const MbCreator * = c3d_null ); + MbWireFrame( const MbCurve3D &, const MbCreator * = nullptr ); /// \ru Конструктор по множеству кривых и строителю. \en Constructor by a set of curves and creator. - MbWireFrame( const RPArray &, const MbCreator * = c3d_null ); + MbWireFrame( const RPArray &, const MbCreator * = nullptr ); /// \ru Конструктор по множеству кривых и строителю. \en Constructor by a set of curves and creator. - MbWireFrame( const c3d::SpaceCurvesSPtrVector &, const MbCreator * = c3d_null ); + MbWireFrame( const c3d::SpaceCurvesSPtrVector &, const MbCreator * = nullptr ); /// \ru Конструктор по ребру и строителю. \en Constructor by an edge and creator. - MbWireFrame( const MbEdge &, const MbCreator * = c3d_null, bool same = true ); + MbWireFrame( const MbEdge &, const MbCreator * = nullptr, bool same = true ); /// \ru Конструктор по множеству рёбер и строителю. \en Constructor by a set of edges and creator. - MbWireFrame( const RPArray &, const MbCreator * = c3d_null, bool same = true ); + MbWireFrame( const RPArray &, const MbCreator * = nullptr, bool same = true ); /// \ru Конструктор по множеству рёбер и строителю. \en Constructor by a set of edges and creator. - MbWireFrame( const c3d::WireEdgesSPtrVector &, const MbCreator * = c3d_null, bool same = true ); + MbWireFrame( const c3d::WireEdgesSPtrVector &, const MbCreator * = nullptr, bool same = true ); /// \ru Деструктор. \en Destructor. virtual ~MbWireFrame(); @@ -83,10 +83,10 @@ public : // \ru Общие функции геометрического объекта. \en Common functions of a geometric object. virtual MbeSpaceType IsA() const; // \ru Тип объекта. \en An object type. - virtual MbSpaceItem & Duplicate( MbRegDuplicate * iReg = c3d_null ) const; // \ru Создать копию. \en Create a copy. - virtual void Transform( const MbMatrix3D &, MbRegTransform * = c3d_null ); // \ru Преобразовать согласно матрице. \en Transform according to the matrix. - virtual void Move ( const MbVector3D &, MbRegTransform * = c3d_null ); // \ru Сдвинуть вдоль вектора. \en Translate along a vector. - virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = c3d_null ); // \ru Повернуть вокруг оси. \en Rotate about an axis. + virtual MbSpaceItem & Duplicate( MbRegDuplicate * iReg = nullptr ) const; // \ru Создать копию. \en Create a copy. + virtual void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ); // \ru Преобразовать согласно матрице. \en Transform according to the matrix. + virtual void Move ( const MbVector3D &, MbRegTransform * = nullptr ); // \ru Сдвинуть вдоль вектора. \en Translate along a vector. + virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ); // \ru Повернуть вокруг оси. \en Rotate about an axis. virtual bool IsSame ( const MbSpaceItem &, double accuracy = LENGTH_EPSILON ) const; // \ru Являются ли объекты равными? \en Are the objects equal? virtual bool IsSimilar( const MbSpaceItem & ) const; // \ru Являются ли объекты подобными? \en Are the objects similar? virtual bool SetEqual ( const MbSpaceItem & ); // \ru Сделать объекты равными. \en Make the objects equal. @@ -114,9 +114,9 @@ public : /// \ru Выдать количество ребер каркаса. \en Get the number of edges of the frame. size_t GetEdgesCount() const { return edges.size(); } /// \ru Выдать объект по индексу. \en Get the item by index. - const MbEdge * GetEdge( size_t i ) const { return (i < edges.size()) ? edges[i] : c3d_null; } + const MbEdge * GetEdge( size_t i ) const { return (i < edges.size()) ? edges[i] : nullptr; } /// \ru Выдать объект по индексу для возможного редактирования. \en Get the item by index for the possible editing. - MbEdge * SetEdge( size_t i ) { return (i < edges.size()) ? edges[i] : c3d_null; } + MbEdge * SetEdge( size_t i ) { return (i < edges.size()) ? edges[i] : nullptr; } /// \ru Получить ребра. \en Get edges. template @@ -211,10 +211,10 @@ public : If beginSafe == false then the edge saves its ending piece. According to the parameter 'eps' drop out value in the container 'params', coinciding with each other and with the initial and final parameters of the curve. The container 'edges' contains cut parts. \~ - \params[in, out] targetEdge - \ru Ребро для разрезания. Возвращается урезанный кусок с учетом флага beginSafe или c3d_null, + \params[in, out] targetEdge - \ru Ребро для разрезания. Возвращается урезанный кусок с учетом флага beginSafe или nullptr, если параметр разрезания находится на расстоянии меньшим еps от соответствующего конца кривой, \en Edge for cutting. The return value of 'targetEdge' is the shortened edge according to 'beginSafe' flag - or c3d_null, if the cut param in 'params' lies at the distance less than 'eps' from the corresponding end of the curve, + or nullptr, if the cut param in 'params' lies at the distance less than 'eps' from the corresponding end of the curve, \param[in] params - \ru Параметры кривой для разбиения ребра, \en Parameters of intersection curve of edge to split, \~ \param[in] beginSafe - \ru Ребро сохранит начальную часть (true) или ребро сохранит конечную часть (false), @@ -326,7 +326,7 @@ void MbWireFrame::GetCurves( CurvesVector & curves ) const c3d::SpaceCurveSPtr curve; for ( size_t k = 0; k < edgesCnt; ++k ) { const MbEdge * edge = edges[k]; - if ( edge != c3d_null ) { + if ( edge != nullptr ) { curve = const_cast( &edge->GetCurve() ); curves.push_back( curve ); ::DetachItem( curve ); @@ -342,7 +342,7 @@ template void MbWireFrame::AddEdges( const WireEdgesVector & items, bool same ) { bool add = false; - MbRegDuplicate * iReg = c3d_null; + MbRegDuplicate * iReg = nullptr; MbAutoRegDuplicate autoReg( iReg ); size_t addCnt = items.size(); @@ -352,7 +352,7 @@ void MbWireFrame::AddEdges( const WireEdgesVector & items, bool same ) for ( size_t k = 0; k < addCnt; ++k ) { const MbEdge * item = items[k]; - if ( item != c3d_null ) { + if ( item != nullptr ) { edge = same ? const_cast(item) : item->DataDuplicate( iReg ); edge->AddRef(); edges.push_back( edge ); @@ -382,7 +382,7 @@ template void ExtractCurvesDeleteFrame( MbWireFrame *& wireFrame, CurvesVector & curves ) { - if ( wireFrame != c3d_null ) { + if ( wireFrame != nullptr ) { c3d::SpaceCurvesSPtrVector wireCurves; wireFrame->GetCurves( wireCurves ); ::DeleteItem( wireFrame ); @@ -393,7 +393,7 @@ void ExtractCurvesDeleteFrame( MbWireFrame *& wireFrame, curves.reserve( curves.size() + wireCurvesCnt ); for ( size_t k = 0; k < wireCurvesCnt; ++k ) { MbCurve3D * curve = ::DetachItem( wireCurves[k] ); - if ( curve != c3d_null ) { + if ( curve != nullptr ) { curves.push_back( curve ); } } @@ -418,14 +418,14 @@ inline void ExtractCurveDeleteFrame( MbWireFrame *& wireFrame, MbCurve3D *& curve ) { - if ( wireFrame != c3d_null ) { + if ( wireFrame != nullptr ) { c3d::WireEdgeSPtr edge( wireFrame->DetachEdge( 0 ) ); // \ru Отцепить объект \en Detach an object ::DeleteItem( wireFrame ); - if ( edge != c3d_null ) { + if ( edge != nullptr ) { curve = &edge->SetCurve(); ::AddRefItem( curve ); - edge = c3d_null; + edge = nullptr; ::DecRefItem( curve ); } } @@ -453,7 +453,7 @@ void ExtractCurveDeleteFrame( MbWireFrame *& wireFrame, MATH_FUNC (bool) CreateWireFrame( MbWireFrame *& result, const RPArray & curves, const MbSNameMaker & snMaker, - const MbCreator * creator = c3d_null ); + const MbCreator * creator = nullptr ); //------------------------------------------------------------------------------ @@ -477,7 +477,7 @@ MATH_FUNC (bool) CreateWireFrame( MbWireFrame *& result, MATH_FUNC (bool) CreateWireFrame( MbWireFrame *& result, const MbCurve3D & curve, const MbSNameMaker & snMaker, - const MbCreator * creator = c3d_null ); + const MbCreator * creator = nullptr ); #endif // __WIRE_FRAME_H diff --git a/C3d/Lib/x32/Debug/c3d.lib b/C3d/Lib/x32/Debug/c3d.lib index 5a7e217..1d04330 100644 Binary files a/C3d/Lib/x32/Debug/c3d.lib and b/C3d/Lib/x32/Debug/c3d.lib differ diff --git a/C3d/Lib/x32/Release/c3d.lib b/C3d/Lib/x32/Release/c3d.lib index 5a10341..a495544 100644 Binary files a/C3d/Lib/x32/Release/c3d.lib and b/C3d/Lib/x32/Release/c3d.lib differ diff --git a/C3d/Lib/x64/Debug/c3d.lib b/C3d/Lib/x64/Debug/c3d.lib index e0e5eee..755acfe 100644 Binary files a/C3d/Lib/x64/Debug/c3d.lib and b/C3d/Lib/x64/Debug/c3d.lib differ diff --git a/C3d/Lib/x64/Release/c3d.lib b/C3d/Lib/x64/Release/c3d.lib index c75134b..d31484b 100644 Binary files a/C3d/Lib/x64/Release/c3d.lib and b/C3d/Lib/x64/Release/c3d.lib differ diff --git a/lib3mf/Lib/lib3mfD32.lib b/lib3mf/Lib/lib3mfD32.lib index a8d5464..cdfa711 100644 Binary files a/lib3mf/Lib/lib3mfD32.lib and b/lib3mf/Lib/lib3mfD32.lib differ diff --git a/lib3mf/Lib/lib3mfD32.pdb b/lib3mf/Lib/lib3mfD32.pdb index 6f61afd..c14923f 100644 Binary files a/lib3mf/Lib/lib3mfD32.pdb and b/lib3mf/Lib/lib3mfD32.pdb differ diff --git a/lib3mf/Lib/lib3mfD64.pdb b/lib3mf/Lib/lib3mfD64.pdb index 1367005..a6818dd 100644 Binary files a/lib3mf/Lib/lib3mfD64.pdb and b/lib3mf/Lib/lib3mfD64.pdb differ diff --git a/lib3mf/Lib/lib3mfR32.lib b/lib3mf/Lib/lib3mfR32.lib index a454401..d5313dc 100644 Binary files a/lib3mf/Lib/lib3mfR32.lib and b/lib3mf/Lib/lib3mfR32.lib differ