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

Public Member Functions

virtual float near_height () const
 
virtual void zoom (float a_fac)
 
virtual camera_type type () const
 
virtual const desc_fieldsnode_desc_fields () const
 
 ortho ()
 
virtual ~ortho ()
 
 ortho (const ortho &a_from)
 
orthooperator= (const ortho &a_from)
 
bool operator== (const ortho &a_from) const
 
bool operator!= (const ortho &a_from) const
 
void dump (std::ostream &a_out)
 
- Public Member Functions inherited from tools::sg::base_camera
virtual void render (render_action &a_action)
 
virtual void pick (pick_action &a_action)
 
virtual void event (event_action &a_action)
 
virtual void get_matrix (get_matrix_action &a_action)
 
virtual void is_visible (visible_action &a_action)
 
virtual ~base_camera ()
 
void direction (vec3f &a_dir) const
 
void rotate_around_direction (float a_delta)
 
void rotate_around_z (float a_delta)
 
void rotate_around_up (float a_delta)
 
void rotate_around_x (float a_delta)
 
void rotate_around_x_at_focal (float a_delta)
 
void rotate_around_y_at_focal (float a_delta)
 
void rotate_around_z_at_focal (float a_delta)
 
void rotate_to_dir (const vec3f &a_dir)
 
void pane_to (float a_x, float a_y, float a_z)
 
void translate_along_side (float a_delta)
 
void translate_along_up (float a_delta)
 
void translate_along_dir (float a_delta)
 
bool look_at (const vec3f &a_dir, const vec3f &a_up)
 
void dump (std::ostream &a_out)
 
bool is_type_ortho () const
 
bool height_at_focal (float &a_h) const
 
void astro_orientation (float a_ra, float a_dec)
 
bool update_motion (int a_move)
 
- Public Member Functions inherited from tools::sg::node
virtual void * cast (const std::string &a_class) const
 
virtual const std::string & s_cls () const =0
 
virtual nodecopy () const =0
 
virtual unsigned int cls_version () const
 
virtual void bbox (bbox_action &)
 
virtual void search (search_action &a_action)
 
virtual bool write (write_action &a_action)
 
virtual bool read (read_action &a_action)
 
virtual void protocol_one_fields (std::vector< field * > &a_fields) const
 
virtual bool draw_in_frame_buffer () const
 
virtual bool touched ()
 
virtual void reset_touched ()
 
 node ()
 
virtual ~node ()
 
void touch ()
 
fieldfield_from_desc (const field_desc &a_desc) const
 
void dump_field_descs (std::ostream &a_out) const
 
fieldfind_field_by_name (const std::string &a_name) const
 

Public Attributes

sf< float > height
 
- Public Attributes inherited from tools::sg::base_camera
sf< float > znear
 
sf< float > zfar
 
sf_vec3f position
 
sf_rotf orientation
 
sf< float > dx
 
sf< float > da
 
sf< float > ds
 
sf< float > focal
 

Protected Member Functions

virtual void get_lrbt (unsigned int a_ww, unsigned int a_wh, float &a_l, float &a_r, float &a_b, float &a_t)
 
- Protected Member Functions inherited from tools::sg::base_camera
 base_camera ()
 
 base_camera (const base_camera &a_from)
 
base_cameraoperator= (const base_camera &a_from)
 
bool operator== (const base_camera &a_from) const
 
void update_sg (std::ostream &a_out)
 
void _mult_matrix (matrix_action &a_action)
 
void set_state (matrix_action &a_action)
 
- Protected Member Functions inherited from tools::sg::node
 node (const node &)
 
nodeoperator= (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
 
fieldfind_field (const field_desc &a_rdesc) const
 
void check_fields (std::ostream &a_out) const
 

Additional Inherited Members

- Static Protected Member Functions inherited from tools::sg::base_camera
static const vec4< float > & id_orientation ()
 
- Protected Attributes inherited from tools::sg::base_camera
sf_vec4f m_lrbt
 
mat4f m_proj
 
float m_tmp [16]
 

Detailed Description

Definition at line 12 of file ortho.

Constructor & Destructor Documentation

◆ ortho() [1/2]

tools::sg::ortho::ortho ( )
inline

Definition at line 38 of file ortho.

39  :parent()
40  ,height(2)
41  {
42 #ifdef TOOLS_MEM
43  mem::increment(s_class().c_str());
44 #endif
45  add_fields();
46  }

◆ ~ortho()

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

Definition at line 47 of file ortho.

47  {
48 #ifdef TOOLS_MEM
49  mem::decrement(s_class().c_str());
50 #endif
51  }

◆ ortho() [2/2]

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

Definition at line 53 of file ortho.

54  :parent(a_from)
55  ,height(a_from.height)
56  {
57 #ifdef TOOLS_MEM
58  mem::increment(s_class().c_str());
59 #endif
60  add_fields();
61  }

Member Function Documentation

◆ dump()

void tools::sg::ortho::dump ( std::ostream &  a_out)
inline

Definition at line 77 of file ortho.

77  {
78  parent::dump(a_out);
79  a_out << " height " << height.value() << std::endl;
80  }

◆ get_lrbt()

virtual void tools::sg::ortho::get_lrbt ( unsigned int  a_ww,
unsigned int  a_wh,
float &  a_l,
float &  a_r,
float &  a_b,
float &  a_t 
)
inlineprotectedvirtual

Implements tools::sg::base_camera.

Definition at line 82 of file ortho.

83  {
84  float aspect = float(a_ww)/float(a_wh);
85  //landscape : float aspect = float(a_action.wh())/float(a_action.ww());
86  float hh = height.value()*0.5f;
87  a_l = -aspect*hh;
88  a_r = aspect*hh;
89  a_b = -hh;
90  a_t = hh;
91  }

◆ near_height()

virtual float tools::sg::ortho::near_height ( ) const
inlinevirtual

Implements tools::sg::base_camera.

Definition at line 15 of file ortho.

15 {return height.value();}

◆ node_desc_fields()

virtual const desc_fields& tools::sg::ortho::node_desc_fields ( ) const
inlinevirtual

Reimplemented from tools::sg::base_camera.

Definition at line 26 of file ortho.

26  {
28  static const desc_fields s_v(parent::node_desc_fields(),1, //WARNING : take care of count.
30  );
31  return s_v;
32  }

◆ operator!=()

bool tools::sg::ortho::operator!= ( const ortho a_from) const
inline

Definition at line 73 of file ortho.

73  {
74  return !operator==(a_from);
75  }

◆ operator=()

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

Definition at line 62 of file ortho.

62  {
63  parent::operator=(a_from);
64  height = a_from.height;
65  return *this;
66  }

◆ operator==()

bool tools::sg::ortho::operator== ( const ortho a_from) const
inline

Definition at line 68 of file ortho.

68  {
69  if(!parent::operator==(a_from)) return false;
70  if(height!=a_from.height) return false;
71  return true;
72  }

◆ type()

virtual camera_type tools::sg::ortho::type ( ) const
inlinevirtual

Implements tools::sg::base_camera.

Definition at line 22 of file ortho.

22 {return camera_ortho;}

◆ zoom()

virtual void tools::sg::ortho::zoom ( float  a_fac)
inlinevirtual

Implements tools::sg::base_camera.

Definition at line 16 of file ortho.

16  {
17  //for exa :
18  // a_fac = 0.99f is a zoom in
19  // a_fac = 1.01f is a zoom out
20  height.value(height.value()*a_fac);
21  }

Member Data Documentation

◆ height

sf<float> tools::sg::ortho::height

Definition at line 24 of file ortho.


The documentation for this class was generated from the following file:
tools::sg::ortho::height
sf< float > height
Definition: ortho:24
tools::dump
void dump(std::ostream &a_out, const tools::array< T > &a_array, const std::string &a_title)
Definition: array:519
tools::sg::ortho
Definition: ortho:12
tools::sg::ortho::operator==
bool operator==(const ortho &a_from) const
Definition: ortho:68
tools::sg::camera_ortho
@ camera_ortho
Definition: enums:168
TOOLS_FIELD_DESC_NODE_CLASS
#define TOOLS_FIELD_DESC_NODE_CLASS(a__class)
Definition: field:68
tools::sg::bsf::value
T & value()
Definition: bsf:98
TOOLS_ARG_FIELD_DESC
#define TOOLS_ARG_FIELD_DESC(a__field)
Definition: field:71