C3D Toolkit  Kernel - 117982, Vision - 2.9.2.2

Composite function. More...

#include <func_composite_function.h>

+ Inheritance diagram for MbCompositeFunction:
+ Collaboration diagram for MbCompositeFunction:

Public Member Functions

 MbCompositeFunction (MbFunction &segment, bool same)
 Constructor by function.
 
template<class FunctionVector >
 MbCompositeFunction (const FunctionVector &initSegments, bool same)
 Constructor by functions.
 
MbeFunctionType IsA () const override
 A type of element.
 
MbFunctionDuplicate () const override
 Create a copy of the element.
 
bool IsSame (const MbFunction &other, double accuracy=LENGTH_EPSILON) const override
 Determine whether objects are equal.
 
bool IsSimilar (const MbFunction &) const override
 Determine whether objects are similar.
 
bool SetEqual (const MbFunction &) override
 Make equal.
 
void GetProperties (MbProperties &) override
 Get properties of the object.
 
void SetProperties (const MbProperties &) override
 Set properties of the object.
 
double GetTMax () const override
 Get the maximum value of parameter.
 
double GetTMin () const override
 Get the minimum value of parameter.
 
bool IsClosed () const override
 Get the closeness of a function.
 
void SetClosed (bool cl) override
 Set the closeness of a function.
 
double Value (double &t) const override
 The value of function for a given t.
 
double FirstDer (double &t) const override
 The first derivative with respect to t.
 
double SecondDer (double &t) const override
 The second derivative with respect to t.
 
double ThirdDer (double &t) const override
 The third derivative with respect to t.
 
double _Value (double t) const override
 The value of extended function for a given t.
 
double _FirstDer (double t) const override
 The first derivative of extended function with respect to t.
 
double _SecondDer (double t) const override
 The second derivative of extended function with respect to t.
 
double _ThirdDer (double t) const override
 The third derivative of extended function with respect to t.
 
void Explore (double &t, bool ext, double &val, double &fir, double *sec, double *thr) const override
 Calculate value and derivatives of object for given parameter. More...
 
void Inverse (MbRegTransform *iReg=nullptr) override
 Change direction.
 
double Step (double t, double sag) const override
 Calculate a step by the sag for a given parameter t.
 
double DeviationStep (double t, double angle) const override
 Calculate a step by the angular deviation for a given parameter t.
 
MbFunctionTrimmed (double t1, double t2, int sense) const override
 Create a function in part of the function between the parameters t1 and t2 choosing the direction.
 
MbFunctionBreakFunction (double t, bool beg) override
 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.
 
void Break (double t1, double t2)
 Select a part of a function.
 
double MinValue (double &t) const override
 The minimum value of function.
 
double MaxValue (double &t) const override
 The maximum value of function.
 
double MidValue () const override
 The middle value of function.
 
bool IsGood () const override
 Correctness of function.
 
bool IsConst () const override
 Whether the function is constant.
 
bool IsLine () const override
 Whether the function is linear.
 
void SetOffsetFunc (double off, double scale) override
 Shift a function.
 
bool SetLimitParam (double newTMin, double newTMax) override
 Set the range of parameter.
 
void SetLimitValue (size_t n, double newValue) override
 Set the value at the end (1 - at start point, 2 - at end point).
 
double GetLimitValue (size_t n) const override
 Get the value at the end (1 - at start point, 2 - at end point).
 
void SetLimitDerive (size_t n, double newValue, double dt) override
 Set the value of derivative at the end (1 - at start point, 2 - at end point).
 
double GetLimitDerive (size_t n) const override
 Get the value of derivative at the end (1 - at start point, 2 - at end point).
 
bool InsertValue (double t, double newValue) override
 Set the value for the parameter t.
 
void BreakPoints (std::vector< double > &vBreaks, double precision=ANGLE_REGION) const override
 \ ru Определение точек излома контура. The determination of contour smoothness break points.
 
- Public Member Functions inherited from MbFunction
bool IsZero (double t, double accuracy=METRIC_REGION) const
 The presence of a null function value.
 
double GetTMid () const
 Return the middle of parametric range.
 
double GetParamLength () const
 The parametric length.
 
bool IsParamOn (double t, double eps) const
 Whether the parameter belongs to the function domain.
 
void PrepareWrite () const
 Prepare for writing the registered object.
 
virtual bool IsPeriodic () const
 Periodicity of a closed curve.
 
MbeNewtonResult ArgumentNewton (double value, bool ext, double funcEpsilon, size_t iterLimit, double &t) const
 
bool CuttingFunction (SArray< double > &params, bool beginSafe, double eps, RPArray< MbFunction > &cutted)
 Function break by the parameters: begs == true - save the initial half, beg == false - save the final half.
 
virtual void GetCharacteristicParams (std::vector< double > &tSpecific, double t1, double t2)
 Get the parameters of special behaviour on the interval from t1 to t2 (for cos it is Pi*n).
 
- Public Member Functions inherited from MbRefItem
virtual MbeRefType RefType () const
 Registration type (for copying, duplication).
 
refcount_t GetUseCount () const
 Get count of references (get count of owners of an object).
 
refcount_t AddRef () const
 Increase count of references by one.
 
refcount_t DecRef () const
 Decrease count of references by one.
 
refcount_t Release () const
 Decrease count of references by one and if count of references became zero, then remove itself.
 
- Public Member Functions inherited from TapeBase
 TapeBase (RegistrableRec regs=noRegistrable)
 Constructor.
 
 TapeBase (const TapeBase &)
 Copy-constructor.
 
virtual ~TapeBase ()
 Destructor.
 
RegistrableRec GetRegistrable () const
 Whether the stream class is registrable.
 
void SetRegistrable (RegistrableRec regs=registrable) const
 Set the state of registration of the stream class.
 
virtual const char * GetPureName (const VersionContainer &) const
 Get the class name.
 
virtual bool IsFamilyRegistrable () const
 Whether the object belongs to a registrable family.
 

Protected Member Functions

 MbCompositeFunction ()
 Empty composite function.
 
 MbCompositeFunction (const MbCompositeFunction &)
 Copy constructor.
 
- Protected Member Functions inherited from MbRefItem
 MbRefItem ()
 Constructor without parameters.
 

Protected Attributes

RPArray< MbFunctionsegments
 A set of composite function segments.
 
bool closed
 An attribute of function closedness.
 
double paramLength
 Parametric length of a composite function.
 

Function for working with segments of contour

template<class FunctionVector >
bool Init (const FunctionVector &initSegments, bool same, bool cls)
 Initialize by curves (sameCurves - curves or their copies).
 
ptrdiff_t FindSegment (double &t, double &tSeg) const
 Find a contour segment. More...
 
double FindParameter (size_t iSeg, double tSeg) const
 Find a contour segment. More...
 
size_t GetSegmentsCount () const
 Get the number of contour segments.
 
template<class CurvesVector >
void GetSegments (CurvesVector &curves) const
 Get contour segments.
 
void DetachSegments ()
 Detach all segments of contour.
 
void DeleteSegments ()
 Delete used segments and remove other segments.
 
void DeleteSegment (size_t ind)
 Delete the segment of contour.
 
MbFunctionDetachSegment (size_t ind)
 Detach the segment of contour.
 
const MbFunctionGetSegment (size_t ind) const
 Get contour segment by the index.
 
MbFunctionSetSegment (size_t ind)
 Get contour segment by the index.
 
void SetSegment (MbFunction &newSegment, size_t ind, bool same)
 Replace a segment in the contour.
 
void AddSegment (MbFunction &newSegment, bool same)
 Add a segment to the contour.
 
void AddAtSegment (MbFunction &newSegment, size_t ind, bool same)
 Add a segment to the contour before the segment with index ind.
 
void AddAfterSegment (MbFunction &newSegment, size_t ind, bool same)
 Add a segment to the contour after the segment with index ind.
 
MbFunctionAddSegment (MbFunction &pBasis, double t1, double t2, int sense)
 Add a (truncated) segment copy to the end of the contour. More...
 
void SegmentsAdd (MbFunction &newSegment, bool calculateParamLength=true)
 Add a segment to the contour without checking. Reset variables caching.
 
void Clear ()
 
void SegmentsReserve (size_t additionalSpace)
 Control of memory allocation in the array "segments". More...
 
void SegmentsAdjust ()
 Free the unnecessary memory.
 
bool CheckConnection (double eps=METRIC_PRECISION) const
 Check for contour continuity.
 
void CalculateParamLength ()
 Calculate parametric length.
 
void CheckClosed (double eps)
 Set the closedness attribute of contour.
 

Detailed Description

Composite function.

Scalar composite function of scalar parameter consists of a set of functions (segments).
The beginning of each subsequent segment of composite function is joined to the end of the previous one. Composite function is closed if the end of last segment is joined to the beginning of the first segment.
If the segments of a composite function are not smoothly joined then the composite function will have breaks. The initial value of the composite function is equal to zero. The parametric length of a composite function is equal to the sum of the parametric lengths of components of its segments.
Other composite curves are not used as segments of the composite function. If it is required to create a composite function based on other composite functions, then the latter must be regarded as a set of their functions, and not as single functions.

Member Function Documentation

◆ Explore()

void MbCompositeFunction::Explore ( double &  t,
bool  ext,
double &  val,
double &  fir,
double *  sec,
double *  thr 
) const
overridevirtual

Calculate value and derivatives of object for given parameter.

Values of point and derivatives are calculated on parameter area and on extended axis.

Parameters
[in]t- Parameter.
[in]ext- On parameters area (false), on extended axis (true).
[out]val- Value.
[out]fir- Derivative with respect to t.
[out]sec- Second derivative with respect to t, if not nullptr.
[out]thr- Third derivative with respect to t, if not nullptr.

Reimplemented from MbFunction.

◆ FindSegment()

ptrdiff_t MbCompositeFunction::FindSegment ( double &  t,
double &  tSeg 
) const

Find a contour segment.

Find a contour segment by parameter on contour.

Parameters
[in,out]t- Composite function parameter.
[out]tSeg- Composite function segment parameter.
Returns
Returns the segment number in case of successful execution or -1.

◆ FindParameter()

double MbCompositeFunction::FindParameter ( size_t  iSeg,
double  tSeg 
) const

Find a contour segment.

Find a contour parameter by segment number and segment parameter.

Parameters
[in]iSeg- Segment nukmber (index).
[in]tSeg- Segment parameter.
Returns
Returns the contour parameter or UNDEFINED_DBL if fdailure.

◆ AddSegment()

MbFunction* MbCompositeFunction::AddSegment ( MbFunction pBasis,
double  t1,
double  t2,
int  sense 
)

Add a (truncated) segment copy to the end of the contour.

Add a (truncated) segment copy to the end of the contour.

Parameters
[in]pBasis-Initial function.
[in]t1- Truncation starting parameter.
[in]t2- Truncation ending parameter.
[in]sense- Direction of a trimmed function in relation to an initial function. sense = 1 - direction does not change. sense = -1 - direction changes to the opposite value.
Returns
Returns, if successful, a non-zero pointer to the added function.

◆ SegmentsReserve()

void MbCompositeFunction::SegmentsReserve ( size_t  additionalSpace)
inline

Control of memory allocation in the array "segments".

Reserve space.


The documentation for this class was generated from the following file: