6 #if !defined(_MGVBO__INCLUDED_)
7 #define _MGVBO__INCLUDED_
11 #endif // _MSC_VER > 1000
13 #include "MGCLStdAfx.h"
14 #include "mg/Pvector.h"
15 #include "mg/drawParam.h"
16 #include "mgGL/glslprogram.h"
17 #include "mgGL/StaticGLAttrib.h"
18 #include "mgGL/Color.h"
19 #include "mgGL/GLAttrib.h"
20 #include "mgGL/VBOElement.h"
21 #include "mgGL/VBOLeafBuilder.h"
78 friend class MGDNameControl;
120 bool buildVBOHierarchy(
122 std::vector<mgVBO*>& vbos
153 virtual void clearStaticAttributes();
161 const_iterator
end_element()
const{
return m_target_elements->end();};
195 virtual void Begin(GLenum type, ELEMENT_TARGET target=
WIRE);
202 virtual mgVBOLeaf* End(GLenum polygonMode=GL_FILL);
219 void Color(
const MGColor& colr);
220 void Color3fv(
const float colr[3]);
221 void Color3dv(
const double colr[3]);
222 void Color4fv(
const float colr[4]);
223 void Color4ubv(
const unsigned char rgba[4]);
227 void Normal(
float x,
float y,
float z);
228 void Normal3d(
double x,
double y,
double z);
229 void Normal3fv(
const float norml[3]);
230 void Normal3dv(
const double norml[3]);
234 virtual void Vertex(
float x,
float y,
float z=0.0f);
235 virtual void Vertex3d(
double x,
double y,
double z=0.0);
236 virtual void Vertex2fv(
const float v[2]);
237 virtual void Vertex3fv(
const float v[3]);
238 virtual void Vertex2dv(
const double v[2]);
239 virtual void Vertex3dv(
const double v[3]);
243 void TexCoord(
float x,
float y);
244 void TexCoord2d(
double x,
double y);
245 void TexCoord2fv(
const float v[2]);
246 void TexCoord2dv(
const double v[2]);
253 void setStaticAttribColor(
const MGColor& color);
254 void setStaticAttribColor(
const float color[4]);
255 void setStaticAttribColor(
float r,
float g,
float b);
256 void setStaticAttribLineWidth(GLfloat size);
257 void setStaticAttribPointSize(GLfloat size);
264 void setLineStipple(
short int factor, GLushort pattern=0);
266 void LineWidth(GLfloat size){setStaticAttribLineWidth(size);};
269 void disableLinePattern();
293 void drawBox(
const MGBox& box);
299 bool draw_points=
true
303 bool draw_points=
true
309 void draw3DVertex(
const MGObject& obj);
310 void draw3DVertex_in_star(
const MGComplex& obj);
311 void draw3DVertex_in_star(
const MGCellBase& obj);
315 void drawWire_in_star(
const MGComplex& obj);
320 double drawCurvaGraph(
334 void drawPoint(
double x,
double y,
double z,
double size=-1.);
335 void drawPoint(
const MGPosition& pos,
double size=-1.);
336 void drawPointInverseColor(
double x,
double y,
double z,
double size=-1.);
337 void drawPointInverseColor(
const MGPosition& pos,
double size=-1.);
342 void drawPointWithColor(
double x,
double y,
double z,
343 double outerSize,
double innerSize,
350 void drawPointWithColor(
const MGPosition& pos,
351 double outerSize,
double innerSize,
361 const std::vector<MGPosition>& ipos,
367 void drawPolyline(
const MGBPointSeq& line,
bool closed=
false);
371 void drawPolyline(
const std::vector<MGPosition>& line,
bool closed=
false);
378 void drawObjInParameterSpace(
const MGObject& obj);
397 void drawSurfaceCurvature(
400 double lower,
double upper
405 void drawSurfaceCurvature(
406 const std::vector<mgTL2Triangles>& tldvec,
416 GLenum polygonMode=GL_FILL
422 const std::vector<mgTL2Triangles>& trisVector,
424 GLenum polygonMode=GL_FILL
432 GLenum polygonMode=GL_FILL
441 GLfloat getPointSize()
const;
442 GLfloat getLineWidth()
const;
449 int getLightMode(){
return m_lightMode;};
459 mutable bool m_elementsDirty:1;
467 mutable bool m_elementsShadeDirty:1;
485 GLushort m_LineStipplePattern;
501 virtual void execStaticGLAttrib();
505 virtual void execModelTypeAttrib();
511 void setElementTarget(ELEMENT_TARGET target);
520 const MGCurve& curve,
double scale,
int density,
bool use_radius
532 m_orgMode = m_vbo.getLightMode();
533 m_vbo.setLightMode(mode);
537 m_vbo.setLightMode(m_orgMode);
546 #endif // !defined(_MGVBO__INCLUDED_)
Interface class to include an element in mgVBO class's.
Definition: VBOElement.h:44
MGColor & staticColor()
Definition: VBO.h:445
friend class mgVBO
Definition: VBOElement.h:45
std::auto_ptr< mgVBOLeafBuilder > m_builder
Definition: VBO.h:495
Is an abstract class and the super class of MGPVertex and MGCellNB.
Definition: CellBase.h:38
Utility class to invoke mgVBO::setLightMode().
Definition: VBO.h:529
SURFACE_CURVATURE_KIND
Definition: MGCL.h:262
MGCurve is an abstract class which represents a whole curve.
Definition: Curve.h:63
const MGColor & staticColor() const
Definition: VBO.h:444
MGPvector< mgVBOElement > * m_target_elements
When m_gel=0, this mgVBO is not for an MGAttribedGel but a temporary or non gel's VBO...
Definition: VBO.h:457
const_iterator end_element() const
Definition: VBO.h:161
A vector of mgTL2Triangle's.
Definition: TL2Triangles.h:25
std::vector< mgVBOElement * >::const_iterator const_iterator
Definition: Pvector.h:32
MGImage defines bit map image data.
Definition: Image.h:26
mgGLSL::CoordinateType m_coordinateType
<0: undefined, =0:Light is disabled, >0:Light is enabled.
Definition: VBO.h:493
mgVBOElement * front() const
Definition: VBO.h:156
mgLightModeSwitcher(mgVBO &vbo, mgGLSL::ShadeMode mode)
Definition: VBO.h:531
MGAttribedGel * gel() const
Definition: VBO.h:171
MGPvector< mgVBOElement > m_elements
=true if dirty and need to remake.
Definition: VBO.h:460
Is an abstract class which represents a whole geometry and a topology.
Definition: Object.h:42
virtual bool is_made(MGCL::VIEWMODE viewMode=MGCL::DONTCARE)=0
Vector of a general n space dimension.
Definition: Vector.h:26
GLfloat m_pointSizeStatic
Definition: VBO.h:480
void execStaticColorAttrib()
Definition: VBO.h:497
Defines a Box of any space dimendion.
Definition: Box.h:34
MGColor defines the OpenGL color (R,G,B,A).
Definition: Color.h:26
void setLightMode(int mode)
Set light mode. mode=-1:undefined, =0:disabled, =1:enabled.
Definition: VBO.h:448
virtual void draw(MGCL::VIEWMODE viewMode=MGCL::DONTCARE)=0
DrawType
Definition: glslprogram.h:25
virtual void make_display_list(MGCL::VIEWMODE vmode=MGCL::DONTCARE)=0
すでに作成済みであっても強制的に再作成を行う。
Defines parameters to draw MGObject, maily to approximate by lines and facets.
Definition: drawParam.h:53
iterator begin_element()
Definition: VBO.h:158
MGColor m_colorStatic
Definition: VBO.h:473
void push_back_element(mgVBOElement *elm)
Definition: VBO.h:164
MG_DLL_DECLR double getCurveCurvatureLength(const MGCurve &curve, double scale, int density, bool use_radius)
Is an abstract class which provides interfaces of MGGel that has MGAppearance.
Definition: AttribedGel.h:32
Represent a positional data.
Definition: Position.h:28
std::vector< mgVBOElement * >::iterator iterator
Definition: Pvector.h:31
MGPvector< mgVBOElement > container_type
Definition: VBO.h:90
~mgLightModeSwitcher()
Definition: VBO.h:536
void setDlName(unsigned name)
Definition: VBO.h:507
Texture definition class.
Definition: Texture.h:29
MGPvector< mgVBOElement > m_elementsShade
=true if dirty and need to remake.
Definition: VBO.h:468
ELEMENT_TARGET
Definition: VBO.h:84
surface mode
Definition: MGCL.h:274
short int m_stippleFactor
Definition: VBO.h:484
MGGroupなどでmemberのMGGelの描画をmgVBOのelementとするためのクラス.
Definition: VBOPointer.h:50
mgVBOElement * back() const
Definition: VBO.h:155
Defines BPoint seq of a space dimension and of a capacity.
Definition: BPointSeq.h:38
void pop_back_element()
Definition: VBO.h:163
MGAttribedGel * m_gel
name to register in MGDNameControl.
Definition: VBO.h:454
VIEWMODE
Definition: MGCL.h:271
iterator end_element()
Definition: VBO.h:159
void setDrawParam(const MGDrawParam &dpara)
Definition: VBO.h:438
MGStl is a concrete class which represents an STL information.
Definition: MGStl.h:34
int m_lightMode
m_LineStipplePatternindicates the pattern.
Definition: VBO.h:490
virtual GLuint getSelectionName() const =0
virtual void redraw(MGCL::VIEWMODE viewMode)=0
MG_DLL_DECLR void execStaticColorAttrib(const MGColor &color)
container_type::const_iterator const_iterator
Definition: VBO.h:92
virtual void selectionDraw(MGCL::VIEWMODE viewMode=MGCL::DONTCARE)=0
MGComplex is a container of parameter cells and binder cells.
Definition: Complex.h:25
mgVBOに対して描画データ作成後の情報を保持するためのクラス.
Definition: VBOLeaf.h:38
GLfloat m_lineWidthStatic
The color of the following Begin()(mgVBOLeaf generated) is set to this color.
Definition: VBO.h:476
unsigned getDName() const
Definition: VBO.h:169
container_type::iterator iterator
Definition: VBO.h:91
CoordinateType
Definition: glslprogram.h:46
int elementNumber() const
Definition: VBO.h:162
const_iterator begin_element() const
Definition: VBO.h:160
Defines Spoint seq of a space dimension and of a size.
Definition: SPointSeq.h:36
ShadeMode
Definition: glslprogram.h:56
OpenGL 4 用描画のためのクラス, in other words, display list.
Definition: VBO.h:76
void LineWidth(GLfloat size)
Definition: VBO.h:266
wire frame mode
Definition: MGCL.h:273
static void setDrawParam(const MGDrawParam &dpara)
Definition: VBOElement.h:98