Extern :
- C3d aggiornamento librerie ( 118044).
This commit is contained in:
@@ -17,6 +17,8 @@
|
||||
|
||||
|
||||
class MbTrimmedWireFrameInfo;
|
||||
class MbProjWireFrameParamsData;
|
||||
class MbSolid;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -543,4 +545,216 @@ public:
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Параметры операции построения проекции каркаса на тело, набор
|
||||
граней или поверхность.
|
||||
\en The parameters for creating a projection of a wireframe to a
|
||||
solid, set of faces or a surface. \~
|
||||
\details \ru Содержит параметры, необходимые для построения проекции набора кривых по нормали или по направлению
|
||||
на тело, набор граней или поверхность. \n
|
||||
\en Contains parameters required for normal or vector projection of a set of curves to a solid, set of faces
|
||||
or a surface. \n \~
|
||||
\ingroup WireFrame_Parameters
|
||||
\warning \ru В разработке.
|
||||
\en Under development. \~
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbProjectionWireFrameParams : public MbPrecision {
|
||||
private:
|
||||
const MbVector3D * _direction; ///< \ru Вектор направления проецирования (если не задан, то проекция по нормали). \en The direction of the vector projection (if not provided, normal projection is performed).
|
||||
bool _projOnParallel; ///< \ru Создавать ли проекции на поверхностях параллельных заданному вектору проецирования. \en Should the projection be performed onto surfaces parallel to a provided direction of the vector projection.
|
||||
bool _createExact; ///< \ru Создавать проекционную кривую при необходимости. \en Create a projection curve if necessary.
|
||||
bool _truncateByBounds; ///< \ru Усечь границами. \en Truncate by bounds.
|
||||
MbSNameMaker _nameMaker; ///< \ru Именователь с версией. \en An object defining the names with the version.
|
||||
std::unique_ptr<MbProjWireFrameParamsData> _paramsData; ///< \ru Для внутреннего использования. \en For internal use.
|
||||
|
||||
public:
|
||||
/** \brief \ru Конструктор по параметрам.
|
||||
\en Constructor by parameters. \~
|
||||
\details \ru В этом конструкторе задаются данные для проецирования кривой на поверхность.
|
||||
\en In this constructor, data is specified for projecting a curve onto a surface. \~
|
||||
\param[in] surface - \ru Поверхность для проецирования заданной кривой.
|
||||
\en A surface to project the specified curve onto. \~
|
||||
\param[in] curve - \ru Кривая для проецирования на заданную поверхность.
|
||||
\en A curve to project onto the specified surface. \~
|
||||
\param[in] direction - \ru Вектор направления проецирования (если не задан, то проекция по нормали).
|
||||
\en The direction of the vector projection (if not provided, normal projection is performed). \~
|
||||
\param[in] createExact - \ru Создавать проекционную кривую при необходимости.
|
||||
\en Create a projection curve if necessary. \~
|
||||
\param[in] truncateByBounds - \ru Усекать границами поверхности.
|
||||
\en Truncate by the surface bounds. \~
|
||||
\param[in] version - \ru Версия исполнения.
|
||||
\en The version. \~
|
||||
*/
|
||||
MbProjectionWireFrameParams( const MbSurface & surface,
|
||||
const MbCurve3D & curve,
|
||||
const MbVector3D * direction,
|
||||
const bool createExact,
|
||||
const bool truncateByBounds,
|
||||
const VERSION version = Math::DefaultMathVersion() );
|
||||
|
||||
/** \brief \ru Конструктор по параметрам.
|
||||
\en Constructor by parameters. \~
|
||||
\details \ru В этом конструкторе задаются данные для проецирования кривой на набор граней.
|
||||
\en In this constructor, data is specified for projecting a curve to a set of faces. \~
|
||||
\param[in] curve - \ru Кривая для проецирования на заданный набор граней.
|
||||
\en A curve to project to a specified set of faces. \~
|
||||
\param[in] faces - \ru Связный набор граней для проецирования заданной кривой.
|
||||
\en A connected set of faces to project the specified curve to. \~
|
||||
\param[in] direction - \ru Вектор направления проецирования (если не задан, то проекция по нормали).
|
||||
\en The direction of the vector projection (if not provided, normal projection is performed). \~
|
||||
\param[in] projOnParallel - \ru Создавать ли проекции на поверхностях параллельных заданному вектору проецирования.
|
||||
\en Should the projection be performed onto surfaces parallel to a provided direction of the vector projection. \~
|
||||
\param[in] createExact - \ru Создавать проекционную кривую при необходимости.
|
||||
\en Create a projection curve if necessary. \~
|
||||
\param[in] truncateByBounds - \ru Усекать границами.
|
||||
\en Truncate by bounds. \~
|
||||
\param[in] snMaker - \ru Именователь с версией.
|
||||
\en An object defining the names with the version. \~
|
||||
*/
|
||||
MbProjectionWireFrameParams( const MbCurve3D & curve,
|
||||
const c3d::FacesVector & faces,
|
||||
const MbVector3D * direction,
|
||||
const bool projOnParallel,
|
||||
const bool createExact,
|
||||
const bool truncateByBounds,
|
||||
const MbSNameMaker & snMaker );
|
||||
|
||||
/** \brief \ru Конструктор по параметрам.
|
||||
\en Constructor by parameters. \~
|
||||
\details \ru В этом конструкторе задаются данные для проецирования проволочного каркаса на тело.
|
||||
\en In this constructor, data is specified for projecting a wireframe to a solid. \~
|
||||
\param[in] wireFrame - \ru Проволочный каркас для проецирования на заданное тело.
|
||||
\en A wireframe to project to a specified solid. \~
|
||||
\param[in] sameWireFrame - \ru Использовать тот же экземпляр проволочного каркаса или создать копию.
|
||||
\en Use the same wireframe or copy it. \~
|
||||
\param[in] solid - \ru Тело для проецирования заданного проволочного каркаса.
|
||||
\en A solid to project the specified wireframe to. \~
|
||||
\param[in] sameCreators - \ru Использовать ли тот же экземпляр журнала тела или создать копию.
|
||||
\en Use the same creators of the solid or make a copy. \~
|
||||
\param[in] faceIndices - \ru Индексы граней оболочки тела.
|
||||
\en Indices of faces in the solid's shell. \~
|
||||
\param[in] direction - \ru Вектор направления проецирования (если не задан, то проекция по нормали).
|
||||
\en The direction of the vector projection (if not provided, normal projection is performed). \~
|
||||
\param[in] projOnParallel - \ru Создавать ли проекции на поверхностях параллельных заданному вектору проецирования.
|
||||
\en Should the projection be performed onto surfaces parallel to a provided direction of the vector projection. \~
|
||||
\param[in] createExact - \ru Создавать проекционную кривую при необходимости.
|
||||
\en Create a projection curve if necessary. \~
|
||||
\param[in] truncateByBounds - \ru Усекать границами.
|
||||
\en Truncate by bounds. \~
|
||||
\param[in] snMaker - \ru Именователь с версией.
|
||||
\en An object defining the names with the version. \~
|
||||
*/
|
||||
MbProjectionWireFrameParams( const MbWireFrame & wireFrame,
|
||||
const bool sameWireFrame,
|
||||
const MbSolid & solid,
|
||||
const bool sameCreators,
|
||||
const c3d::IndicesVector & faceIndices,
|
||||
const MbVector3D * direction,
|
||||
const bool projOnParallel,
|
||||
const bool createExact,
|
||||
const bool truncateByBounds,
|
||||
const MbSNameMaker & snMaker );
|
||||
|
||||
/// \ru Деструктор. \en Destructor.
|
||||
~MbProjectionWireFrameParams();
|
||||
|
||||
public:
|
||||
/// \ru Выдать вектор направления проецирования (nullptr если не задан). \en Get the direction of the vector projection (nullptr if not provided).
|
||||
const MbVector3D * GetDirection() const { return _direction; }
|
||||
|
||||
/// \ru Создавать ли проекции на поверхностях параллельных заданному вектору проецирования. \en Whether the projection should be performed onto surfaces parallel to a provided direction of the vector projection.
|
||||
bool GetProjectOnParallel() const { return _projOnParallel; }
|
||||
|
||||
/// \ru Создавать ли проекционную кривую при необходимости. \en Whether to create a projection curve if necessary.
|
||||
bool GetCreateExact() const { return _createExact; }
|
||||
|
||||
/// \ru Усекать ли границами. \en Whether to truncate by bounds.
|
||||
bool GetTruncateByBounds() const { return _truncateByBounds; }
|
||||
|
||||
/// \ru Получить именователь. \en Get an object defining the names.
|
||||
const MbSNameMaker & GetNameMaker() const { return _nameMaker; }
|
||||
|
||||
/// \ru Для внутреннего использования. \en For internal use.
|
||||
const MbProjWireFrameParamsData * GetParametersData() const { return _paramsData.get(); }
|
||||
|
||||
OBVIOUS_PRIVATE_COPY( MbProjectionWireFrameParams )
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Результаты операции построения проекционного проволочного каркаса.
|
||||
\en The results of creating a projection wireframe. \~
|
||||
\details \ru Результаты, полученные при построении проекции набора кривых по нормали или по направлению
|
||||
на тело, набор граней или поверхность. Результаты содержат полученный проекционный проволочный каркас.
|
||||
При проецировании на тело в атрибутах ребер лежат имена соответствующих граней этого тела.
|
||||
При проецировании на набор граней в результатах операции будет заполнен массив индексы которого являются
|
||||
индексами ребер каркаса, а значения являются индексами граней в исходном массиве. \n
|
||||
\en Results of normal or vector projection of a set of curves to a solid, set of faces
|
||||
or a surface. Results contain obtained projection wireframe.
|
||||
When projecting a wireframe to a solid, the attributes of the edges contain the names of corresponding faces.
|
||||
When projecting to a set of faces results of the operation contain an array where the indices are the indices
|
||||
of the edges in a wireframe, and the values are the indices of the faces in the input array. \n \~
|
||||
\ingroup WireFrame_Parameters
|
||||
\warning \ru В разработке.
|
||||
\en Under development. \~
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbProjectionWireFrameResults : public MbOperationResults {
|
||||
private:
|
||||
c3d::IndicesVector _resIndices; ///< \ru Индексы граней в исходном массиве, соответствующие ребрам полученного каркаса. \en The indices of faces in the input array corresponding to the edges of the obtained wireframe.
|
||||
c3d::WireFrameSPtr _resWireFrame; ///< \ru Проволочный каркас, построенный по полученным проекционным кривым. \en The resulting wireframe constructed using obtained projection curves.
|
||||
|
||||
public:
|
||||
/// \ru Конструктор по умолчанию. \en Default constructor.
|
||||
MbProjectionWireFrameResults()
|
||||
: MbOperationResults( )
|
||||
, _resIndices ( )
|
||||
, _resWireFrame ( nullptr )
|
||||
{}
|
||||
|
||||
public:
|
||||
/// \ru Инициализировать результаты по проволочному каркасу и индексам граней в исходном массиве, соответствующим полученным проекционным кривым. \en Initialize the results by the projection wireframe and the indices of faces in the input array corresponding to the obtained projection curves.
|
||||
template<class IndicesVector>
|
||||
void Init( MbWireFrame * resWireFrame, const IndicesVector & copyFrom ) {
|
||||
_resWireFrame = resWireFrame;
|
||||
_resIndices.clear();
|
||||
_resIndices.reserve( copyFrom.size() );
|
||||
|
||||
for ( size_t id : copyFrom ) {
|
||||
_resIndices.push_back( id );
|
||||
}
|
||||
}
|
||||
|
||||
/// \ru Выдать индексы граней в исходном массиве, соответствующие полученным проекционным кривым. \en Get the indices of faces in the input array corresponding to the obtained projection curves.
|
||||
template<class IndicesVector>
|
||||
void GetResIndices( IndicesVector & copyTo ) {
|
||||
copyTo.reserve( copyTo.size() + _resIndices.size() );
|
||||
|
||||
for ( size_t id : _resIndices ) {
|
||||
copyTo.push_back( id );
|
||||
}
|
||||
}
|
||||
|
||||
/// \ru Отцепить полученные проекционные кривые в заданный массив. \en Detach obtained projection curves into the specified array.
|
||||
template <class SpaceCurvesVector>
|
||||
void DetachCurves( SpaceCurvesVector & curves ) {
|
||||
MbWireFrame * wf = _resWireFrame.detach();
|
||||
|
||||
::ExtractCurvesDeleteFrame( wf, curves );
|
||||
};
|
||||
|
||||
/// \ru Выдать проекционный проволочный каркас. \en Get the projection wireframe.
|
||||
const c3d::WireFrameSPtr & GetResWireFrame() { return _resWireFrame; }
|
||||
|
||||
/// \ru Отцепить проекционный проволочный каркас. \en Detach the projection wireframe.
|
||||
MbWireFrame * DetachWireFrame() { return _resWireFrame.detach(); }
|
||||
|
||||
/// \ru Очистить результаты. \en Clear the results.
|
||||
void Clear() { _resIndices.clear(); _resWireFrame.reset(); }
|
||||
|
||||
OBVIOUS_PRIVATE_COPY( MbProjectionWireFrameResults )
|
||||
};
|
||||
|
||||
|
||||
#endif // __OP_WIREFRAME_PARAMETERS_H
|
||||
|
||||
Reference in New Issue
Block a user