9 #include "mgGL/GLAttrib.h"
10 #include "mgGL/Pixel.h"
189 MGColor(
float red,
float green,
float blue,
float alpha=1.);
194 explicit MGColor(
unsigned int argb);
208 MGColor& operator+=(
float value);
217 void argb_to_float(
unsigned int argb,
float out[4])
const;
226 void exec(
mgVBO& vbo)
const;
229 const float*
color()
const{
return m_color;};
234 int get_ColorID(
int maxID)
const;
237 static const MGColor& get_instance(ColorID
id);
248 unsigned int get_colorAsUInt();
250 void set_color(
const float color[4]);
251 void set_color(
float red,
float green,
float blue,
float alpha=1.);
252 void get_color(
float color[4])
const;
253 void get_color(
float& red,
float& green,
float& blue,
float& alpha)
const;
284 std::string
whoami()
const{
return "Color";};
292 std::ostream&
out(std::ostream&)
const;
298 int SubordinateEntitySwitch=0
304 static MGColors m_colors;
306 friend class MGColors;
313 class MG_DLL_DECLR MGColors{
315 const MGColor& color(
int i){
return *(m_colors[i]);};
329 GetRValue(color)/255.f,
330 GetGValue(color)/255.f,
331 GetBValue(color)/255.f);
337 BYTE r = (BYTE)((dwColor & 0x00FF0000) >> 16);
338 BYTE g = (BYTE)((dwColor & 0x0000FF00) >> 8);
339 BYTE b = (BYTE)(dwColor & 0x000000FF);
344 BYTE r = GetRValue(cl);
345 BYTE g = GetGValue(cl);
346 BYTE b = GetBValue(cl);
347 return (r << 16) | (g << 8) | b;
352 #endif //#ifndef _MGColor_HH_
void reset_Amask(unsigned int &mask, MGGLAttrib::ATTRIB_MASK bit)
float * color()
Definition: Color.h:228
std::string whoami() const
Definition: Color.h:284
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 int out_to_IGES(MGIgesOfstream &igesfile, int SubordinateEntitySwitch=0) const
Definition: Gel.h:93
Definition: GLAttrib.h:41
ColorID
The color id from 1 to 8(black to white) is the id of IGES.
Definition: Color.h:40
virtual bool operator<(const MGGel &gel2) const
virtual MGGLAttrib * clone() const =0
Generate a newed clone object.
virtual void WriteMembers(MGOfstream &buf) const
Write all member data.
void set_draw_attrib_mask(unsigned int &mask) const
Turn on the appropriate mask bit for this attribute. See glPushAttrib().
Definition: Color.h:265
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
Definition: GLAttrib.h:40
COLORREF ARGBtoCOLORREF(DWORD dwColor)
Definition: Color.h:336
MG_DLL_DECLR MGVector & operator*=(MGVector &v, const MGMatrix &m)
virtual void drawAttrib(mgVBO &vbo, bool no_color=false) const =0
draw GLAttribute process.
const float * color() const
Definition: Color.h:229
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
DWORD COLORREFtoARGB(COLORREF cl)
Definition: Color.h:343
bool is_highlight_attrib() const
Test if this is highlight attrib or not.
Definition: Color.h:240
void reset_draw_attrib_mask(unsigned int &mask) const
Turn off the appropriate mask bit for this attribute. See glPushAttrib().
Definition: Color.h:268
virtual std::ostream & out(std::ostream &) const
Output virtual function.
MGOfstream is a class to serialize all of the subclasses of MGGel.
Definition: Ofstream.h:31
MGColor FromCOLORREF(COLORREF color)
Definition: Color.h:327
MGColor(MODE m=UNDEFINED)
Definition: Color.h:186
MGOgesIfstream write out to *.iges file, transforming MGCL objects to IGES objects.
Definition: IgesOfstream.h:26
MODE
Definition: Color.h:30
long identify_type() const
Return This object's typeID.
Definition: Color.h:282
void render(mgVBO &vbo) const
render GLAttribute process.
Definition: Color.h:262
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: Color.h:276
void set_enabled()
Definition: Color.h:273
Define MGPixel Class of (R,G,B,A) pixel data.
Definition: Pixel.h:18
void reset_render_attrib_mask(unsigned int &mask) const
Turn off the appropriate mask bit for this attribute. See glPushAttrib().
Definition: Color.h:279