Go to the documentation of this file.
4 #ifndef tools_sg_tex_rect
5 #define tools_sg_tex_rect
29 virtual void*
cast(
const std::string& a_class)
const {
30 {
if(
void* p = cmp_cast<tex_rect>(
this,a_class))
return p;}
32 return parent::cast(a_class);
40 static const desc_fields s_v(parent::node_desc_fields(),6,
61 #ifdef TOOLS_SG_TEX_RECT_DEBUG
62 a_action.
out() <<
"tools::tex_rect::render : begin : 001 : " << std::endl;
69 #ifdef TOOLS_SG_TEX_RECT_DEBUG
70 a_action.
out() <<
"tools::tex_rect::render : touched." << std::endl;
76 #ifdef TOOLS_SG_TEX_RECT_DEBUG
77 a_action.
out() <<
"tools::tex_rect::render : m_img is empty." << std::endl;
82 #ifdef TOOLS_SG_TEX_RECT_DEBUG
83 a_action.
out() <<
"tools::tex_rect::render : have a m_img. get_tex_id ..." << std::endl;
88 #ifdef TOOLS_SG_TEX_RECT_DEBUG
89 a_action.
out() <<
"tools::tex_rect::render : get_tex_id : " << _id <<
"." << std::endl;
100 #ifdef TOOLS_SG_TEX_RECT_DEBUG
101 a_action.
out() <<
"tools::tex_rect::render : show_border." << std::endl;
118 #ifdef TOOLS_SG_TEX_RECT_DEBUG
119 a_action.
out() <<
"tools::tex_rect::render : draw back face." << std::endl;
130 #ifdef TOOLS_SG_TEX_RECT_DEBUG
131 a_action.
out() <<
"tools::tex_rect::render : draw_vertex_normal_array_texture." << std::endl;
169 float aspect = float(_img.
width())/float(_img.
height());
171 float w2 = aspect*h2;
177 float imw = (float)_img.
width();
178 float imh = (float)_img.
height();
181 int ix = int((imw*p.
x()/w2+imw)*0.5f);
182 int iy = int((imh*p.
y()/h2+imh)*0.5f);
185 std::vector<unsigned char> pixel;
186 if((ix<0)||(iy<0)||!_img.
pixel(ix,iy,pixel)) {a_s.clear();
return false;}
189 for(
unsigned int ipix=0;ipix<pixel.size();ipix++) {
191 if(!numas<float>(
float(pixel[ipix])/255.0f,a_s)){}
217 parent::operator=(a_from);
220 if(&a_from==
this)
return *
this;
229 void rendered_size(std::ostream& a_out,
unsigned int& a_w,
unsigned int& a_h) {
252 float w2 = aspect*h2;
293 float w2 = aspect*h2;
296 back[0] = w2;back[ 1] = -h2;back[ 2] = d2;
297 back[3] = -w2;back[ 4] = -h2;back[ 5] = d2;
298 back[6] = -w2;back[ 7] = h2;back[ 8] = d2;
299 back[9] = w2;back[10] = h2;back[11] = d2;
#define TOOLS_NODE_NO_CAST(a__class, a__sclass, a__parent)
#define TOOLS_FIELD_DESC_NODE_CLASS(a__class)
#define TOOLS_ARG_FIELD_DESC(a__field)