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

MGConstructionPlane defines a construction plane ton input 3D data. [詳解]

MGConstructionPlane の継承関係図
mgVBO mgVBOElement

公開メンバ関数

 MGConstructionPlane ()
 
 MGConstructionPlane (double origin[3], double uaxis[3], double vaxis[3], double uspan, double vspan, int uline_num, int vline_num, double nspan=1.)
 
 MGConstructionPlane (const MGPlane &plane, double uspan, double vspan, int uline_num, int vline_num, double nspan=1.)
 
void bind_to_grid (const MGPosition &uv, MGPosition &uvout) const
 
void change_origin (const MGPosition &new_origin)
 Change origin point. [詳解]
 
MGPosition convert_to_world (const MGPosition &cplane_coord) const
 
MGPosition convert_from_world (const MGPosition &world_coord) const
 
virtual void make_display_list (MGCL::VIEWMODE vmode=MGCL::DONTCARE)
 Draw this plane using OpenGL. [詳解]
 
bool is_bind_to_grid () const
 
MGVector eval (const MGPosition &uv) const
 Obtain the position data of the parameter (u,v). [詳解]
 
MGVector eval (double u, double v) const
 
void get_colors (MGColor &lineColor, MGColor &uaxisColor, MGColor &vaxisColor) const
 Get line and axis colors. [詳解]
 
void get_grid_data (double &uspan, double &vspan, int &uline_num, int &vline_num, double &nspan) const
 Obtain the grid data of this. [詳解]
 
MGPosition locate (const MGStraight &sl, MGPosition &uv) const
 
bool disabled () const
 
bool enabled () const
 
void set_bind_to_grid_enable ()
 set bind_to_grid enable or disable. [詳解]
 
void set_bind_to_grid_disable ()
 
void importGridAttrib (const MGContext &ctx)
 
void setGridDataByBox (const MGBox &box, int view_num=1, const MGColor *gridColors=0)
 
void set_grid_data (const MGPlane &plane, double uspan, double vspan, int uline_num, int vline_num, double nspan=1)
 Compute grid data and the plane from the plane and the grid span data. [詳解]
 
bool valid () const
 
const MGPlaneplane () const
 
MGPlaneplane ()
 
double uspan () const
 
double vspan () const
 
int vnum () const
 
int unum () const
 
void set_colors (const MGColor colors[3])
 set line, u-axis, and v-axis colors. [詳解]
 
void set_colorsByViewID (int vid, const MGColor colors[4])
 
void set_line_color (const MGColor &color)
 set grid line color. [詳解]
 
void set_uaxis_color (const MGColor &color)
 set uaxis color. [詳解]
 
void set_vaxis_color (const MGColor &color)
 set vaxis color. [詳解]
 
void set_disable ()
 
void set_enable ()
 
void set_span (double span)
 
void set_uspan (double span)
 
void set_vspan (double span)
 
void set_num (int line_num)
 
void set_unum (int unum)
 
void set_vnum (int vnum)
 
void set_plane (const MGPlane &plane)
 
- 基底クラス mgVBO に属する継承公開メンバ関数
 mgVBO ()
 非MGAttribedGel用のconstructor. [詳解]
 
 mgVBO (const MGAttribedGel &gel)
 MGAttribedGel用のconstructor. [詳解]
 
 mgVBO (const mgVBO &vbo)
 MGAttribedGel用のconstructor. [詳解]
 
mgVBOoperator= (const mgVBO &vbo)
 Assignment. [詳解]
 
virtual ~mgVBO ()
 
void initializeVBO (MGCL::VIEWMODE viewMode=MGCL::DONTCARE)
 
bool buildVBOHierarchy (mgVBO &parent, std::vector< mgVBO * > &vbos)
 
virtual void draw (MGCL::VIEWMODE viewMode=MGCL::DONTCARE)
 
virtual void redraw (MGCL::VIEWMODE viewMode=MGCL::DONTCARE)
 
virtual void selectionDraw (MGCL::VIEWMODE viewMode=MGCL::DONTCARE)
 
void highlight ()
 highlight属性で表示する [詳解]
 
virtual void clearElements (mgVBO::ELEMENT_TARGET target=BOTH)
 Clear all the data. [詳解]
 
virtual void clearStaticAttributes ()
 Static Attributes をすべてdefaultにもどす(display/noDisplayは対象外) [詳解]
 
mgVBOElementback () const
 
mgVBOElementfront () const
 
iterator begin_element ()
 
iterator end_element ()
 
const_iterator begin_element () const
 
const_iterator end_element () const
 
int elementNumber () const
 
void pop_back_element ()
 
void push_back_element (mgVBOElement *elm)
 
unsigned getDName () const
 
MGAttribedGelgel () const
 
virtual GLuint getSelectionName () const
 
virtual bool is_made (MGCL::VIEWMODE viewMode=MGCL::DONTCARE)
 
bool is_InBegin ()
 
virtual void Begin (GLenum type, ELEMENT_TARGET target=WIRE)
 
virtual mgVBOLeafEnd (GLenum polygonMode=GL_FILL)
 
void setDirty (bool is_dirty=true, mgVBO::ELEMENT_TARGET target=BOTH) const
 
void setDrawType (mgGLSL::DrawType drawType)
 
void setTexture (mgTexture *texture)
 
void Color (const MGColor &colr)
 頂点ごとの色を指定する [詳解]
 
void Color3fv (const float colr[3])
 
void Color3dv (const double colr[3])
 
void Color4fv (const float colr[4])
 
void Color4ubv (const unsigned char rgba[4])
 
void Normal (const MGVector &norml)
 頂点ごとのnormalを指定する [詳解]
 
void Normal (float x, float y, float z)
 
void Normal3d (double x, double y, double z)
 
void Normal3fv (const float norml[3])
 
void Normal3dv (const double norml[3])
 
virtual void Vertex (const MGPosition &v)
 頂点の座標値を指定する [詳解]
 
virtual void Vertex (float x, float y, float z=0.0f)
 
virtual void Vertex3d (double x, double y, double z=0.0)
 
virtual void Vertex2fv (const float v[2])
 
virtual void Vertex3fv (const float v[3])
 
virtual void Vertex2dv (const double v[2])
 
virtual void Vertex3dv (const double v[3])
 
void TexCoord (const MGPosition &v)
 頂点ごとのTextureの座標値を指定する [詳解]
 
void TexCoord (float x, float y)
 
void TexCoord2d (double x, double y)
 
void TexCoord2fv (const float v[2])
 
void TexCoord2dv (const double v[2])
 
void setStaticAttribColor (const MGColor &color)
 Static attributeを設定する。 [詳解]
 
void setStaticAttribColor (const float color[4])
 
void setStaticAttribColor (float r, float g, float b)
 
void setStaticAttribLineWidth (GLfloat size)
 
void setStaticAttribPointSize (GLfloat size)
 size<=0. はundefinedを示す [詳解]
 
void setLineStipple (short int factor, GLushort pattern=0)
 size<=0. はundefinedを示す [詳解]
 
void LineWidth (GLfloat size)
 
void disableLinePattern ()
 Line patternをdisableにして実線とする [詳解]
 
void drawGel (const MGAttribedGel &gel)
 gelのmgVBOPointerを作成しmgVBOElementとして追加する。 [詳解]
 
void drawVBOLeaf (const mgVBOLeaf &leaf, ELEMENT_TARGET target=SHADING)
 gelのmgVBOLeafPointerを作成しmgVBOElementとして追加する。 [詳解]
 
void deleteGel (const MGAttribedGel &gel)
 gelのmgVBOPointerをメンバーから外す [詳解]
 
void drawArrow (const MGPosition pos[4])
 
void drawBox (const MGBox &box)
 Draw an object of class MGBox, by wireframe. [詳解]
 
void drawPointSeq (const MGBPointSeq &bp, bool draw_points=true)
 
void drawPointSeq (const MGSPointSeq &sp, bool draw_points=true)
 
void draw3DVertex (const MGObject &obj)
 
void draw3DVertex_in_star (const MGComplex &obj)
 
void draw3DVertex_in_star (const MGCellBase &obj)
 
void drawWire_in_star (const MGComplex &obj)
 
void drawWire_in_star (const MGCellBase &obj)
 
double drawCurvaGraph (const MGCurve &curve, double scale, int density, bool use_radius, bool getLength=false)
 
void drawPoint (double x, double y, double z, double size=-1.)
 
void drawPoint (const MGPosition &pos, double size=-1.)
 
void drawPointInverseColor (double x, double y, double z, double size=-1.)
 
void drawPointInverseColor (const MGPosition &pos, double size=-1.)
 
void drawPointWithColor (double x, double y, double z, double outerSize, double innerSize, const MGColor *colorInner=0, const MGColor *colorOuter=0)
 
void drawPointWithColor (const MGPosition &pos, double outerSize, double innerSize, const MGColor *colorInner=0, const MGColor *colorOuter=0)
 
void drawPoints (const MGColor &boundary_color, const MGColor &inner_color, const std::vector< MGPosition > &ipos, double size=-1.)
 
void drawPolyline (const MGBPointSeq &line, bool closed=false)
 
void drawPolyline (const std::vector< MGPosition > &line, bool closed=false)
 
void drawStraight (const MGPosition &end, const MGPosition &start)
 Draw a line from start to end. [詳解]
 
void drawObjInParameterSpace (const MGObject &obj)
 
void drawRectangle (const MGBox &box)
 Draw the rectangle of a box. [詳解]
 
void drawSurfaceCurvature (const mgTL2Triangles &tld, MGCL::SURFACE_CURVATURE_KIND kind, double lower, double upper)
 OpenGL display for the tessellation lines drawn in world view. [詳解]
 
void drawSurfaceCurvature (const std::vector< mgTL2Triangles > &tldvec, MGCL::SURFACE_CURVATURE_KIND kind, double lower, double upper)
 
void drawShade (const mgTL2Triangles &tris, ELEMENT_TARGET target=SHADING, GLenum polygonMode=GL_FILL)
 OpenGL shading display of a tesselated data tris. [詳解]
 
void drawShade (const std::vector< mgTL2Triangles > &trisVector, ELEMENT_TARGET target=SHADING, GLenum polygonMode=GL_FILL)
 OpenGL shading display of a tesselated data tris. [詳解]
 
void drawSTL (const MGStl &stl, ELEMENT_TARGET target=SHADING, GLenum polygonMode=GL_FILL)
 MGStlオブジェクトを描画する [詳解]
 
void setDrawParam (const MGDrawParam &dpara)
 
GLfloat getPointSize () const
 
GLfloat getLineWidth () const
 
const MGColorstaticColor () const
 
MGColorstaticColor ()
 
void setLightMode (int mode)
 Set light mode. mode=-1:undefined, =0:disabled, =1:enabled. [詳解]
 
int getLightMode ()
 
- 基底クラス mgVBOElement に属する継承公開メンバ関数
 mgVBOElement ()
 
virtual ~mgVBOElement ()
 
virtual mgVBOvboPointer ()
 When this is a mgVBOPointer, return the vbo pointer referenced. [詳解]
 
virtual const mgVBOLeafleafPointer ()
 When this is a mgVBOLeaf, return the mgVBOLeaf pointer. [詳解]
 
virtual void set_display ()
 set_display/set_no_display controls if this mgVBO be displayed or not. [詳解]
 
virtual void set_no_display ()
 
virtual bool getNoDisplayMode () const
 
bool is_no_display () const
 
bool is_display () const
 

フレンド

MG_DLL_DECLR friend void MGcplane_parameter (const MGBox &box, double &span, int &lnum, int &sdid, MGPosition &mid)
 Compute cplane parameter from 3D box. [詳解]
 
MG_DLL_DECLR friend std::ostream & operator<< (std::ostream &out, const MGConstructionPlane &pln)
 Debug Function. [詳解]
 
MG_DLL_DECLR friend MGOfstreamoperator<< (MGOfstream &buf, const MGConstructionPlane &cpl)
 Serialization. [詳解]
 
MG_DLL_DECLR friend MGIfstreamoperator>> (MGIfstream &buf, MGConstructionPlane &cpl)
 

その他の継承メンバ

- 基底クラス mgVBO に属する継承公開型
enum  ELEMENT_TARGET { WIRE =0, SHADING =1, BOTH }
 
typedef MGPvector< mgVBOElementcontainer_type
 
typedef container_type::iterator iterator
 
typedef
container_type::const_iterator 
const_iterator
 
- 基底クラス mgVBOElement に属する継承静的公開メンバ関数
static void setDrawParam (const MGDrawParam &dpara)
 
static MGDrawParamgetDrawParam ()
 
static void setHilightColor (const MGColor &hcolor)
 
static const MGColorgetHilightColor ()
 
static void setDefaultPointSize (GLfloat psize)
 
static GLfloat getDefaultPointSize ()
 
- 基底クラス mgVBO に属する継承限定公開メンバ関数
void execStaticColorAttrib ()
 
virtual void execStaticGLAttrib ()
 
virtual void execModelTypeAttrib ()
 
void setDlName (unsigned name)
 
void setGel (const MGAttribedGel *gel)
 
void setElementTarget (ELEMENT_TARGET target)
 Set Elements target. [詳解]
 
- 基底クラス mgVBO に属する継承限定公開変数類
unsigned m_dname
 
MGAttribedGelm_gel
 name to register in MGDNameControl. [詳解]
 
MGPvector< mgVBOElement > * m_target_elements
 When m_gel=0, this mgVBO is not for an MGAttribedGel but a temporary or non gel's VBO. [詳解]
 
bool m_elementsDirty:1
 
MGPvector< mgVBOElementm_elements
 =true if dirty and need to remake. [詳解]
 
bool m_elementsShadeDirty:1
 
MGPvector< mgVBOElementm_elementsShade
 =true if dirty and need to remake. [詳解]
 
MGColor m_colorStatic
 
GLfloat m_lineWidthStatic
 The color of the following Begin()(mgVBOLeaf generated) is set to this color. [詳解]
 
GLfloat m_pointSizeStatic
 
short int m_stippleFactor
 
GLushort m_LineStipplePattern
 
int m_lightMode
 m_LineStipplePatternindicates the pattern. [詳解]
 
mgGLSL::CoordinateType m_coordinateType
 <0: undefined, =0:Light is disabled, >0:Light is enabled. [詳解]
 
std::auto_ptr< mgVBOLeafBuilder > m_builder
 
- 基底クラス mgVBOElement に属する継承限定公開変数類
bool m_no_display:1
 

詳解

MGConstructionPlane defines a construction plane ton input 3D data.

MGConstructionPlane provides a local working 2D coordinate system and a local 3D coordinate system. MGConstructionPlane has the right hand coordinate system (U,V,N), where U=uspan*m_plane.uderiv(), V=uspan*m_plane.vderiv(), and N=m_nspan*m_plane.normal(). m_plane.uderiv(), m_plane.vderiv(), and m_plane.normal() are set to length one on the construction. MGConstructionPlane has the cplane coordinate system such that the coordinate (x, y, z) is the normal world coordinate (R+x*U, R+y*V, R+z*N). The cplane coordinate conversion utilities are provided as convert_to_world() or convert_from_world().

構築子と解体子

MGConstructionPlane::MGConstructionPlane ( )
MGConstructionPlane::MGConstructionPlane ( double  origin[3],
double  uaxis[3],
double  vaxis[3],
double  uspan,
double  vspan,
int  uline_num,
int  vline_num,
double  nspan = 1. 
)
引数
originOrigin's coordinate value.
uaxisA vector value of the horizontal direction.
vaxisA vector value of the vertical direction.
uspanspan length along u axis.
vspanspan length along v axis.
uline_numnumber of lines along u axis.
vline_numnumber of lines along v axis.
nspanspan length along normal axis.
MGConstructionPlane::MGConstructionPlane ( const MGPlane plane,
double  uspan,
double  vspan,
int  uline_num,
int  vline_num,
double  nspan = 1. 
)
引数
planeconstruction plane.
uspanspan length along u axis.
vspanspan length along v axis.
uline_numnumber of lines along u axis.
vline_numnumber of lines along v axis.
nspanspan length along normal axis.

関数詳解

void MGConstructionPlane::bind_to_grid ( const MGPosition uv,
MGPosition uvout 
) const

Bind the input point uv(this construction plane's parameter value) to the nearest grid point of this construction plane.

void MGConstructionPlane::change_origin ( const MGPosition new_origin)

Change origin point.

MGPosition MGConstructionPlane::convert_from_world ( const MGPosition world_coord) const

Convert to cplane coordinates from the normal world coordinates. Function's return is the cplane coordinates.

MGPosition MGConstructionPlane::convert_to_world ( const MGPosition cplane_coord) const

Convert cplane coordinates to the normal world coordinates. Function's return is the world coordinates.

bool MGConstructionPlane::disabled ( ) const
inline
bool MGConstructionPlane::enabled ( ) const
inline
MGVector MGConstructionPlane::eval ( const MGPosition uv) const
inline

Obtain the position data of the parameter (u,v).

MGVector MGConstructionPlane::eval ( double  u,
double  v 
) const
inline
void MGConstructionPlane::get_colors ( MGColor lineColor,
MGColor uaxisColor,
MGColor vaxisColor 
) const

Get line and axis colors.

引数
lineColorGrid line color
uaxisColoru axis
vaxisColorv axis
void MGConstructionPlane::get_grid_data ( double &  uspan,
double &  vspan,
int &  uline_num,
int &  vline_num,
double &  nspan 
) const

Obtain the grid data of this.

引数
uspanspan length along u axis.
vspanspan length along v axis.
uline_numnumber of lines along u axis.
vline_numnumber of lines along v axis.
nspanspan length along normal axis.
void MGConstructionPlane::importGridAttrib ( const MGContext ctx)

Import grid data from a MGContext, which are 1)(u,v) grid numbers, 2)(u,v) grid spans. Colors are not imported.

bool MGConstructionPlane::is_bind_to_grid ( ) const
inline

Return if locate point on this plane should be bind to grid point or not. true if should be bound to grid point.

MGPosition MGConstructionPlane::locate ( const MGStraight sl,
MGPosition uv 
) const

locate a point on this plane, given straight line. the located point will be the intersection(or nearest bound) point of sl and the plane. Function's return value is the world coordinate located.

引数
slinput the ray straight line of the cursor.
uvthe plane's parameter value (u,v) will be output.
virtual void MGConstructionPlane::make_display_list ( MGCL::VIEWMODE  vmode = MGCL::DONTCARE)
virtual

Draw this plane using OpenGL.

mgVBOを再実装しています。

const MGPlane& MGConstructionPlane::plane ( ) const
inline
MGPlane& MGConstructionPlane::plane ( )
inline
void MGConstructionPlane::set_bind_to_grid_disable ( )
inline
void MGConstructionPlane::set_bind_to_grid_enable ( )
inline

set bind_to_grid enable or disable.

void MGConstructionPlane::set_colors ( const MGColor  colors[3])

set line, u-axis, and v-axis colors.

[0]=line, [1]=u-axis, [2]=vaxis

void MGConstructionPlane::set_colorsByViewID ( int  vid,
const MGColor  colors[4] 
)

set colors by VID. colors[0] is the one of grid lines. colors[i] are the ones for axis lines for 1<=i<=3. As a standard one, colors[1]=x-axis, [2]=y-axis, [3]=z-axis. When 2<=vid<=4, (u,v) colors are: vid=2:(u,v)=(x,y), vid=3:(u,v)=(y,z), vid=4:(u,v)=(z,x). Other vid is treated as vid=2.

void MGConstructionPlane::set_disable ( )
inline
void MGConstructionPlane::set_enable ( )
inline
void MGConstructionPlane::set_grid_data ( const MGPlane plane,
double  uspan,
double  vspan,
int  uline_num,
int  vline_num,
double  nspan = 1 
)

Compute grid data and the plane from the plane and the grid span data.

引数
planeconstruction plane.
uspanspan length along u axis.
vspanspan length along v axis.
uline_numnumber of lines along u axis.
vline_numnumber of lines along v axis.
nspanspan length along normal axis.
void MGConstructionPlane::set_line_color ( const MGColor color)

set grid line color.

void MGConstructionPlane::set_num ( int  line_num)
void MGConstructionPlane::set_plane ( const MGPlane plane)
void MGConstructionPlane::set_span ( double  span)
void MGConstructionPlane::set_uaxis_color ( const MGColor color)

set uaxis color.

void MGConstructionPlane::set_unum ( int  unum)
void MGConstructionPlane::set_uspan ( double  span)
void MGConstructionPlane::set_vaxis_color ( const MGColor color)

set vaxis color.

void MGConstructionPlane::set_vnum ( int  vnum)
void MGConstructionPlane::set_vspan ( double  span)
void MGConstructionPlane::setGridDataByBox ( const MGBox box,
int  view_num = 1,
const MGColor gridColors = 0 
)

Construct grid and the plane data from box and view. When view_num=2(x,y):(u,v)=(X-axis, Y-axis) where (u,v) is the direction of this plane, view_num=3(y,z):(u,v)=(Y-axis, Z-axis), view_num=4(z,x):(u,v)=(Z-axis, X-axis). The colors of the axes are set according to the kind of the axis. X's color=gridColors[1], Y's color=gridColors[2], Z's color=gridColors[3]. Other line color is gridColor[0].

引数
boxThe target box.
view_numStandard view number: 1: 3D perspective view, 2:(x,y) 2D view, 3:(y,z) 2D view, 4:(z,x) 2D view 0: non standard view.
gridColorsThe colors for the grid, axes. When null, colors not set.
int MGConstructionPlane::unum ( ) const
inline
double MGConstructionPlane::uspan ( ) const
inline
bool MGConstructionPlane::valid ( ) const
inline
int MGConstructionPlane::vnum ( ) const
inline
double MGConstructionPlane::vspan ( ) const
inline

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

MG_DLL_DECLR friend void MGcplane_parameter ( const MGBox box,
double &  span,
int &  lnum,
int &  sdid,
MGPosition mid 
)
friend

Compute cplane parameter from 3D box.

引数
boxThe target box.
spanspan length will be output.
lnumnumber of lines along vertical and horizontal will be output.
sdidmaxmum area coordinate pair will be output. 0:(x,y), 1:(y,z), 2:(z,x)
midrounded mid point will be output.
MG_DLL_DECLR friend std::ostream& operator<< ( std::ostream &  out,
const MGConstructionPlane pln 
)
friend

Debug Function.

MG_DLL_DECLR friend MGOfstream& operator<< ( MGOfstream buf,
const MGConstructionPlane cpl 
)
friend

Serialization.

MG_DLL_DECLR friend MGIfstream& operator>> ( MGIfstream buf,
MGConstructionPlane cpl 
)
friend

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