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

Represent a positional data. [詳解]

公開メンバ関数

 MGPosition (const MGPoint &point)
 Conversion Constructor from a point. [詳解]
 
 MGPosition (const MGVector &vec)
 Conversion Constructor from a vector. [詳解]
 
 MGPosition (int sdim=0)
 Void constructor void コンストラクタ [詳解]
 
 MGPosition (double x, double y)
 Construct 2D position by providing x,y coordinate data. [詳解]
 
 MGPosition (double x, double y, double z)
 Construct 3D position by providing x,y,z coordinate data. [詳解]
 
 MGPosition (double x, double y, double z, double w)
 Construct 4D position by providing x,y,z,w coordinate data. [詳解]
 
 MGPosition (int sdim, const double *v)
 
 MGPosition (int sdim, const MGPosition &p, int start1=0, int start2=0)
 
 MGPosition (const std::vector< double > &darrays)
 Construct from std::vector<double> [詳解]
 
MGPositionoperator= (const double *a)
 
double operator[] (int i) const
 Return i-th element of the position. [詳解]
 
double operator() (int i) const
 
double & operator() (int i)
 Access to i-th element. [詳解]
 
MGPositionoperator+= (const MGVector &vec)
 
MGPositionoperator+= (const MGPosition &pos)
 
MGPosition operator- () const
 
MGPositionoperator-= (const MGVector &vec)
 
MGPositionoperator*= (double scale)
 
MGPositionoperator*= (const MGMatrix &)
 
MGPositionoperator*= (const MGTransf &)
 
MGPositionoperator/= (double)
 
double angle (const MGPosition &start, const MGPosition &end, const MGVector &normal) const
 
MGPositionclear (double init=0.0)
 Clear all the element by the value init. [詳解]
 
double closest (const MGCurve &curve) const
 
MGPosition closest (const MGSurface &surf) const
 
MGPositionclone () const
 
const double * data () const
 Return the 1st address of the array of the point double data. [詳解]
 
double * data ()
 
double distance (const MGPosition &P2) const
 Return the distance of this and P2. [詳解]
 
MGPosition interpolate (double t2, const MGPosition &vec2) const
 
bool is_collinear (const MGPosition &P2, const MGPosition &P3) const
 
bool is_null () const
 Test if this is null. [詳解]
 
double len () const
 
bool on (const MGCurve &curve, double &t) const
 
bool on (const MGSurface &surf, MGPosition &uv) const
 
int out_to_IGES (MGIgesOfstream &igesfile, int SubordinateEntitySwitch=0) const
 
double param (const MGCurve &crv) const
 
MGPosition param (const MGSurface &srf) const
 
MGCParam_list perps (const MGCurve &crv) const
 
MGPosition_list perps (const MGSurface &srf) const
 
MGVector project (const MGVector &v2) const
 
double ref (int i) const
 
void resize (int new_sdim)
 
int sdim () const
 Get the space dimension. [詳解]
 
void set_null ()
 Set this as a null position. [詳解]
 
void store_at (int i, const MGVector &vec2, int j=0)
 
void store_at (int i, const MGVector &vec2, int j, int len)
 
void swap (int i, int j)
 
const MGVectorvector () const
 
int dump_size () const
 Dump Functions. [詳解]
 
int dump (MGOfstream &) const
 Dump Function. [詳解]
 
int restore (MGIfstream &)
 Restore Function. [詳解]
 

フレンド

MGPosition operator+ (const MGPosition &p1, const MGVector &vec)
 Translation of the position. [詳解]
 
MGPosition operator+ (const MGPosition &p1, const MGPosition &p2)
 
MGPosition operator+ (const MGVector &v, const MGPosition &p)
 
MGVector operator- (const MGPosition &p1, const MGPosition &p2)
 自身のPositionと与えられたPositionの減算してMGVectorを生成 [詳解]
 
MGPosition operator- (const MGPosition &p1, const MGVector &v)
 自身のPositionと与えられたVectorの減算してMGPositionを生成 [詳解]
 
MGPosition operator- (const MGVector &v, const MGPosition &p1)
 自身のPositionと与えられたVectorの減算してMGPositionを生成 [詳解]
 
double operator% (const MGPosition &p1, const MGVector &v)
 
MG_DLL_DECLR friend MGPosition operator* (const MGPosition &p1, const MGMatrix &mat)
 
MG_DLL_DECLR friend MGPosition operator* (const MGPosition &p1, const MGTransf &tr)
 
MGPosition operator* (double s, const MGPosition &p)
 
MGPosition operator* (const MGPosition &p1, double s)
 Scalarの乗算を行いPositionを生成 [詳解]
 
MGPosition operator/ (const MGPosition &p1, double s)
 
MG_DLL_DECLR friend std::ostream & operator<< (std::ostream &, const MGPosition &)
 Debug Function. [詳解]
 
MG_DLL_DECLR friend bool operator== (const MGPosition &p1, const MGPosition &p2)
 
MG_DLL_DECLR friend bool operator== (const MGVector &p1, const MGPosition &p2)
 
MG_DLL_DECLR friend bool operator== (const MGPosition &p1, const MGVector &p2)
 
bool operator!= (const MGPosition &p1, const MGPosition &p2)
 
bool operator!= (const MGVector &p1, const MGPosition &p2)
 
bool operator!= (const MGPosition &p1, const MGVector &p2)
 
bool operator< (const MGPosition &p1, const MGPosition &p2)
 
bool operator<= (const MGPosition &p1, const MGPosition &p2)
 
bool operator> (const MGPosition &p1, const MGPosition &p2)
 
bool operator>= (const MGPosition &p1, const MGPosition &p2)
 

詳解

Represent a positional data.

構築子と解体子

MGPosition::MGPosition ( const MGPoint point)

Conversion Constructor from a point.

MGPosition::MGPosition ( const MGVector vec)
inline

Conversion Constructor from a vector.

MGPosition::MGPosition ( int  sdim = 0)
inlineexplicit

Void constructor void コンストラクタ

MGPosition::MGPosition ( double  x,
double  y 
)
inline

Construct 2D position by providing x,y coordinate data.

MGPosition::MGPosition ( double  x,
double  y,
double  z 
)
inline

Construct 3D position by providing x,y,z coordinate data.

MGPosition::MGPosition ( double  x,
double  y,
double  z,
double  w 
)
inline

Construct 4D position by providing x,y,z,w coordinate data.

MGPosition::MGPosition ( int  sdim,
const double *  v 
)
inline

double の配列でcoordinate valueを指定しPositionを生成する。 Construct sdim space dimension positional data providing each coordinate data through doble array. ***** This is the fundamental constructor.*****

MGPosition::MGPosition ( int  sdim,
const MGPosition p,
int  start1 = 0,
int  start2 = 0 
)
inline

Construct position by copying old position, changing space dimension and ordering of old coordinates.

MGPosition::MGPosition ( const std::vector< double > &  darrays)
inline

Construct from std::vector<double>

関数詳解

double MGPosition::angle ( const MGPosition start,
const MGPosition end,
const MGVector normal 
) const

Let this be the center of the rotation, then compute the angle rotated around the normal from start to end. angle(start,end,normal)+angle(end,start,normal)=2*pai always holds.

MGPosition& MGPosition::clear ( double  init = 0.0)

Clear all the element by the value init.

MGPosition* MGPosition::clone ( ) const
inline

Construct new surface object by copying to newed area. User must delete this copied object by "delete".

double MGPosition::closest ( const MGCurve curve) const

Compute the closest point parameter value of the curve from this point. Function's return value is the parameter value of the curve.

MGPosition MGPosition::closest ( const MGSurface surf) const

Compute the closest point parameter value (u,v)of the surface from this point.

const double* MGPosition::data ( ) const
inline

Return the 1st address of the array of the point double data.

double* MGPosition::data ( )
inline
double MGPosition::distance ( const MGPosition P2) const

Return the distance of this and P2.

int MGPosition::dump ( MGOfstream ) const

Dump Function.

int MGPosition::dump_size ( ) const

Dump Functions.

MGPosition MGPosition::interpolate ( double  t2,
const MGPosition vec2 
) const

Generate a Position by interpolating two Position. Input scalar is a ratio t2. When t2 is zero, output position is a copy of the own position. Output=(this)(1-t2)+vec2*t2.

bool MGPosition::is_collinear ( const MGPosition P2,
const MGPosition P3 
) const
inline

Test if this, P2, and P3 are on a single straight line. Function's return value is true if the three points are on a straight, false if not.

bool MGPosition::is_null ( ) const
inline

Test if this is null.

double MGPosition::len ( ) const
inline

Positionと原点との距離を求める。 Return the lenght between the origin(0,0,0) and the position.

bool MGPosition::on ( const MGCurve curve,
double &  t 
) const

点が曲線上にあるかを調べる。曲線上にあれば,そのパラメーター値を, なくても最近傍点のパラメータ値を返す。 Test if the position is on a curve. If on, return the parameter value. Even if not on, return the nearest point of the curve. Function's return value is >0 if the point is on the curve, and 0 if the point is not on the curve.

引数
curveCurve
tParameter value of the nearest point on the curve.
bool MGPosition::on ( const MGSurface surf,
MGPosition uv 
) const

点が曲面上にあるかを調べる。曲面上にあれば,そのパラメーター値を, なくても最近傍点のパラメータ値を返す。 Test if the position is on a surface. If on, return the parameter value. Even if not on, return the nearest point of the surface. Function's return value is >0 if the point is on the curve, and 0 if the point is not on the curve.

引数
surfSurface pointer
uvParameter value of the nearest point on surface.
double MGPosition::operator() ( int  i) const
inline
double& MGPosition::operator() ( int  i)
inline

Access to i-th element.

MGPosition& MGPosition::operator*= ( double  scale)

Scalarの乗算を行い自身のPositionとする Scaling of the position.

MGPosition& MGPosition::operator*= ( const MGMatrix )

MatrixによるPositionの変換を行い自身のPositionとする Matrix transformation of the position.

MGPosition& MGPosition::operator*= ( const MGTransf )

PositionのTransformを行いPositionを生成して, 自身のPositionとする General transformation of the position.

MGPosition& MGPosition::operator+= ( const MGVector vec)

自身のPositionに与えられたPositionを加算して自身のPositionとする Translation of the position.

MGPosition& MGPosition::operator+= ( const MGPosition pos)
MGPosition MGPosition::operator- ( ) const

単項マイナス。自身のPositionを反転し、Objectを生成 Unary minus. Negate all of the elements of the position.

MGPosition& MGPosition::operator-= ( const MGVector vec)

自身のPositionから与えられたVectorを減算し自身のPositionとする Translation of the position.

MGPosition& MGPosition::operator/= ( double  )

Scalar除算を行い自身のPositionとする Scaling of the position.

MGPosition& MGPosition::operator= ( const double *  a)

Copy constructor MGPosition ( const MGPosition& ); We use default copy constructor. Assignment Update position data by array of double.

double MGPosition::operator[] ( int  i) const
inline

Return i-th element of the position.

int MGPosition::out_to_IGES ( MGIgesOfstream igesfile,
int  SubordinateEntitySwitch = 0 
) const

PD116=Point. Function's return value is the directory entry id created.

double MGPosition::param ( const MGCurve crv) const

Return curve's parameter value of this point. If this point is not on the curve, return the nearest point's parameter value on the curve.

MGPosition MGPosition::param ( const MGSurface srf) const

Return surface's parameter value of this point. If this point is not on the surface, return the nearest point's parameter value on the surface.

MGCParam_list MGPosition::perps ( const MGCurve crv) const

Compute all foot points of the perpendicular line from this point to a curve. ポイントから与曲線へ下ろした垂線の足の,曲線のパラメータ値を すべて求める。

引数
crvCurve
MGPosition_list MGPosition::perps ( const MGSurface srf) const

Compute all foot points of the perpendicular line from this point to a surface. ポイントから与曲面へ下ろした垂線の足の,曲面のパラメータ値を すべて求める。

引数
srfSurface
MGVector MGPosition::project ( const MGVector v2) const
inline

自身の点を原点からこの点までのベクトルとして ベクトル(v2)に射影したベクトルを求める。 v2 が 零ベクトルのとき(*this)が返る。

double MGPosition::ref ( int  i) const
inline
void MGPosition::resize ( int  new_sdim)
inline

Resize the position, that is , change the space dimension. When this is enlarged, the extra space will contain garbages.

int MGPosition::restore ( MGIfstream )

Restore Function.

int MGPosition::sdim ( ) const
inline

Get the space dimension.

void MGPosition::set_null ( )
inline

Set this as a null position.

void MGPosition::store_at ( int  i,
const MGVector vec2,
int  j = 0 
)

Store vec2 data into *this. Store length is minimum of len() and vec2.len(). Storing will be done rap-around. That is, if id i or j reached to each sdim(), the id will be changed to 0.

引数
iDisplacement of *this.
vec2Vector 2.
jDisplacement of vec2.
void MGPosition::store_at ( int  i,
const MGVector vec2,
int  j,
int  len 
)

Store vec2 data into *this. Storing will be done rap-around. That is, if id i or j reached to each sdim(), the id will be changed to 0.

引数
iDisplacement of *this.
vec2Vector 2.
jDisplacement of vec2.
lenLength to store
void MGPosition::swap ( int  i,
int  j 
)
inline

swap two coordinates. swap coordinates (i) and (j).

const MGVector& MGPosition::vector ( ) const
inline

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

bool operator!= ( const MGPosition p1,
const MGPosition p2 
)
friend
bool operator!= ( const MGVector p1,
const MGPosition p2 
)
friend
bool operator!= ( const MGPosition p1,
const MGVector p2 
)
friend
double operator% ( const MGPosition p1,
const MGVector v 
)
friend

自身の点と与えられたベクトルの内積を行う Inner product of a osition and a vector.

MG_DLL_DECLR friend MGPosition operator* ( const MGPosition p1,
const MGMatrix mat 
)
friend

MatrixによるPositionの変換を行いObjectを生成 Matrix transformation of the position.

MG_DLL_DECLR friend MGPosition operator* ( const MGPosition p1,
const MGTransf tr 
)
friend

PositionのTransformを行いVectorを生成 General transformation of the position.

MGPosition operator* ( double  s,
const MGPosition p 
)
friend

PositionのScalar乗算を行いObjectを生成 Scaling of the position.

MGPosition operator* ( const MGPosition p1,
double  s 
)
friend

Scalarの乗算を行いPositionを生成

MGPosition operator+ ( const MGPosition p1,
const MGVector vec 
)
friend

Translation of the position.

MGPosition operator+ ( const MGPosition p1,
const MGPosition p2 
)
friend
MGPosition operator+ ( const MGVector v,
const MGPosition p 
)
friend
MGVector operator- ( const MGPosition p1,
const MGPosition p2 
)
friend

自身のPositionと与えられたPositionの減算してMGVectorを生成

MGPosition operator- ( const MGPosition p1,
const MGVector v 
)
friend

自身のPositionと与えられたVectorの減算してMGPositionを生成

MGPosition operator- ( const MGVector v,
const MGPosition p1 
)
friend

自身のPositionと与えられたVectorの減算してMGPositionを生成

MGPosition operator/ ( const MGPosition p1,
double  s 
)
friend

Scalar除算を行いObjectを生成 Scaling of the position.

bool operator< ( const MGPosition p1,
const MGPosition p2 
)
friend

Test if this position is less than p2. Comparison depends on two positions' length.

MG_DLL_DECLR friend std::ostream& operator<< ( std::ostream &  ,
const MGPosition  
)
friend

Debug Function.

bool operator<= ( const MGPosition p1,
const MGPosition p2 
)
friend
MG_DLL_DECLR friend bool operator== ( const MGPosition p1,
const MGPosition p2 
)
friend

与えられたPositionの成分の値を比較し、同じであれば TRUE を返却 Comparison of two positions.

MG_DLL_DECLR friend bool operator== ( const MGVector p1,
const MGPosition p2 
)
friend
MG_DLL_DECLR friend bool operator== ( const MGPosition p1,
const MGVector p2 
)
friend
bool operator> ( const MGPosition p1,
const MGPosition p2 
)
friend
bool operator>= ( const MGPosition p1,
const MGPosition p2 
)
friend

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