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

列挙型

enum  fan_kind { SINGLE_TRIANGLE, MULTIPLE_TRIANGLES, SINGLE_TRIANGLE_NO_STRIP, MULTIPLE_TRIANGLES_NO_STRIP }
 Tessellation parameter to select fan kind for the tessellation. [詳解]
 
enum  SURFACE_CURVATURE_KIND { GAUSSIAN_CURVATURE = 0, MEAN_CURVATURE = 1, MINIMUM_CURVATURE = 2, MAXIMUM_CURVATURE = 3 }
 
enum  VIEWMODE {
  DONTCARE =0, WIRE =1, SHADING =2, WIRE_AND_SHADING =3,
  HIGHLIGHT =4
}
 
enum  TL_DATA_KIND { UV =0, XYZ, XYZNormal }
 Triangles' data kind. [詳解]
 

関数

double Curvature (const MGVector &v1, const MGVector &v2)
 Compute curvature in 3D space, ie, the value is not negative. [詳解]
 
double Torsion (const MGVector &v1, const MGVector &v2, const MGVector &v3)
 Compute torsion. [詳解]
 
void one_arrow (const MGPosition &root, const MGVector &vecx, const MGUnit_vector &vecy, MGPosition &head, MGPosition &headtail1, MGPosition &headtail2)
 Generate arrow data from (root, vecx, vecy). [詳解]
 
MG_DLL_DECLR MGRLBRepconvert_to_rational (const MGCurve &curve)
 Creates a curve that has weight. [詳解]
 
MG_DLL_DECLR const char * Version ()
 Get the MGCL_Version number. [詳解]
 
MG_DLL_DECLR const char * File_validity ()
 Get the MGCL File validity. [詳解]
 
double MG_DLL_DECLR max (double a, double b)
 
double MG_DLL_DECLR min (double a, double b)
 
int MG_DLL_DECLR max (int a, int b)
 
int MG_DLL_DECLR min (int a, int b)
 
double MG_DLL_DECLR Max3 (double a1, double a2, double a3)
 Compute the difference of min and max of the three doubles a1, a2, and a3. [詳解]
 
double degree_to_radian (double degree)
 convert the angle unit from degree to radian. [詳解]
 
double radian_to_degree (double radian)
 convert the angle unit from radian to degree. [詳解]
 
void MG_DLL_DECLR start_up (bool need_to_GdiStartUp=false)
 Start up the MGCL. [詳解]
 
void MG_DLL_DECLR shut_down ()
 Shut down the MGCL. [詳解]
 
double MG_DLL_DECLR decimalAlign (double dValue, int nDigit=4)
 桁合わせ、デフォルトでは上から4桁を残し、後は切り捨てる. [詳解]
 
double angle (const MGVector &V1, const MGVector &V2, const MGVector &N)
 Compute the angel around the normal N in radian range[0., 2*pia). [詳解]
 
double angle (const MGPosition &origin, const MGPosition &P1, const MGPosition &P2, const MGVector &N)
 Compute the angel around the Normal N in radian range[0., 2*pia). [詳解]
 
MG_DLL_DECLR void Binominal (int m, double *bc)
 Compute binominal coefficients. [詳解]
 
MG_DLL_DECLR std::auto_ptr
< MGSurface
createSurfaceFromRibs (const MGPvector< MGCurve > &curves, bool direction_adjustment=true)
 
MG_DLL_DECLR std::auto_ptr
< MGSurface
createSurfaceFromRibs (const std::vector< const MGCurve * > &curves, bool direction_adjustment=true)
 
MG_DLL_DECLR std::auto_ptr
< MGSurface
create_ruled_surface (const MGCurve &cross1, const MGCurve &cross2, bool direction_adjustment=true)
 Creates a ruled surface. [詳解]
 
MG_DLL_DECLR std::auto_ptr
< MGRSBRep
create_revolved_surface (const MGCurve &curve, const MGStraight &axis, double angle=mgDBLPAI)
 Creates a surface of revolution. [詳解]
 
int SurfCurve_equal_direction (const MGCurve &pline, const MGCurve &world_curve)
 Test if pline has the same direction to world_curve. [詳解]
 
double get_length (MGPosition Pn[9], bool &direction)
 Evaluate which direction is longer, u or v, from the 9 sample points. [詳解]
 
MG_DLL_DECLR MGVector project (const MGVector &V1, const MGVector &V2)
 V1をベクトル(v2)に射影したベクトルを求める。 [詳解]
 
MG_DLL_DECLR double getCurveCurvatureLength (const MGCurve &curve, double scale, int density, bool use_radius)
 

詳解

MGCL namespace defines varialbes without prefix mg or MG. From historical reasons, varialbes with prefix mg or MG are not included in MGCL namespace.

関数詳解

double MGCL::angle ( const MGVector V1,
const MGVector V2,
const MGVector N 
)
inline

Compute the angel around the normal N in radian range[0., 2*pia).

angle(v1,v2,N)+angle(v2,v1,N)=2*pai always holds.

double MGCL::angle ( const MGPosition origin,
const MGPosition P1,
const MGPosition P2,
const MGVector N 
)
inline

Compute the angel around the Normal N in radian range[0., 2*pia).

Here V1=P1-origin, V2=P2-origin. Although N is assumed to be parallel to N2=V1*v2, N may not perpendicular to v1 and v2, in which case, the projected normal to N2 is used to measure the angle. angle(origin,P1,P2,N)+angle(origin,P2,P1,N)=2*pai always holds.

MG_DLL_DECLR void MGCL::Binominal ( int  m,
double *  bc 
)

Compute binominal coefficients.

Let i=degree, then bc(i,j) contains j-th coefficient of the degree i. bc(i,j) for 0<=i<=m and 0<=j<=i in bc[(m+1)*i+j]. bc is an arrary of length (m+1)*(m+1). m must be greater than or equal to 1.

MG_DLL_DECLR MGRLBRep* MGCL::convert_to_rational ( const MGCurve curve)

Creates a curve that has weight.

引数
curve曲線オブジェクト Returned object is a newed object. User must delete it.
MG_DLL_DECLR std::auto_ptr<MGRSBRep> MGCL::create_revolved_surface ( const MGCurve curve,
const MGStraight axis,
double  angle = mgDBLPAI 
)

Creates a surface of revolution.

Parameterization of the surface is: u=const parameter line generates given curve(when u=0.). v=const parameter line generates a circle whose center is axis.

引数
curvegeneratrix curve
axisrevolution axis
anglerevolution angle
MG_DLL_DECLR std::auto_ptr<MGSurface> MGCL::create_ruled_surface ( const MGCurve cross1,
const MGCurve cross2,
bool  direction_adjustment = true 
)

Creates a ruled surface.

引数
cross1a curve as Edge No.1.
cross2another curve as Edge No.2.
direction_adjustment=true, curves[.] direction are adjusted to line to the same direction.
MG_DLL_DECLR std::auto_ptr<MGSurface> MGCL::createSurfaceFromRibs ( const MGPvector< MGCurve > &  curves,
bool  direction_adjustment = true 
)

リブ曲線列から面を作成する リブ曲線の全てのノットが同じスプラインの時MGSBRepかMGRSBRepが返却される それ以外の場合は、曲線をLBRepで再構成して面を作成するのでMGSBRepが返却される 作成する面のノットベクトルはリブ曲線の向きをu,リブ列方向をvとする curves[i] must have the same direction. Let v0=start parameter value, v1=terminate parameter value along v, then v=v0 const parameter line is curves[0], and v=v1 const parameter line is curves[n-1], where n=curves.size(). n must be greater or equal to 2. When n==2, the surface is a ruled surface(that is, order_u() is 2).

引数
curvesリブ曲線列
direction_adjustment=true, curves[.] direction are adjusted to line to the same direction.
MG_DLL_DECLR std::auto_ptr<MGSurface> MGCL::createSurfaceFromRibs ( const std::vector< const MGCurve * > &  curves,
bool  direction_adjustment = true 
)
引数
curvesリブ曲線列
direction_adjustment=true, curves[.] direction are adjusted to line to the same direction.
double MGCL::Curvature ( const MGVector v1,
const MGVector v2 
)

Compute curvature in 3D space, ie, the value is not negative.

引数
v1First derivative.
v2Second derivative.
double MG_DLL_DECLR MGCL::decimalAlign ( double  dValue,
int  nDigit = 4 
)

桁合わせ、デフォルトでは上から4桁を残し、後は切り捨てる.

double MGCL::degree_to_radian ( double  degree)
inline

convert the angle unit from degree to radian.

MG_DLL_DECLR const char* MGCL::File_validity ( )

Get the MGCL File validity.

double MGCL::get_length ( MGPosition  Pn[9],
bool &  direction 
)

Evaluate which direction is longer, u or v, from the 9 sample points.

Points are at the parameter range square of the surface. Function's return value is square of the length of the longer direction.

MG_DLL_DECLR double MGCL::getCurveCurvatureLength ( const MGCurve curve,
double  scale,
int  density,
bool  use_radius 
)

getCurveCurvatureLength computes the maximum curvature graph length. Function's return value is the maximum length of the graph.

double MG_DLL_DECLR MGCL::max ( double  a,
double  b 
)
int MG_DLL_DECLR MGCL::max ( int  a,
int  b 
)
double MG_DLL_DECLR MGCL::Max3 ( double  a1,
double  a2,
double  a3 
)

Compute the difference of min and max of the three doubles a1, a2, and a3.

double MG_DLL_DECLR MGCL::min ( double  a,
double  b 
)
int MG_DLL_DECLR MGCL::min ( int  a,
int  b 
)
void MGCL::one_arrow ( const MGPosition root,
const MGVector vecx,
const MGUnit_vector vecy,
MGPosition head,
MGPosition headtail1,
MGPosition headtail2 
)

Generate arrow data from (root, vecx, vecy).

引数
rootroot of the arrow
vecxthe vector from the roo to the head of the arrrow
vecyvecy that is normal to the vector from root to head
headhead of the arrow will be returned.
headtail1two tail of arrowhead line segments will be returned.
headtail22nd tail.
MG_DLL_DECLR MGVector MGCL::project ( const MGVector V1,
const MGVector V2 
)

V1をベクトル(v2)に射影したベクトルを求める。

v2 が 零ベクトルのときV1が返る。

double MGCL::radian_to_degree ( double  radian)
inline

convert the angle unit from radian to degree.

void MG_DLL_DECLR MGCL::shut_down ( )

Shut down the MGCL.

void MG_DLL_DECLR MGCL::start_up ( bool  need_to_GdiStartUp = false)

Start up the MGCL.

This is necessary only when MGIgesxxxx class or MGImage or MGTexturexxxxx class is to use. Before use of GDIplus, GdiStartUp is necessary, this start_up will do it.

引数
need_to_GdiStartUpTrue if GdiplusStartUp is necessary.
int MGCL::SurfCurve_equal_direction ( const MGCurve pline,
const MGCurve world_curve 
)

Test if pline has the same direction to world_curve.

Assuming that pline=MGSurfCurve(MGSurface srf, parameter_curve of the srf) and world_curve are the same curve. Function's return value is: 1: same direction, -1:oppositie direction.

引数
plineMGSurfCurve(MGSurface srf, parameter_curve of the srf)
world_curveworld representation curve.
double MGCL::Torsion ( const MGVector v1,
const MGVector v2,
const MGVector v3 
)

Compute torsion.

引数
v1First derivative.
v2Second derivative.
v3Third derivative.
MG_DLL_DECLR const char* MGCL::Version ( )

Get the MGCL_Version number.