MGCL V10  V10
MGCL V10
 全て クラス 名前空間 関数 変数 型定義 列挙型 列挙値 フレンド グループ ページ
AttribedGel.h
1 /********************************************************************/
2 /* Copyright (c) 2015 DG Technologies Inc. and Yuzi Mizuno */
3 /* All rights reserved. */
4 /********************************************************************/
5 #ifndef _MGAttribedGel_HH_
6 #define _MGAttribedGel_HH_
7 
8 #include "mg/MGCL.h"
9 #include "mg/Gel.h"
10 #include "mgGL/VBO.h"
11 
12 //
13 //Define MGAttribedGel Class.
14 
15 class MGAppearance;
16 class MGObject;
17 class MGGroup;
18 class MGGLAttrib;
19 class MGName;
20 class mgVBO;
21 
22 class MGColor;
23 
28 
32 class MG_DLL_DECLR MGAttribedGel:public MGGel{
33 friend class MGGroup;
34 friend class MGObject;
35 friend class mgVBO;
36 friend class MGDNameControl;
37 
38 public:
39 
41 MGAttribedGel():m_dlistName(0){;};
42 
44 MGAttribedGel(const MGAttribedGel& gel2);
45 
49 virtual MGAttribedGel& operator=(const MGAttribedGel& gel2);
50 
51 virtual ~MGAttribedGel();
52 
55 virtual MGAppearance* appearance()=0;
56 virtual const MGAppearance* appearance()const=0;
57 
58 //copy the appearance of gel2 to this.
59 void copy_appearance(const MGAttribedGel& gel2);
60 
63 mgVBO* dlist_name()const;
64 
66 virtual bool displayList_is_made(MGCL::VIEWMODE vmode)const;
67 
70 void deleteDlistName()const;
71 
73 virtual void drawAttrib(
74  mgVBO& vbo,
75  bool no_color=false
76 )const;
77 virtual void render_attribute()const;
78 
81 virtual MGAppearance* ensure_appearance()=0;
82 
84 virtual int get_draw_attrib_mask()const;
85 virtual int get_render_attrib_mask()const;
86 
88 int getVBOElementsNumber()const;
89 
91 int getVBOShaderElementsNumber()const;
92 
95 virtual bool no_display()const;
96 
98 virtual void remove_appearance()=0;
99 
101 void remove_GLattrib(long tid);
102 
105 virtual void set_GLattrib(MGGLAttrib* attr);
106 
108 virtual void set_display();
109 virtual void set_no_display();
110 bool visible()const{return !no_display();};
111 
112 //set the copy of appr2 to this MGAttribedgel.
113 virtual void set_appearance(const MGAppearance& appr2)=0;
114 
117 void set_name(const MGName& newName);
118 
122 const MGName* get_name()const;
123 
126 void set_color(const MGColor& newColor);
127 
131 const MGColor* get_color()const;
132 
135 void setDlistName(mgVBO* vbo=0)const;
136 
138 void setDirty(
139  bool is_dirty
140 )const;
141 
142 protected:
143  mutable std::auto_ptr<mgVBO> m_dlistName;
144 
145 
146 };
147  // end of GelRelated group
149 #endif
virtual MGGel & operator=(const MGGel &gel2)
Definition: Gel.h:77
bool visible() const
Definition: AttribedGel.h:110
MGGLAttrib is an abstract class which defines the enum of undefined or disabled.
Definition: GLAttrib.h:35
std::auto_ptr< mgVBO > m_dlistName
display name if m_dlistName!=0;
Definition: AttribedGel.h:143
Is an abstract class which represents a whole geometry and a topology.
Definition: Object.h:42
MGColor defines the OpenGL color (R,G,B,A).
Definition: Color.h:26
MGGel is an abstract class which represents a group element.
Definition: Gel.h:53
Is an abstract class which provides interfaces of MGGel that has MGAppearance.
Definition: AttribedGel.h:32
Defines MGAttribedGel's Name data.
Definition: Name.h:29
VIEWMODE
Definition: MGCL.h:271
virtual mgVBO * dlist_name() const
Obtain display list name. 0(null) means this gel need not to be displayed.
Definition: Gel.h:103
virtual bool no_display() const
Definition: Gel.h:167
MGAttribedGel()
void constructor.
Definition: AttribedGel.h:41
MGGroup is a class which constains MGGel elements.
Definition: Group.h:35
A container class to hold MGGLAttrib objects.
Definition: Appearance.h:33
OpenGL 4 用描画のためのクラス, in other words, display list.
Definition: VBO.h:76
virtual void drawAttrib(mgVBO &vbo, bool no_color=false) const
draw attribute data.
Definition: Gel.h:106