|
typedef float | f12[12] |
|
typedef float | f18[18] |
|
|
void | update_sg (std::ostream &a_out) |
|
bool | img_ndc_value (float a_x, float a_y, std::string &a_s) const |
|
bool | point_2_img_ndc (const vec3f &a_point, float &a_x, float &a_y) const |
|
bool | line_2_img_ndc (const line< vec3f > &a_line, float &a_x, float &a_y) const |
|
bool | img_ndc_2_point (float a_x, float a_y, vec3f &a_point) const |
|
void | _front (f12 &a_front, f12 &a_nms, float a_epsil=0.0f) |
|
void | _back (f12 &a_back) |
|
void | _tris (f18 &a_tris, f18 &a_nms) |
|
| node (const node &) |
|
node & | operator= (const node &) |
|
void | add_field (field *a_field) |
|
bool | write_fields (write_action &a_action) |
|
bool | read_fields (read_action &a_action) |
|
field_desc::offset_t | field_offset (const field *a_field) const |
|
field * | find_field (const field_desc &a_rdesc) const |
|
void | check_fields (std::ostream &a_out) const |
|
| gstos () |
|
virtual | ~gstos () |
|
| gstos (const gstos &) |
|
gstos & | operator= (const gstos &a_from) |
|
unsigned int | get_tex_id (std::ostream &a_out, render_manager &a_mgr, const img_byte &a_img, bool a_NEAREST) |
|
virtual unsigned int | create_gsto (std::ostream &, render_manager &) |
|
unsigned int | get_gsto_id (std::ostream &a_out, render_manager &a_mgr) |
|
void | clean_gstos () |
|
void | clean_gstos (render_manager *a_mgr) |
|
unsigned int | _find (render_manager *a_mgr) |
|
void | _update_sg_ (std::ostream &a_out) |
|
void | set_tcs (float a_tcs[8]) |
|
Definition at line 23 of file tex_quadrilateral.
◆ f12
typedef float tools::sg::tex_quadrilateral::f12[12] |
|
protected |
◆ f18
typedef float tools::sg::tex_quadrilateral::f18[18] |
|
protected |
◆ tex_quadrilateral() [1/2]
tools::sg::tex_quadrilateral::tex_quadrilateral |
( |
| ) |
|
|
inline |
◆ ~tex_quadrilateral()
virtual tools::sg::tex_quadrilateral::~tex_quadrilateral |
( |
| ) |
|
|
inlinevirtual |
◆ tex_quadrilateral() [2/2]
◆ _back()
void tools::sg::tex_quadrilateral::_back |
( |
f12 & |
a_back | ) |
|
|
inlineprotected |
Definition at line 366 of file tex_quadrilateral.
367 const std::vector<vec3f>& cs =
corners.values();
369 a_back[0] = cs[1].x();
370 a_back[1] = cs[1].y();
371 a_back[2] = cs[1].z();
373 a_back[3] = cs[0].x();
374 a_back[4] = cs[0].y();
375 a_back[5] = cs[0].z();
377 a_back[6] = cs[3].x();
378 a_back[7] = cs[3].y();
379 a_back[8] = cs[3].z();
381 a_back[ 9] = cs[2].x();
382 a_back[10] = cs[2].y();
383 a_back[11] = cs[2].z();
◆ _front()
void tools::sg::tex_quadrilateral::_front |
( |
f12 & |
a_front, |
|
|
f12 & |
a_nms, |
|
|
float |
a_epsil = 0.0f |
|
) |
| |
|
inlineprotected |
Definition at line 330 of file tex_quadrilateral.
331 const std::vector<vec3f>& cs =
corners.values();
333 a_front[0] = cs[0].x()-a_epsil;
334 a_front[1] = cs[0].y()-a_epsil;
335 a_front[2] = cs[0].z();
337 a_front[3] = cs[1].x()+a_epsil;
338 a_front[4] = cs[1].y()-a_epsil;
339 a_front[5] = cs[1].z();
341 a_front[6] = cs[2].x()+a_epsil;
342 a_front[7] = cs[2].y()+a_epsil;
343 a_front[8] = cs[2].z();
345 a_front[ 9] = cs[3].x()-a_epsil;
346 a_front[10] = cs[3].y()+a_epsil;
347 a_front[11] = cs[3].z();
◆ _tris()
void tools::sg::tex_quadrilateral::_tris |
( |
f18 & |
a_tris, |
|
|
f18 & |
a_nms |
|
) |
| |
|
inlineprotected |
Definition at line 387 of file tex_quadrilateral.
404 a_tris[10] = back[7];
405 a_tris[11] = back[8];
407 a_tris[12] = back[9];
408 a_tris[13] = back[10];
409 a_tris[14] = back[11];
411 a_tris[15] = back[0];
412 a_tris[16] = back[1];
413 a_tris[17] = back[2];
◆ bbox()
virtual void tools::sg::tex_quadrilateral::bbox |
( |
bbox_action & |
a_action | ) |
|
|
inlinevirtual |
◆ cast()
virtual void* tools::sg::tex_quadrilateral::cast |
( |
const std::string & |
a_class | ) |
const |
|
inlinevirtual |
Reimplemented from tools::sg::base_tex.
Definition at line 26 of file tex_quadrilateral.
27 {
if(
void* p = cmp_cast<tex_quadrilateral>(
this,a_class))
return p;}
29 return parent::cast(a_class);
◆ img_ndc_2_point()
bool tools::sg::tex_quadrilateral::img_ndc_2_point |
( |
float |
a_x, |
|
|
float |
a_y, |
|
|
vec3f & |
a_point |
|
) |
| const |
|
inlineprotected |
Definition at line 258 of file tex_quadrilateral.
259 if(
corners.size()!=4) {a_point.set_value(0,0,0);
return false;}
268 float l_01 = x_axis.normalize();
269 if(l_01==0.0f) {a_point.set_value(0,0,0);
return false;}
271 float l_03 = y_axis.normalize();
272 if(l_03==0.0f) {a_point.set_value(0,0,0);
return false;}
274 float alpha = x_axis.dot(y_axis);
278 float lambda = a_x*l_01;
291 float px = lambda+mu*alpha;
292 float py = lambda*alpha+mu;
294 vec3f Op = px*x_axis+py*y_axis;
◆ img_ndc_value()
bool tools::sg::tex_quadrilateral::img_ndc_value |
( |
float |
a_x, |
|
|
float |
a_y, |
|
|
std::string & |
a_s |
|
) |
| const |
|
inlineprotected |
Definition at line 190 of file tex_quadrilateral.
192 if(_img.is_empty()) {a_s.
clear();
return false;}
194 int ix = int(
float(_img.width())*a_x);
195 int iy = int(
float(_img.height())*a_y);
198 std::vector<unsigned char> pixel;
199 if((ix<0)||(iy<0)||!_img.pixel(ix,iy,pixel)) {a_s.clear();
return false;}
202 for(
unsigned int ipix=0;ipix<pixel.size();ipix++) {
204 if(!numas<float>(
float(pixel[ipix])/255.0f,a_s)){}
◆ intersect_value()
virtual bool tools::sg::tex_quadrilateral::intersect_value |
( |
std::ostream & |
, |
|
|
intersect_type |
, |
|
|
const line< vec3f > & |
a_line, |
|
|
std::string & |
a_s |
|
) |
| const |
|
inlinevirtual |
◆ line_2_img_ndc()
bool tools::sg::tex_quadrilateral::line_2_img_ndc |
( |
const line< vec3f > & |
a_line, |
|
|
float & |
a_x, |
|
|
float & |
a_y |
|
) |
| const |
|
inlineprotected |
Definition at line 248 of file tex_quadrilateral.
250 if(
corners.size()!=4) {a_x = 0;a_y = 0;
return false;}
254 if(!plane.intersect(a_line,p)) {a_x = 0;a_y = 0;
return false;}
◆ node_desc_fields()
virtual const desc_fields& tools::sg::tex_quadrilateral::node_desc_fields |
( |
| ) |
const |
|
inlinevirtual |
◆ operator=()
Definition at line 168 of file tex_quadrilateral.
169 parent::operator=(a_from);
172 if(&a_from==
this)
return *
this;
◆ pick()
virtual void tools::sg::tex_quadrilateral::pick |
( |
pick_action & |
a_action | ) |
|
|
inlinevirtual |
◆ point_2_img_ndc()
bool tools::sg::tex_quadrilateral::point_2_img_ndc |
( |
const vec3f & |
a_point, |
|
|
float & |
a_x, |
|
|
float & |
a_y |
|
) |
| const |
|
inlineprotected |
Definition at line 210 of file tex_quadrilateral.
213 if(
corners.size()!=4) {a_x = 0;a_y = 0;
return false;}
222 float l_01 = x_axis.normalize();
223 if(l_01==0.0f) {a_x = 0;a_y = 0;
return false;}
225 float l_03 = y_axis.normalize();
226 if(l_03==0.0f) {a_x = 0;a_y = 0;
return false;}
228 float alpha = x_axis.dot(y_axis);
229 float alpha_sq = alpha*alpha;
230 if(alpha_sq==1.0f) {a_x = 0;a_y = 0;
return false;}
234 float px = Op.dot(x_axis);
235 float py = Op.dot(y_axis);
237 float lambda = (px-alpha*py)/(1.0f-alpha_sq);
238 float mu = (py-alpha*px)/(1-alpha_sq);
◆ render()
virtual void tools::sg::tex_quadrilateral::render |
( |
render_action & |
a_action | ) |
|
|
inlinevirtual |
Reimplemented from tools::sg::node.
Definition at line 57 of file tex_quadrilateral.
72 const state& state = a_action.state();
82 a_action.color4f(1,0,0,1);
84 a_action.line_width(1);
89 a_action.set_polygon_offset(
true);
91 a_action.color4f(state.m_color);
92 a_action.line_width(state.m_line_width);
99 a_action.draw_vertex_normal_array(
gl::triangles(),18,tris,_nms);
100 a_action.color4f(state.m_color);}
107 a_action.draw_vertex_normal_array_texture(
gl::triangle_fan(),12,xyzs,nms,_id,tcs);
110 a_action.set_polygon_offset(state.m_GL_POLYGON_OFFSET_FILL);
◆ update_sg()
void tools::sg::tex_quadrilateral::update_sg |
( |
std::ostream & |
a_out | ) |
|
|
inlineprotected |
◆ corners
mf_vec<vec3f,float> tools::sg::tex_quadrilateral::corners |
◆ m_normal
vec3f tools::sg::tex_quadrilateral::m_normal |
|
protected |
◆ m_pick_bbox_check_image
bool tools::sg::tex_quadrilateral::m_pick_bbox_check_image |
|
protected |
◆ show_border
sf<bool> tools::sg::tex_quadrilateral::show_border |
The documentation for this class was generated from the following file: