g4tools  5.4.0
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
tools::sg::bbox_action Class Reference
Inheritance diagram for tools::sg::bbox_action:
Inheritance graph
[legend]
Collaboration diagram for tools::sg::bbox_action:
Collaboration graph
[legend]

Public Member Functions

 bbox_action (std::ostream &a_out)
 
virtual ~bbox_action ()
 
 bbox_action (const bbox_action &a_from)
 
bbox_actionoperator= (const bbox_action &a_from)
 
void reset ()
 
const box3fbox () const
 
box3fbox ()
 
- Public Member Functions inherited from tools::sg::matrix_action
 matrix_action (std::ostream &a_out, unsigned int a_ww, unsigned int a_wh)
 
virtual ~matrix_action ()
 
 matrix_action (const matrix_action &a_from)
 
matrix_actionoperator= (const matrix_action &a_from)
 
void push_matrices ()
 
void pop_matrices ()
 
mat4fprojection_matrix ()
 
mat4fmodel_matrix ()
 
bool end () const
 
int cur () const
 
bool project_point (float &a_x, float &a_y, float &a_z, float &a_w)
 
void model_point (float &a_x, float &a_y, float &a_z, float &a_w)
 
void projected_origin (float &a_x, float &a_y, float &a_z)
 
- Public Member Functions inherited from tools::sg::win_action
 win_action (std::ostream &a_out, unsigned int a_ww, unsigned int a_wh)
 
virtual ~win_action ()
 
unsigned int ww () const
 
unsigned int wh () const
 
- Public Member Functions inherited from tools::sg::action
virtual void * cast (const std::string &a_class) const
 
virtual const std::string & s_cls () const =0
 
 action (std::ostream &a_out)
 
virtual ~action ()
 
std::ostream & out () const
 
- Public Member Functions inherited from tools::sg::states
 states (unsigned int a_ww, unsigned int a_wh)
 
virtual ~states ()
 
const sg::statestate () const
 
sg::statestate ()
 
void pop_state ()
 
void push_state ()
 
void save_state (const sg::state &a_state)
 
const sg::statesaved_state () const
 
sg::statesaved_state ()
 
- Public Member Functions inherited from tools::sg::primitive_visitor
 primitive_visitor ()
 
virtual ~primitive_visitor ()
 
 primitive_visitor (const primitive_visitor &)
 
primitive_visitoroperator= (const primitive_visitor &)
 
void add_one_point (float a_x, float a_y, float a_z)
 
void add_one_point (float a_x, float a_y, float a_z, float a_r, float a_g, float a_b, float a_a)
 
bool add_triangle_fan (size_t a_floatn, const float *a_xyzs, bool a_stop=false)
 
bool add_triangle_fan_normal (size_t a_floatn, const float *a_xyzs, const float *a_nms, bool a_stop=false)
 
bool add_triangle_fan_normal_rgba (size_t a_floatn, const float *a_xyzs, const float *a_nms, const float *a_rgbas, bool a_stop=false)
 
bool add_triangle_strip (size_t a_floatn, const float *a_xyzs, bool a_stop=false)
 
bool add_triangles (size_t a_floatn, const float *a_xyzs, bool a_stop=false)
 
bool add_triangle_strip_normal (size_t a_floatn, const float *a_xyzs, const float *a_nms, bool a_stop=false)
 
bool add_triangle_strip_normal_rgba (size_t a_floatn, const float *a_xyzs, const float *a_nms, const float *a_rgbas, bool a_stop=false)
 
bool add_triangles_normal (size_t a_floatn, const float *a_xyzs, const float *a_nms, bool a_stop=false)
 
bool add_triangles_rgba (size_t a_floatn, const float *a_xyzs, const float *a_rgbas, bool a_stop=false)
 
bool add_triangles_normal_rgba (size_t a_floatn, const float *a_xyzs, const float *a_nms, const float *a_rgbas, bool a_stop=false)
 
bool add_line_strip (size_t a_floatn, const float *a_xyzs, bool a_stop=false)
 
bool add_line_strip_rgba (size_t a_floatn, const float *a_xyzs, const float *a_rgbas, bool a_stop=false)
 
bool add_line_strip_normal (size_t a_floatn, const float *a_xyzs, const float *a_nms, bool a_stop=false)
 
bool add_line_strip_normal_rgba (size_t a_floatn, const float *a_xyzs, const float *a_nms, const float *a_rgbas, bool a_stop=false)
 
bool add_line_loop (size_t a_floatn, const float *a_xyzs, bool a_stop=false)
 
bool add_line_loop_rgba (size_t a_floatn, const float *a_xyzs, const float *a_rgbas, bool a_stop=false)
 
bool add_line_loop_normal (size_t a_floatn, const float *a_xyzs, const float *a_nms, bool a_stop=false)
 
bool add_line_loop_normal_rgba (size_t a_floatn, const float *a_xyzs, const float *a_nms, const float *a_rgbas, bool a_stop=false)
 
bool add_lines (size_t a_floatn, const float *a_xyzs, bool a_stop=false)
 
bool add_lines_rgba (size_t a_floatn, const float *a_xyzs, const float *a_rgbas, bool a_stop=false)
 
bool add_lines_normal (size_t a_floatn, const float *a_xyzs, const float *a_nms, bool a_stop=false)
 
bool add_lines_normal_rgba (size_t a_floatn, const float *a_xyzs, const float *a_nms, const float *a_rgbas, bool a_stop=false)
 
bool add_points (size_t a_floatn, const float *a_xyzs, bool a_stop=false)
 
bool add_points_rgba (size_t a_floatn, const float *a_xyzs, const float *a_rgbas, bool a_stop=false)
 
bool add_points_normal (size_t a_floatn, const float *a_xyzs, const float *a_nms, bool a_stop=false)
 
bool add_points_normal_rgba (size_t a_floatn, const float *a_xyzs, const float *a_nms, const float *a_rgbas, bool a_stop=false)
 
bool add_primitive (gl::mode_t a_mode, size_t a_floatn, const float *a_xyzs, bool a_stop=false)
 
bool add_primitive_rgba (gl::mode_t a_mode, size_t a_floatn, const float *a_xyzs, const float *a_rgbas, bool a_stop=false)
 
bool add_primitive_normal (gl::mode_t a_mode, size_t a_floatn, const float *a_xyzs, const float *a_nms, bool a_stop=false)
 
bool add_primitive_normal_rgba (gl::mode_t a_mode, size_t a_floatn, const float *a_xyzs, const float *a_nms, const float *a_rgbas, bool a_stop=false)
 
bool add_points_xy (size_t a_floatn, const float *a_xys, bool a_stop=false)
 points with x,y only /////////////////////////////// More...
 
bool add_triangle_fan_xy (size_t a_floatn, const float *a_xys, bool a_stop=false, bool a_triangle_revert=false)
 
bool add_triangle_strip_xy (size_t a_floatn, const float *a_xys, bool a_stop=false, bool a_triangle_revert=false)
 
bool add_triangles_xy (size_t a_floatn, const float *a_xys, bool a_stop=false, bool a_triangle_revert=false)
 
bool add_line_loop_xy (size_t a_floatn, const float *a_xys, bool a_stop=false)
 
bool add_line_strip_xy (size_t a_floatn, const float *a_xys, bool a_stop=false)
 
bool add_lines_xy (size_t a_floatn, const float *a_xys, bool a_stop=false)
 
bool add_primitive_xy (gl::mode_t a_mode, size_t a_floatn, const float *a_xys, bool a_stop=false, bool a_triangle_revert=false)
 
bool add_primitive (gl::mode_t a_mode, const std::vector< float > &a_xyzs, bool a_stop=false)
 
bool add_primitive_xy (gl::mode_t a_mode, const std::vector< float > &a_xys, bool a_stop=false, bool a_triangle_revert=false)
 
bool add_line_strip (const std::vector< float > &a_xyzs, bool a_stop=false)
 
bool add_line_loop (const std::vector< float > &a_xyzs, bool a_stop=false)
 
bool add_lines (const std::vector< float > &a_xyzs, bool a_stop=false)
 
bool add_points (const std::vector< float > &a_xyzs, bool a_stop=false)
 
bool add_triangle_strip (const std::vector< float > &a_xyzs, bool a_stop=false)
 
bool add_points_xy (const std::vector< float > &a_xys, bool a_stop=false)
 
bool add_lines_xy (const std::vector< float > &a_xys, bool a_stop=false)
 
bool add_triangle_strip_xy (const std::vector< float > &a_xys, bool a_stop=false)
 
bool add_triangle_fan_texture_normal (size_t a_floatn, const float *a_xyzs, const float *a_nms, unsigned int, const float *)
 
bool add_triangle_strip_texture_normal (size_t a_floatn, const float *a_xyzs, const float *a_nms, unsigned int, const float *)
 
bool add_triangle_strip_as_triangles (size_t a_floatn, const float *a_xyzs, const float *a_nms)
 
void add_texture (std::ostream &a_out, size_t a_xyzn, const float *a_xyzs, const img_byte &a_img, const float *a_tcs)
 

Protected Member Functions

virtual bool project (float &a_x, float &a_y, float &a_z, float &a_w)
 
virtual bool add_point (float a_x, float a_y, float a_z, float)
 
virtual bool add_point (float a_x, float a_y, float a_z, float, float, float, float, float)
 
virtual bool add_line (float a_bx, float a_by, float a_bz, float, float a_ex, float a_ey, float a_ez, float)
 
virtual bool add_line (float a_bx, float a_by, float a_bz, float a_bw, float, float, float, float, float a_ex, float a_ey, float a_ez, float a_ew, float, float, float, float)
 
virtual bool add_triangle (float a_p1x, float a_p1y, float a_p1z, float, float a_p2x, float a_p2y, float a_p2z, float, float a_p3x, float a_p3y, float a_p3z, float)
 
virtual bool add_triangle (float a_p1x, float a_p1y, float a_p1z, float a_p1w, float, float, float, float, float a_p2x, float a_p2y, float a_p2z, float a_p2w, float, float, float, float, float a_p3x, float a_p3y, float a_p3z, float a_p3w, float, float, float, float)
 
virtual bool project_normal (float &, float &, float &)
 
virtual bool add_point_normal (float a_x, float a_y, float a_z, float a_w, float, float, float)
 
virtual bool add_point_normal (float a_x, float a_y, float a_z, float a_w, float, float, float, float, float, float, float)
 
virtual bool add_line_normal (float a_bx, float a_by, float a_bz, float a_bw, float, float, float, float a_ex, float a_ey, float a_ez, float a_ew, float, float, float)
 
virtual bool add_line_normal (float a_bx, float a_by, float a_bz, float a_bw, float, float, float, float, float, float, float, float a_ex, float a_ey, float a_ez, float a_ew, float, float, float, float, float, float, float)
 
virtual bool add_triangle_normal (float a_p1x, float a_p1y, float a_p1z, float a_p1w, float, float, float, float a_p2x, float a_p2y, float a_p2z, float a_p2w, float, float, float, float a_p3x, float a_p3y, float a_p3z, float a_p3w, float, float, float)
 
virtual bool add_triangle_normal (float a_p1x, float a_p1y, float a_p1z, float a_p1w, float, float, float, float, float, float, float, float a_p2x, float a_p2y, float a_p2z, float a_p2w, float, float, float, float, float, float, float, float a_p3x, float a_p3y, float a_p3z, float a_p3w, float, float, float, float, float, float, float)
 
- Protected Member Functions inherited from tools::sg::matrix_action
void reset ()
 
- Protected Member Functions inherited from tools::sg::win_action
 win_action (const win_action &a_from)
 
win_actionoperator= (const win_action &a_from)
 
- Protected Member Functions inherited from tools::sg::action
 action (const action &a_from)
 
actionoperator= (const action &)
 
- Protected Member Functions inherited from tools::sg::states
 states (const states &a_from)
 
statesoperator= (const states &a_from)
 

Protected Attributes

box3f m_box
 
- Protected Attributes inherited from tools::sg::matrix_action
std::vector< mat4fm_projs
 
std::vector< mat4fm_models
 
int m_cur
 
mat4f m_identity
 
- Protected Attributes inherited from tools::sg::win_action
unsigned int m_ww
 
unsigned int m_wh
 
- Protected Attributes inherited from tools::sg::action
std::ostream & m_out
 
- Protected Attributes inherited from tools::sg::states
std::vector< sg::statem_states
 
sg::state m_state
 
sg::state m_saved_state
 
- Protected Attributes inherited from tools::sg::primitive_visitor
gl::mode_t m_mode
 

Detailed Description

Definition at line 15 of file bbox_action.

Constructor & Destructor Documentation

◆ bbox_action() [1/2]

tools::sg::bbox_action::bbox_action ( std::ostream &  a_out)
inline

Definition at line 108 of file bbox_action.

109  :parent(a_out,0,0)
110  {}

◆ ~bbox_action()

virtual tools::sg::bbox_action::~bbox_action ( )
inlinevirtual

Definition at line 111 of file bbox_action.

111 {}

◆ bbox_action() [2/2]

tools::sg::bbox_action::bbox_action ( const bbox_action a_from)
inline

Definition at line 113 of file bbox_action.

114  :parent(a_from)
115  ,primitive_visitor(a_from)
116  {}

Member Function Documentation

◆ add_line() [1/2]

virtual bool tools::sg::bbox_action::add_line ( float  a_bx,
float  a_by,
float  a_bz,
float  a_bw,
float  ,
float  ,
float  ,
float  ,
float  a_ex,
float  a_ey,
float  a_ez,
float  a_ew,
float  ,
float  ,
float  ,
float   
)
inlineprotectedvirtual

Implements tools::sg::primitive_visitor.

Definition at line 41 of file bbox_action.

44  {
45  return add_line(a_bx,a_by,a_bz,a_bw,
46  a_ex,a_ey,a_ez,a_ew);
47  }

◆ add_line() [2/2]

virtual bool tools::sg::bbox_action::add_line ( float  a_bx,
float  a_by,
float  a_bz,
float  ,
float  a_ex,
float  a_ey,
float  a_ez,
float   
)
inlineprotectedvirtual

Implements tools::sg::primitive_visitor.

Definition at line 34 of file bbox_action.

35  {
36  m_box.extend_by(a_bx,a_by,a_bz);
37  m_box.extend_by(a_ex,a_ey,a_ez);
38  return true;
39  }

◆ add_line_normal() [1/2]

virtual bool tools::sg::bbox_action::add_line_normal ( float  a_bx,
float  a_by,
float  a_bz,
float  a_bw,
float  ,
float  ,
float  ,
float  a_ex,
float  a_ey,
float  a_ez,
float  a_ew,
float  ,
float  ,
float   
)
inlineprotectedvirtual

Implements tools::sg::primitive_visitor.

Definition at line 81 of file bbox_action.

82  {
83  return bbox_action::add_line(a_bx,a_by,a_bz,a_bw,a_ex,a_ey,a_ez,a_ew);
84  }

◆ add_line_normal() [2/2]

virtual bool tools::sg::bbox_action::add_line_normal ( float  a_bx,
float  a_by,
float  a_bz,
float  a_bw,
float  ,
float  ,
float  ,
float  ,
float  ,
float  ,
float  ,
float  a_ex,
float  a_ey,
float  a_ez,
float  a_ew,
float  ,
float  ,
float  ,
float  ,
float  ,
float  ,
float   
)
inlineprotectedvirtual

Implements tools::sg::primitive_visitor.

Definition at line 85 of file bbox_action.

86  {
87  return bbox_action::add_line(a_bx,a_by,a_bz,a_bw,a_ex,a_ey,a_ez,a_ew);
88  }

◆ add_point() [1/2]

virtual bool tools::sg::bbox_action::add_point ( float  a_x,
float  a_y,
float  a_z,
float   
)
inlineprotectedvirtual

Implements tools::sg::primitive_visitor.

Definition at line 23 of file bbox_action.

23  {
24  m_box.extend_by(a_x,a_y,a_z);
25  return true;
26  }

◆ add_point() [2/2]

virtual bool tools::sg::bbox_action::add_point ( float  a_x,
float  a_y,
float  a_z,
float  ,
float  ,
float  ,
float  ,
float   
)
inlineprotectedvirtual

Implements tools::sg::primitive_visitor.

Definition at line 28 of file bbox_action.

29  {
30  m_box.extend_by(a_x,a_y,a_z);
31  return true;
32  }

◆ add_point_normal() [1/2]

virtual bool tools::sg::bbox_action::add_point_normal ( float  a_x,
float  a_y,
float  a_z,
float  a_w,
float  ,
float  ,
float   
)
inlineprotectedvirtual

Implements tools::sg::primitive_visitor.

Definition at line 70 of file bbox_action.

71  {
72  return bbox_action::add_point(a_x,a_y,a_z,a_w);
73  }

◆ add_point_normal() [2/2]

virtual bool tools::sg::bbox_action::add_point_normal ( float  a_x,
float  a_y,
float  a_z,
float  a_w,
float  ,
float  ,
float  ,
float  ,
float  ,
float  ,
float   
)
inlineprotectedvirtual

Implements tools::sg::primitive_visitor.

Definition at line 75 of file bbox_action.

77  {
78  return bbox_action::add_point(a_x,a_y,a_z,a_w);
79  }

◆ add_triangle() [1/2]

virtual bool tools::sg::bbox_action::add_triangle ( float  a_p1x,
float  a_p1y,
float  a_p1z,
float  a_p1w,
float  ,
float  ,
float  ,
float  ,
float  a_p2x,
float  a_p2y,
float  a_p2z,
float  a_p2w,
float  ,
float  ,
float  ,
float  ,
float  a_p3x,
float  a_p3y,
float  a_p3z,
float  a_p3w,
float  ,
float  ,
float  ,
float   
)
inlineprotectedvirtual

Implements tools::sg::primitive_visitor.

Definition at line 58 of file bbox_action.

63  {
64  return bbox_action::add_triangle(a_p1x,a_p1y,a_p1z,a_p1w,
65  a_p2x,a_p2y,a_p2z,a_p2w,
66  a_p3x,a_p3y,a_p3z,a_p3w);
67  }

◆ add_triangle() [2/2]

virtual bool tools::sg::bbox_action::add_triangle ( float  a_p1x,
float  a_p1y,
float  a_p1z,
float  ,
float  a_p2x,
float  a_p2y,
float  a_p2z,
float  ,
float  a_p3x,
float  a_p3y,
float  a_p3z,
float   
)
inlineprotectedvirtual

Implements tools::sg::primitive_visitor.

Definition at line 49 of file bbox_action.

51  {
52  m_box.extend_by(a_p1x,a_p1y,a_p1z);
53  m_box.extend_by(a_p2x,a_p2y,a_p2z);
54  m_box.extend_by(a_p3x,a_p3y,a_p3z);
55  return true;
56  }

◆ add_triangle_normal() [1/2]

virtual bool tools::sg::bbox_action::add_triangle_normal ( float  a_p1x,
float  a_p1y,
float  a_p1z,
float  a_p1w,
float  ,
float  ,
float  ,
float  a_p2x,
float  a_p2y,
float  a_p2z,
float  a_p2w,
float  ,
float  ,
float  ,
float  a_p3x,
float  a_p3y,
float  a_p3z,
float  a_p3w,
float  ,
float  ,
float   
)
inlineprotectedvirtual

Implements tools::sg::primitive_visitor.

Definition at line 90 of file bbox_action.

92  {
93  return bbox_action::add_triangle(a_p1x,a_p1y,a_p1z,a_p1w,
94  a_p2x,a_p2y,a_p2z,a_p2w,
95  a_p3x,a_p3y,a_p3z,a_p3w);
96  }

◆ add_triangle_normal() [2/2]

virtual bool tools::sg::bbox_action::add_triangle_normal ( float  a_p1x,
float  a_p1y,
float  a_p1z,
float  a_p1w,
float  ,
float  ,
float  ,
float  ,
float  ,
float  ,
float  ,
float  a_p2x,
float  a_p2y,
float  a_p2z,
float  a_p2w,
float  ,
float  ,
float  ,
float  ,
float  ,
float  ,
float  ,
float  a_p3x,
float  a_p3y,
float  a_p3z,
float  a_p3w,
float  ,
float  ,
float  ,
float  ,
float  ,
float  ,
float   
)
inlineprotectedvirtual

Implements tools::sg::primitive_visitor.

Definition at line 97 of file bbox_action.

102  {
103  return bbox_action::add_triangle(a_p1x,a_p1y,a_p1z,a_p1w,
104  a_p2x,a_p2y,a_p2z,a_p2w,
105  a_p3x,a_p3y,a_p3z,a_p3w);
106  }

◆ box() [1/2]

box3f& tools::sg::bbox_action::box ( )
inline

Definition at line 130 of file bbox_action.

130 {return m_box;}

◆ box() [2/2]

const box3f& tools::sg::bbox_action::box ( ) const
inline

Definition at line 129 of file bbox_action.

129 {return m_box;}

◆ operator=()

bbox_action& tools::sg::bbox_action::operator= ( const bbox_action a_from)
inline

Definition at line 117 of file bbox_action.

117  {
118  if(&a_from==this) return *this;
119  parent::operator=(a_from);
121  m_box.make_empty();
122  return *this;
123  }

◆ project()

virtual bool tools::sg::bbox_action::project ( float &  a_x,
float &  a_y,
float &  a_z,
float &  a_w 
)
inlineprotectedvirtual

Implements tools::sg::primitive_visitor.

Definition at line 18 of file bbox_action.

18  {
19  model_point(a_x,a_y,a_z,a_w);
20  return true;
21  }

◆ project_normal()

virtual bool tools::sg::bbox_action::project_normal ( float &  ,
float &  ,
float &   
)
inlineprotectedvirtual

Implements tools::sg::primitive_visitor.

Definition at line 69 of file bbox_action.

69 {return true;}

◆ reset()

void tools::sg::bbox_action::reset ( )
inline

Definition at line 125 of file bbox_action.

125  {
126  parent::reset();
127  m_box.make_empty();
128  }

Member Data Documentation

◆ m_box

box3f tools::sg::bbox_action::m_box
protected

Definition at line 132 of file bbox_action.


The documentation for this class was generated from the following file:
tools::sg::matrix_action::model_point
void model_point(float &a_x, float &a_y, float &a_z, float &a_w)
Definition: matrix_action:95
tools::box3f::make_empty
void make_empty()
Definition: box3f:26
tools::sg::bbox_action::add_line
virtual bool add_line(float a_bx, float a_by, float a_bz, float, float a_ex, float a_ey, float a_ez, float)
Definition: bbox_action:34
tools::box3::extend_by
void extend_by(const VEC3 &a_point)
Definition: box3:94
tools::sg::primitive_visitor::operator=
primitive_visitor & operator=(const primitive_visitor &)
Definition: primitive_visitor:61
tools::sg::bbox_action::m_box
box3f m_box
Definition: bbox_action:132
tools::sg::bbox_action::add_point
virtual bool add_point(float a_x, float a_y, float a_z, float)
Definition: bbox_action:23
tools::sg::bbox_action::add_triangle
virtual bool add_triangle(float a_p1x, float a_p1y, float a_p1z, float, float a_p2x, float a_p2y, float a_p2z, float, float a_p3x, float a_p3y, float a_p3z, float)
Definition: bbox_action:49
tools::sg::primitive_visitor::primitive_visitor
primitive_visitor()
Definition: primitive_visitor:57