MGCL V10
V10
MGCL V10
|
Defines BPoint seq of a space dimension and of a capacity. [詳解]
公開メンバ関数 | |
MGBPointSeq (int capacity=0, int dim=0) | |
MGBPointSeq (int dim, const MGBPointSeq &old_brep, int start1=0, int start2=0) | |
MGBPointSeq (bool along_u, int m, const MGSPointSeq &sp) | |
Construct by extracting one line data of sp along u or v direction. [詳解] | |
MGBPointSeq (int start_id, int num, const MGBPointSeq &bp_old) | |
MGBPointSeq (const std::vector< MGPosition > &poses) | |
Conversion constructor. [詳解] | |
MGBPointSeq (const MGBPointSeq &) | |
Copy constructor. [詳解] | |
~MGBPointSeq () | |
MGBPointSeq & | operator= (const MGBPointSeq &) |
Assignment. [詳解] | |
double & | operator() (int i, int j) |
Access to (i,j)th element(LHS version). [詳解] | |
double | operator() (int i, int j) const |
Access to (i,j)th element(RHS version). [詳解] | |
MGVector | operator() (int i) const |
Extract (i,j) coordinate values for 0<=j<sdim() as a vector. [詳解] | |
MGBPointSeq | operator+ (const MGVector &v) const |
MGBPointSeq & | operator+= (const MGVector &) |
MGBPointSeq | operator- (const MGVector &) const |
MGBPointSeq & | operator-= (const MGVector &) |
MGBPointSeq | operator+ (const MGBPointSeq &bp2) const |
Add operation of two BPointSeq. [詳解] | |
MGBPointSeq & | operator+= (const MGBPointSeq &bp2) |
Add operation of two BPointSeq. [詳解] | |
MGBPointSeq | operator- (const MGBPointSeq &bp2) const |
Subtract operation of two BPointSeq. [詳解] | |
MGBPointSeq & | operator-= (const MGBPointSeq &bp2) |
Subtract operation of two BPointSeq. [詳解] | |
MGBPointSeq | operator* (double scale) const |
MGBPointSeq & | operator*= (double scale) |
MGBPointSeq | operator/ (double scale) const |
MGBPointSeq & | operator/= (double scale) |
MGBPointSeq | operator* (const MGMatrix &) const |
MGBPointSeq & | operator*= (const MGMatrix &) |
MGBPointSeq | operator* (const MGTransf &) const |
MGBPointSeq & | operator*= (const MGTransf &) |
bool | operator== (const MGBPointSeq &) const |
bool | operator!= (const MGBPointSeq &brep) const |
int | average_plane (MGPosition ¢er, MGPlane &plane, MGStraight &line, double &deviation) const |
MGBox | box () const |
Compute minimum box sorrounding the all the points. [詳解] | |
void | coordinate_exchange (int j1, int j2) |
double * | data (int i=0, int j=0) |
Returns a pointer to the data area. [詳解] | |
const double * | data (int i=0, int j=0) const |
Returns a pointer to the area. [詳解] | |
void | insert_at (int i, const MGVector &vctr) |
Insert vector data to this(i,j) 0<=j<sdim(). [詳解] | |
void | insert_at (int i, const double *data) |
Insert array data[j] to this(i,j) 0<=j<sdim(). [詳解] | |
bool | is_null () const |
Test if this is null. [詳解] | |
int | length () const |
Returns the actual size of Bpoint seq. [詳解] | |
void | negate () |
MGBPointSeq | non_homogeneous () const |
int | planar (MGPlane &plane, MGStraight &line, MGPosition ¢er) const |
void | point (int i, int j, int sd, MGPosition &P) const |
double | ref (int i, int j) const |
Return (i,j)-th element data, return 0.0 when j>=sdim(). [詳解] | |
void | reshape (int capacity, int start=0) |
void | resize (int sz, int dim=0) |
int | sdim () const |
Returns the space dimension. [詳解] | |
void | set_length (int length) |
Set the length of effective data. [詳解] | |
void | set_null () |
Set this BPointSeq as a null. [詳解] | |
int | capacity () const |
Returns the capacity. [詳解] | |
void | store_at (int i, const MGVector &vctr, int to=0, int from=0) |
void | store_at (int i, const MGVector &vctr, int to, int from, int len) |
void | store_at (int i, const double *data, int to=0) |
MGBPointSeq & | homogeneous_transform (double) |
MGBPointSeq & | homogeneous_transform (const MGVector &) |
Add the vector. [詳解] | |
MGBPointSeq & | homogeneous_transform (const MGMatrix &) |
Multiply the matrix. [詳解] | |
MGBPointSeq & | homogeneous_transform (const MGTransf &) |
Multiply the transform. [詳解] | |
int | dump_size () const |
Dump Functions, Calculate dump size. [詳解] | |
int | dump (MGOfstream &) const |
Dump Function. [詳解] | |
int | restore (MGIfstream &) |
Restore Function. [詳解] | |
フレンド | |
MG_DLL_DECLR friend MGBPointSeq | operator+ (const MGVector &v, const MGBPointSeq &b) |
translation by a vector. [詳解] | |
MG_DLL_DECLR friend MGBPointSeq | operator* (double scale, const MGBPointSeq &) |
MG_DLL_DECLR friend std::ostream & | operator<< (std::ostream &, const MGBPointSeq &) |
String stream Function. [詳解] | |
Defines BPoint seq of a space dimension and of a capacity.
MGBPointSeq is an array of world coordinates of a space dimension(any number), desined especially for MGLBRep class's control polygon handling. Let n be a B-rep dimension(i.e., number of points of the control polygon), and sd be a space dimension, then MGBPointSeq bp has the minimum area of n*sd. The subscription of MGBPointSeq bp is 2 dimension as bp(i,j), 0<=i<n, and 0<=j<sd. If MGBPointSeq can be considered as a Matrix of n by sd.
|
explicit |
Dimensioning of MGBPointSeq is MGBPointSeq(capacity,dim). effective length will be set capacity(i.e. length() will be capacity).
MGBPointSeq::MGBPointSeq | ( | int | dim, |
const MGBPointSeq & | old_brep, | ||
int | start1 = 0 , |
||
int | start2 = 0 |
||
) |
Construct a MGBPointSeq by copying original MGBPointSeq, Can change the order of coordinates. (*this)(start1,.) will be old_brep(start2,.).
dim | New Space Dimension. |
old_brep | Origianl B-Rep. |
start1 | Destination start order to store. |
start2 | Source start order to retrieve. |
MGBPointSeq::MGBPointSeq | ( | bool | along_u, |
int | m, | ||
const MGSPointSeq & | sp | ||
) |
Construct by extracting one line data of sp along u or v direction.
along_u | indicates which direction make a line out of sp. if true, along u direction:sp(i,m,.) for i=0, ..., nu-1 makes the BPointSeq. if false, along v direction:sp(m,j,.) for j=0, ..., nv-1 makes the BPointSeq. |
m | index of u or v as above, acording to along_u. |
sp | Origianl SPoint. |
MGBPointSeq::MGBPointSeq | ( | int | start_id, |
int | num, | ||
const MGBPointSeq & | bp_old | ||
) |
Construct by extracting sub interval of bp_old. (*this)(0+i,.) will be bp_old(start_id+i,.) for i=0,...,num-1.
start_id | Start id of bp_old |
num | New length(of new BPoint) |
bp_old | Origianl BPoint. |
MGBPointSeq::MGBPointSeq | ( | const std::vector< MGPosition > & | poses | ) |
Conversion constructor.
MGBPointSeq::MGBPointSeq | ( | const MGBPointSeq & | ) |
Copy constructor.
|
inline |
int MGBPointSeq::average_plane | ( | MGPosition & | center, |
MGPlane & | plane, | ||
MGStraight & | line, | ||
double & | deviation | ||
) | const |
compute an average plane of the point sequence. Function's return value is: 1: Point seq is a point. 2: Point seq is on a line. 3: Plane is output.
center | center of point seq will be output. |
plane | Plane will be output, when average_plane=3. |
line | Straight line will be output =2. |
deviation | Maximum deviation from point, line, or plane will be output. |
MGBox MGBPointSeq::box | ( | ) | const |
Compute minimum box sorrounding the all the points.
|
inline |
Returns the capacity.
void MGBPointSeq::coordinate_exchange | ( | int | j1, |
int | j2 | ||
) |
Exchange ordering of the coordinates. Exchange coordinates (j1) and (j2).
double* MGBPointSeq::data | ( | int | i = 0 , |
int | j = 0 |
||
) |
Returns a pointer to the data area.
const double* MGBPointSeq::data | ( | int | i = 0 , |
int | j = 0 |
||
) | const |
Returns a pointer to the area.
int MGBPointSeq::dump | ( | MGOfstream & | ) | const |
Dump Function.
int MGBPointSeq::dump_size | ( | ) | const |
Dump Functions, Calculate dump size.
MGBPointSeq& MGBPointSeq::homogeneous_transform | ( | double | ) |
Transformation of own for rational(MGRLBRep) Control Polygon. Scaling.
MGBPointSeq& MGBPointSeq::homogeneous_transform | ( | const MGVector & | ) |
Add the vector.
MGBPointSeq& MGBPointSeq::homogeneous_transform | ( | const MGMatrix & | ) |
Multiply the matrix.
MGBPointSeq& MGBPointSeq::homogeneous_transform | ( | const MGTransf & | ) |
Multiply the transform.
void MGBPointSeq::insert_at | ( | int | i, |
const MGVector & | vctr | ||
) |
Insert vector data to this(i,j) 0<=j<sdim().
i | id of this which indicates the placement. |
vctr | Input vector. |
void MGBPointSeq::insert_at | ( | int | i, |
const double * | data | ||
) |
Insert array data[j] to this(i,j) 0<=j<sdim().
i | id of this which indicates the placement. |
data | Input data array. |
|
inline |
Test if this is null.
|
inline |
Returns the actual size of Bpoint seq.
void MGBPointSeq::negate | ( | ) |
Negate this point sequence. That is, change the ordering of this(i,.) for i.
MGBPointSeq MGBPointSeq::non_homogeneous | ( | ) | const |
Compute non_homogeneous coordonate data without w coordinate element, assumed that this is homogeneous coordinate data, i.e., maximum space dimension element is w(weight) coordinate.
|
inline |
Compare two BPointSeq if they are equal. ///Return true if not equal.
|
inline |
Access to (i,j)th element(LHS version).
|
inline |
Access to (i,j)th element(RHS version).
MGVector MGBPointSeq::operator() | ( | int | i | ) | const |
Extract (i,j) coordinate values for 0<=j<sdim() as a vector.
MGBPointSeq MGBPointSeq::operator* | ( | double | scale | ) | const |
与えられたスケールで曲線の変換を行いオブジェクトを生成する。 Generates an object by multiplying scale to the original.
MGBPointSeq MGBPointSeq::operator* | ( | const MGMatrix & | ) | const |
与えられた変換で曲線の変換を行いオブジェクトを生成する。 Generates an object by multiplying matrix to the original.
MGBPointSeq MGBPointSeq::operator* | ( | const MGTransf & | ) | const |
与えられた変換で曲線のトランスフォームを行いオブジェクトを生成する。 Generates an object by multiplying transformation to the original.
MGBPointSeq& MGBPointSeq::operator*= | ( | double | scale | ) |
与えられたスケールで曲線の変換を行い自身の曲線とする。 Updates the object by multiplying scale.
MGBPointSeq& MGBPointSeq::operator*= | ( | const MGMatrix & | ) |
与えられた変換で曲線の変換を行い自身の曲線とする。 Updates the object by multiplying matrix.
MGBPointSeq& MGBPointSeq::operator*= | ( | const MGTransf & | ) |
与えられた変換で曲線のトランスフォームを行い自身とする。 Updates the object by multiplying transformation.
MGBPointSeq MGBPointSeq::operator+ | ( | const MGVector & | v | ) | const |
曲線の平行移動を行いオブジェクトを生成する。 Generates an object by translation.
MGBPointSeq MGBPointSeq::operator+ | ( | const MGBPointSeq & | bp2 | ) | const |
Add operation of two BPointSeq.
MGBPointSeq& MGBPointSeq::operator+= | ( | const MGVector & | ) |
与ベクトルだけ曲線を平行移動して自身とする。 Updates an object by translation.
MGBPointSeq& MGBPointSeq::operator+= | ( | const MGBPointSeq & | bp2 | ) |
Add operation of two BPointSeq.
MGBPointSeq MGBPointSeq::operator- | ( | const MGVector & | ) | const |
曲線の逆方向に平行移動を行いオブジェクトを生成する。 Generates an object by translation.
MGBPointSeq MGBPointSeq::operator- | ( | const MGBPointSeq & | bp2 | ) | const |
Subtract operation of two BPointSeq.
MGBPointSeq& MGBPointSeq::operator-= | ( | const MGVector & | ) |
与ベクトルだけ曲線をマイナス方向に平行移動して自身とする。 Updates the object by translation.
MGBPointSeq& MGBPointSeq::operator-= | ( | const MGBPointSeq & | bp2 | ) |
Subtract operation of two BPointSeq.
MGBPointSeq MGBPointSeq::operator/ | ( | double | scale | ) | const |
与えられたスケールで曲線の変換を行いオブジェクトを生成する。 Generates an object by multiplying scale to the original.
MGBPointSeq& MGBPointSeq::operator/= | ( | double | scale | ) |
与えられたスケールで曲線の変換を行い自身の曲線とする。 Updates the object by multiplying scale.
MGBPointSeq& MGBPointSeq::operator= | ( | const MGBPointSeq & | ) |
Assignment.
bool MGBPointSeq::operator== | ( | const MGBPointSeq & | ) | const |
Compare two BPointSeq if they are equal. Return true if equal.
int MGBPointSeq::planar | ( | MGPlane & | plane, |
MGStraight & | line, | ||
MGPosition & | center | ||
) | const |
Check if coefficients are planar. Funtion's return value is; 0: Not planar, nor a point, nor straight line. 1: coefficients are within a point. 2: coefficients are a straight line. 3: coefficients are planar.
plane | When coefficients are not straight line nor a point, plane is returned, Even when not planar, plane nearest is returned. |
line | When coefficients are a line, the line is returned. |
center | Center of the coefficients is always returned. |
void MGBPointSeq::point | ( | int | i, |
int | j, | ||
int | sd, | ||
MGPosition & | P | ||
) | const |
Retrieve sub data of i-th point of the BPointSeq. That is, P(k)=(*this)(i,j+k) for k=0, ..., sd-1.
double MGBPointSeq::ref | ( | int | i, |
int | j | ||
) | const |
Return (i,j)-th element data, return 0.0 when j>=sdim().
void MGBPointSeq::reshape | ( | int | capacity, |
int | start = 0 |
||
) |
Change capacity. Change of sdim not allowed. reshape guarantees the original data BPoint(i,.) before invoking reshape will be stored in the new BPoint(start+i,.).
capacity | New capacity |
start | To which place to store the original data. |
void MGBPointSeq::resize | ( | int | sz, |
int | dim = 0 |
||
) |
Resize the array. The result will contain garbages. m_capacity, m_sdim, and m_length will be set as m_capacity=sz, m_sdim=dim, m_length=sz.
int MGBPointSeq::restore | ( | MGIfstream & | ) |
Restore Function.
|
inline |
Returns the space dimension.
void MGBPointSeq::set_length | ( | int | length | ) |
Set the length of effective data.
void MGBPointSeq::set_null | ( | ) |
Set this BPointSeq as a null.
void MGBPointSeq::store_at | ( | int | i, |
const MGVector & | vctr, | ||
int | to = 0 , |
||
int | from = 0 |
||
) |
Store vector data vector(from+j) to this(i,to+j) for 0<=j<sdim(). When (form+j) or (to+j) reached to maximum space dimension id, next id becomes 0(form the start).
i | id of this which indicates the placement. |
vctr | Input vector. |
to | Indicates to where of this in the space dimension id. |
from | Indicates from where of vector in the space dimension. |
void MGBPointSeq::store_at | ( | int | i, |
const MGVector & | vctr, | ||
int | to, | ||
int | from, | ||
int | len | ||
) |
Store vector data vector(from+j) to this(i,to+j) for 0<=j<len. When (form+j) or (to+j) reached to maximum space dimension id, next id becomes 0(form the start).
i | id of this which indicates the placement. |
vctr | Input vector. |
to | Indicates to where of this in the space dimension id. |
from | Indicates from where of vector in the space dimension. |
len | length of the data to store. |
void MGBPointSeq::store_at | ( | int | i, |
const double * | data, | ||
int | to = 0 |
||
) |
Store data[j] to this(i,to+j) for 0<=j<sdim(). When (to+j) reached to maximum space dimension id, next id becomes 0(form the start).
i | id of this which indicates the placement. |
data | Input data array. |
to | Indicates to where of this in the space dimension id. |
|
friend |
BPointをスケーリングしてできるオブジェクトを生成する。 Generates a object by scaling.
|
friend |
translation by a vector.
|
friend |
String stream Function.