MGCL V10  V10
MGCL V10
 全て クラス 名前空間 関数 変数 型定義 列挙型 列挙値 フレンド グループ ページ
LineStipple.h
1 /********************************************************************/
2 /* Copyright (c) 2015 DG Technologies Inc. and Yuzi Mizuno */
3 /* All rights reserved. */
4 /********************************************************************/
5 
6 #ifndef _MGLineStipple_HH_
7 #define _MGLineStipple_HH_
8 
9 #include "mgGL/GLAttrib.h"
10 
11 class MGOfstream;
12 class MGIfstream;
13 
14 //
15 //Define MGLineStipple Class.
16 
21 
24 class MG_DLL_DECLR MGLineStipple:public MGGLAttrib{
25 
26 public:
27 
28 enum LineFont{
29  UndefinedFont=-1,
30  Solid=1,
31  Dashed=2,
32  Phantom=3,
33  CenterLine=4,
34  Dotted=5
35 };
36 
38 MGLineStipple(LineFont font);
39 MGLineStipple(int factor,unsigned short pattern)
40 :MGGLAttrib(factor){m_pattern=pattern;};
41 
43 MGLineStipple& operator=(const MGGel& gel2);
45 
47 bool operator<(const MGLineStipple& gel2)const;
48 bool operator<(const MGGel& gel2)const;
49 
51 
53 MGLineStipple* clone()const;
54 
56 void exec()const;
57 
59 void exec(mgVBO& vbo)const;
60 
61 void set(int factor,unsigned short pattern){data()=factor;m_pattern=pattern;};
62 int get_factor()const{return data();};
63 unsigned short get_pattern()const{return m_pattern;};
64 
66 LineFont get_font_number()const;
67 
70  mgVBO& vbo,
71  bool no_color=false
72 )const{exec(vbo);};
73 
75 bool is_highlight_attrib()const{return true;};
76 
78 void render(mgVBO& vbo)const{exec(vbo);};
79 
81 void set_draw_attrib_mask(unsigned int& mask)const{set_Amask(mask,LINE_BIT);};
82 
84 void reset_draw_attrib_mask(unsigned int& mask)const{reset_Amask(mask,LINE_BIT);};
85 
87 void set_render_attrib_mask(unsigned int& mask)const{set_Amask(mask,LINE_BIT);};
88 
90 void reset_render_attrib_mask(unsigned int& mask)const{reset_Amask(mask,LINE_BIT);};
91 
93 long identify_type() const{return MGLINE_STIPPLE_TID;};
94 
95 std::string whoami()const{return "LineStipple";};
96 
98 void ReadMembers(MGIfstream& buf);
100 void WriteMembers(MGOfstream& buf)const;
101 
103 std::ostream& out(std::ostream&) const;
104 
105 private:
106  unsigned short m_pattern;
107 
108 };
109  // end of GLAttrib group
111 #endif //#ifndef _MGLineStipple_HH_
112 
int get_factor() const
Definition: LineStipple.h:62
long identify_type() const
Return This object's typeID.
Definition: LineStipple.h:93
void render(mgVBO &vbo) const
render GLAttribute process.
Definition: LineStipple.h:78
void reset_Amask(unsigned int &mask, MGGLAttrib::ATTRIB_MASK bit)
MGGLAttrib is an abstract class which defines the enum of undefined or disabled.
Definition: GLAttrib.h:35
void set_Amask(unsigned int &mask, MGGLAttrib::ATTRIB_MASK bit)
Set or reset the bit of mask.
virtual bool operator<(const MGGel &gel2) const
int data() const
retrieve the data.
Definition: GLAttrib.h:86
virtual MGGLAttrib * clone() const =0
Generate a newed clone object.
virtual void WriteMembers(MGOfstream &buf) const
Write all member data.
MGLineStipple(int factor, unsigned short pattern)
Definition: LineStipple.h:39
void reset_draw_attrib_mask(unsigned int &mask) const
Turn off the appropriate mask bit for this attribute. See glPushAttrib().
Definition: LineStipple.h:84
void set(int factor, unsigned short pattern)
Definition: LineStipple.h:61
virtual void ReadMembers(MGIfstream &buf)
Read all member data.
MGIfstream is a class to read the serialized data generated by MGOfstream.
Definition: Ifstream.h:30
virtual MGGLAttrib & operator=(const MGGLAttrib &gel2)
Definition: GLAttrib.h:70
MGLineStipple()
Definition: LineStipple.h:37
MGGel is an abstract class which represents a group element.
Definition: Gel.h:53
unsigned short get_pattern() const
Definition: LineStipple.h:63
bool is_highlight_attrib() const
Test if this is highlight attrib or not.
Definition: LineStipple.h:75
virtual std::ostream & out(std::ostream &) const
Output virtual function.
std::string whoami() const
Definition: LineStipple.h:95
MGOfstream is a class to serialize all of the subclasses of MGGel.
Definition: Ofstream.h:31
void reset_render_attrib_mask(unsigned int &mask) const
Turn off the appropriate mask bit for this attribute. See glPushAttrib().
Definition: LineStipple.h:90
LineFont
Definition: LineStipple.h:28
void set_draw_attrib_mask(unsigned int &mask) const
Turn on the appropriate mask bit for this attribute. See glPushAttrib().
Definition: LineStipple.h:81
void drawAttrib(mgVBO &vbo, bool no_color=false) const
draw GLAttribute process.
Definition: LineStipple.h:69
OpenGL 4 用描画のためのクラス, in other words, display list.
Definition: VBO.h:76
void set_render_attrib_mask(unsigned int &mask) const
Turn on the appropriate mask bit for this attribute. See glPushAttrib().
Definition: LineStipple.h:87
MGLineStipple defines line stipple patters.
Definition: LineStipple.h:24