MGCL V10  V10
MGCL V10
 全て クラス 名前空間 関数 変数 型定義 列挙型 列挙値 フレンド グループ ページ
MGKnotVector クラス

Defines Knot vector of B-Representation. [詳解]

MGKnotVector の継承関係図
MGNDDArray

公開メンバ関数

 MGKnotVector (int order=0, int bdim=0, const double *data=0)
 Construct garbage knot vector of specified size. [詳解]
 
 MGKnotVector (int order, int bdim, double init_value, double increment=1.0)
 
 MGKnotVector (const MGNDDArray &dtp, int order)
 Obtain knot vector from Data Point. [詳解]
 
 MGKnotVector (const MGKnotVector &vec2, const MGKnotArray &knots)
 
 MGKnotVector (int start_id, int num, const MGKnotVector &vec2)
 Construct by extracting sub interval of vec2. [詳解]
 
 MGKnotVector (const MGKnotVector &knotv, int order)
 Construct new order knot vector. [詳解]
 
 MGKnotVector (const MGKnotVector &knotv, double t1, double t2)
 
 MGKnotVector (const MGKnotVector &vec2)
 Copy Constructor. [詳解]
 
MGKnotVectoroperator= (const MGKnotVector &vec2)
 Assignment. [詳解]
 
MGKnotVector operator+ (double) const
 
MGKnotVectoroperator+= (double)
 
MGKnotVector operator- (double) const
 
MGKnotVectoroperator-= (double)
 
MGKnotVector operator- () const
 
MGKnotVector operator* (double) const
 Scaling. [詳解]
 
MGKnotVectoroperator*= (double)
 
bool operator== (const MGKnotVector &) const
 Compare two KnotVector if they are equal. [詳解]
 
bool operator!= (const MGKnotVector &knotv) const
 Return true if equal. [詳解]
 
int bdim () const
 
MGKnotVectorchange_knot_number (int nnew)
 Return BRep Dimension. [詳解]
 
MGKnotVectorchange_order (int order)
 
void change_range (double ts, double te)
 Change parameter range. [詳解]
 
void divide_span (int num)
 
int eval_coef (double x, double *coef, int nderiv=0, int left=0) const
 
bool in_range (double t) const
 Test if input parameter value is inside parameter range of the line. [詳解]
 
int locate (double tau, int left) const
 
int locate (double tau) const
 
int locate_multi (int start, int multi, int &index) const
 
MGKnotVectormix_knot_vector (const MGKnotVector &knot)
 
int order () const
 Return order. [詳解]
 
double param_e () const
 Return end parameter value. [詳解]
 
double param_s () const
 Return start parameter value. [詳解]
 
double param_error () const
 Return tolerance allowed in knot vector parameter space. [詳解]
 
double param_span () const
 Compute parameter span length. [詳解]
 
double param_normalize (double t) const
 
double range (double t) const
 
void reverse ()
 
double reverse_param (double t) const
 Obtain parameter value if this knot vector is reversed by reverse(). [詳解]
 
MGKnotVectorset_bdim (int brdim)
 
void set_null ()
 Set this as a null. [詳解]
 
int dump_size () const
 Dump Functions. [詳解]
 
int dump (MGOfstream &) const
 Dump Function. [詳解]
 
void size_change (int order, int bdim)
 
int restore (MGIfstream &)
 Restore Function. [詳解]
 
- 基底クラス MGNDDArray に属する継承公開メンバ関数
 MGNDDArray ()
 void constructor. [詳解]
 
 MGNDDArray (int n, const double *data=0)
 Constructor MGNDDArray of size n and lenght=n. [詳解]
 
 MGNDDArray (int n, double init, double increment=1.0)
 
 MGNDDArray (const MGBPointSeq &)
 From Data Point ordinate, obtain data point seq abscissa. [詳解]
 
 MGNDDArray (MGENDCOND begin, MGENDCOND end, const MGBPointSeq &)
 
 MGNDDArray (MGENDCOND begin, MGENDCOND end, const MGKnotVector &t)
 
 MGNDDArray (const MGNDDArray &, int nnew)
 
 MGNDDArray (const MGNDDArray &, double ts, double te)
 
 MGNDDArray (int start_id, int num, const MGNDDArray &array2)
 Construct by extracting sub interval of array2. [詳解]
 
 MGNDDArray (int id1, int num1, const MGNDDArray &array1, int id2, int num2, const MGNDDArray &array2)
 
 MGNDDArray (const MGNDDArray &nd)
 Copy constructor. [詳解]
 
virtual ~MGNDDArray ()
 
double operator[] (int i) const
 Access to i-th element. [詳解]
 
double operator() (int i) const
 
double & operator[] (int i)
 Access to i-th element. [詳解]
 
double & operator() (int i)
 
MGNDDArrayoperator= (const MGNDDArray &vec2)
 Assignment. [詳解]
 
MGNDDArray operator+ (double) const
 
MGNDDArrayoperator+= (double)
 
MGNDDArray operator- (double) const
 
MGNDDArrayoperator-= (double)
 
MGNDDArray operator- () const
 
MGNDDArray operator* (double scale) const
 Scaling. [詳解]
 
MGNDDArrayoperator*= (double scale)
 
bool operator== (const MGNDDArray &t2) const
 Copmarison operator. [詳解]
 
bool operator!= (const MGNDDArray &t2) const
 
int add_data (double value, int mult_max=1)
 
int add_data (const MGKnot &knot, int mult_max)
 
void copy_removing_multi (int start_id, int num, const MGNDDArray &array2)
 Copy data points from array by removing the mltiple knot. [詳解]
 
const double * data (int i=0) const
 Return a pointer to raw data of MGNDDArray. [詳解]
 
double * data (int i=0)
 Return a pointer to raw data of MGNDDArray. [詳解]
 
int del_data (int index)
 
bool is_null () const
 Test if this is null. [詳解]
 
int length () const
 Return the length of MGNDDArray. [詳解]
 
void set_length (int length)
 Set the length of effective data. [詳解]
 
void store_with_capacityCheck (int i, double data)
 
MGNDDArraychange_number (int nnew)
 
double ref (int i) const
 Reference to i-th element. [詳解]
 
void remove_too_near (bool allow_multi=false, double ratio=6.)
 Remove too near data points. [詳解]
 
void remove_too_near (MGBPointSeq &ordinates, bool allow_multi=false, double ratio=6.)
 Remove too near data points. Removal will be done with the ordinates. [詳解]
 
void reshape (int size, int start=0)
 
void resize (int nsize)
 
int capacity () const
 Return the size of MGNDDArray. [詳解]
 
MGNDDArrayupdate_from_knot (const MGKnotVector &t)
 Obtain data point from KnotVector t and replace own with it. [詳解]
 

フレンド

MG_DLL_DECLR friend MGKnotVector operator* (double scale, const MGKnotVector &t)
 
MG_DLL_DECLR friend std::ostream & operator<< (std::ostream &strm, const MGKnotVector &t)
 String stream Function. [詳解]
 

その他の継承メンバ

- 基底クラス MGNDDArray に属する継承限定公開変数類
int m_current
 current interval of the array is held. [詳解]
 

詳解

Defines Knot vector of B-Representation.

MGKnotVector is to represent a knot vector of a B-Spline. It is an array of double precision folating data that is non decreasing. Let n be a B-representaiton dimension, i.e., number of points of the control polygon. And let k be the order( or (k-1) be degree) of the B-rep, then the length of the kont vector is (n+k).

構築子と解体子

MGKnotVector::MGKnotVector ( int  order = 0,
int  bdim = 0,
const double *  data = 0 
)
explicit

Construct garbage knot vector of specified size.

引数
orderorder
bdimB-Rep dimension
dataall of the knot data sequence if data!=NULL.
MGKnotVector::MGKnotVector ( int  order,
int  bdim,
double  init_value,
double  increment = 1.0 
)

Construct uniform knot vector with inital value init_value and incremental of increment.

引数
orderorder
bdimB-Rep dimension.
init_valueInitial value
incrementincremental value.
MGKnotVector::MGKnotVector ( const MGNDDArray dtp,
int  order 
)

Obtain knot vector from Data Point.

引数
dtpinput data point
orderorder
MGKnotVector::MGKnotVector ( const MGKnotVector vec2,
const MGKnotArray knots 
)

Add knots into original knot vector. Maximum multiplicity of the knot is guaranteed to be the order.

引数
vec2Original Knot Vector
knotsKnots to add with multiplicity.
MGKnotVector::MGKnotVector ( int  start_id,
int  num,
const MGKnotVector vec2 
)

Construct by extracting sub interval of vec2.

引数
start_idStart id of vec2(from 0).
numnew B-Rep dimension.
vec2Original knot vector.
MGKnotVector::MGKnotVector ( const MGKnotVector knotv,
int  order 
)

Construct new order knot vector.

引数
knotvinput knot vector
ordernew order
MGKnotVector::MGKnotVector ( const MGKnotVector knotv,
double  t1,
double  t2 
)

Generate knot vector as a part of original knotv. New knot vector's parame range is from t1 to t2. Should hold t1>=knotv.param_s() && t2<=knotv.param_e(). Knots between t1< <t2 are copied from knotv.

MGKnotVector::MGKnotVector ( const MGKnotVector vec2)

Copy Constructor.

関数詳解

int MGKnotVector::bdim ( ) const
inline
MGKnotVector& MGKnotVector::change_knot_number ( int  nnew)

Return BRep Dimension.

Update array length. Updated array is so generated that the original proportions of neighbors hold as much as possible. If original data point has multiplicities and nnew>=length(), original data point parameters and the multiplicities are preserved.

MGKnotVector& MGKnotVector::change_order ( int  order)

Change order For area adjustment. New knot vector possesses the same values for the area of the old one as long as area permitts. New vector is generally garbage knot vector.

void MGKnotVector::change_range ( double  ts,
double  te 
)
virtual

Change parameter range.

MGNDDArrayを再実装しています。

void MGKnotVector::divide_span ( int  num)

Divide every spans. Every spans are subdivided into num equal spans. Result knot vector's bdim() becomes approximately bdim()*num.

int MGKnotVector::dump ( MGOfstream ) const
virtual

Dump Function.

MGNDDArrayを再実装しています。

int MGKnotVector::dump_size ( ) const
virtual

Dump Functions.

MGNDDArrayを再実装しています。

int MGKnotVector::eval_coef ( double  x,
double *  coef,
int  nderiv = 0,
int  left = 0 
) const

Function's return value id is the index of B-coefficients that should be multiplied to. coef[j] is for (id+j)-th B-Coefficients, 0<= j <=order-1. Multiplication with coef should be done like:

data=0.; for(j=0; j<order; j++) data+=coef[j]*B_coef[id+j].

left indicates whether left continuous(left=true), or right continuous (left=false) evaluation.

引数
xParameter value to evaluate
coefcoef's to multiply are returned. array of length order.
nderivorder of derivative, =0 means position
leftLeft continuous(left=true) or right continuous(left=false).
bool MGKnotVector::in_range ( double  t) const

Test if input parameter value is inside parameter range of the line.

int MGKnotVector::locate ( double  tau,
int  left 
) const

Find where tau is located in knot. Return id is to evalute, i.e. (*this)(id) < (*this)(id+1). Returned id is : order()-1<= id < bdim(). left indicates whether left continuous(left=true), or right continuous (left=false) location.

int MGKnotVector::locate ( double  tau) const
virtual

Finds index where tau is located in MGNDDArray as an index of knot: tau < (*this)(0) : index=-1. (*this)(0) <= tau< (*this)(n-1) : 0<= index <n-1, such that (*this)(index) <= tau < (*this)(index+1) (*this)(n-1) <= tau : index=n-1. Here n=lenght().

MGNDDArrayを再実装しています。

int MGKnotVector::locate_multi ( int  start,
int  multi,
int &  index 
) const
virtual

Locate where data of multiplicity of multi is after start and before bdim(). index is the starting point index of this found first after start, index>=start. Function's return value locate_multi is actual multiplicity at the index, i.e. locate_multi>=multi if found. If position of the multiplicity is not found before bdim(), index=bdim() (index of the param_e()) and locate_multi=0 will be returned. multi must be >=1 and start must be <=bdim().

MGNDDArrayを再実装しています。

MGKnotVector& MGKnotVector::mix_knot_vector ( const MGKnotVector knot)

ノットベクトルをショートスパンのないように足しあわせる ノットベクトルのパラメータ範囲は等しいものとする。 エラーのとき元のノットベクトルを返す. mixing two knotvectors. Mixing is so done as that no too close points are not included.

bool MGKnotVector::operator!= ( const MGKnotVector knotv) const
inline

Return true if equal.

Return true if not equal.

MGKnotVector MGKnotVector::operator* ( double  ) const

Scaling.

MGKnotVector& MGKnotVector::operator*= ( double  )
MGKnotVector MGKnotVector::operator+ ( double  ) const

Addition and subtraction of real number. All of the elements will be added or subtracted.

MGKnotVector& MGKnotVector::operator+= ( double  )
MGKnotVector MGKnotVector::operator- ( double  ) const
MGKnotVector MGKnotVector::operator- ( ) const

単項マイナス。 Unary minus. Reverse the ordering of elements by changing all of the signs.

MGKnotVector& MGKnotVector::operator-= ( double  )
MGKnotVector& MGKnotVector::operator= ( const MGKnotVector vec2)

Assignment.

bool MGKnotVector::operator== ( const MGKnotVector ) const

Compare two KnotVector if they are equal.

int MGKnotVector::order ( ) const
inline

Return order.

double MGKnotVector::param_e ( ) const
inline

Return end parameter value.

double MGKnotVector::param_error ( ) const

Return tolerance allowed in knot vector parameter space.

double MGKnotVector::param_normalize ( double  t) const

Normalize parameter value t to the nearest knot if their distance is within tolerance.

double MGKnotVector::param_s ( ) const
inline

Return start parameter value.

double MGKnotVector::param_span ( ) const

Compute parameter span length.

double MGKnotVector::range ( double  t) const

入力パラメータをパラメータ範囲でまるめて返却する。 Round the input parameter value t into the parameter range of the knot_vector

int MGKnotVector::restore ( MGIfstream )
virtual

Restore Function.

MGNDDArrayを再実装しています。

void MGKnotVector::reverse ( )

Reverse the ordering of knots. Parameter range of the original is preserved.

double MGKnotVector::reverse_param ( double  t) const

Obtain parameter value if this knot vector is reversed by reverse().

MGKnotVector& MGKnotVector::set_bdim ( int  brdim)

Set B-rep dimension. Only set the B-Rep Dimension. Result knot vector may be garbage.

void MGKnotVector::set_null ( )
inlinevirtual

Set this as a null.

MGNDDArrayを再実装しています。

void MGKnotVector::size_change ( int  order,
int  bdim 
)

Resize this so that this order is order and this b-rep dimension is bdim. Result of size_change will contain garbages.

フレンドと関連関数の詳解

MG_DLL_DECLR friend MGKnotVector operator* ( double  scale,
const MGKnotVector t 
)
friend
MG_DLL_DECLR friend std::ostream& operator<< ( std::ostream &  strm,
const MGKnotVector t 
)
friend

String stream Function.


このクラス詳解は次のファイルから抽出されました: