00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 # ifndef mmx_shape_color_glue_hpp
00012 # define mmx_shape_color_glue_hpp
00013 # include <basix/glue.hpp>
00014 # include <shape/axel_glue.hpp>
00015 # include <shape/color.hpp>
00016
00017 # define shape_color shape::color<shape::MGXK>
00018 # define COLOR shape_color
00019
00020 namespace mmx {
00021 namespace shape {
00022
00023 inline bool operator ==(const COLOR& v1, const COLOR& v2) {return true;}
00024 inline bool operator !=(const COLOR& v1, const COLOR& v2) {return !(v1==v2);}
00025 inline bool exact_eq( const COLOR& v1, const COLOR& v2) {return v1==v2;}
00026 inline bool exact_neq(const COLOR& v1, const COLOR& v2) {return v1!=v2;}
00027
00028 inline unsigned hash (const COLOR& v) {
00029 register unsigned i, h= 214365, n=1;
00030 for (i=0; i<n; i++) h= (h<<1) ^ (h<<5) ^ (h>>27) ;
00031 return h;
00032 }
00033
00034 inline unsigned exact_hash(const COLOR& m) {return hash(m);}
00035 inline unsigned soft_hash (const COLOR& m) {return hash(m);}
00036
00037 inline syntactic flatten (const COLOR& s) {
00038 syntactic res = "Color";
00039 return apply(res,
00040 mmx::flatten(s.r), mmx::flatten(s.g), mmx::flatten(s.b));
00041
00042 }
00043 }
00044
00045
00046 }
00047
00048 # undef COLOR
00049 # endif // mmx_shape_color_glue_hpp