g4tools  5.4.0
dummy_freetype
Go to the documentation of this file.
1 // Copyright (C) 2010, Guy Barrand. All rights reserved.
2 // See the file tools.license for terms.
3 
4 #ifndef tools_sg_dummy_freetype
5 #define tools_sg_dummy_freetype
6 
7 #include "base_freetype"
8 #include "render_action"
9 #include "bbox_action"
10 #include "pick_action"
11 
12 namespace tools {
13 namespace sg {
14 
15 class dummy_freetype : public base_freetype {
16 public:
18 protected: //gstos
19  virtual unsigned int create_gsto(std::ostream& a_out,render_manager&) {
20  a_out << "tools::sg::dummy_freetype::create_gsto : dummy" << std::endl;
21  return 0;
22  }
23 public:
24  virtual void render(render_action& a_action) {
25  a_action.out() << "tools::sg::dummy_freetype::render : dummy" << std::endl;
26  if(touched()) {
27  update_sg(a_action.out());
28  reset_touched();
29  }
30  }
31  virtual void pick(pick_action& a_action) {
32  a_action.out() << "tools::sg::dummy_freetype::pick : dummy" << std::endl;
33  if(touched()) {
34  update_sg(a_action.out());
35  reset_touched();
36  }
37  }
38 
39  virtual void bbox(bbox_action& a_action) {
40  a_action.out() << "tools::sg::dummy_freetype::bbox : dummy" << std::endl;
41  if(touched()) {
42  update_sg(a_action.out());
43  reset_touched();
44  }
45  }
46 
47 public:
49  virtual ~dummy_freetype(){}
50 public:
51  dummy_freetype(const dummy_freetype& a_from):base_freetype(a_from) {}
52 
55  return *this;
56  }
57 
58 public: //base_text :
59  virtual float ascent(float) const {return 0;}
60  virtual float descent(float) const {return 0;}
61  virtual float y_advance(float) const {return 0;}
62 
63  virtual void get_bounds(float a_height,
64  float& a_mn_x,float& a_mn_y,float& a_mn_z,
65  float& a_mx_x,float& a_mx_y,float& a_mx_z) const {
66  (void)a_height;
67  a_mn_x = 0;
68  a_mn_y = 0;
69  a_mn_z = 0;
70  a_mx_x = 0;
71  a_mx_y = 0;
72  a_mx_z = 0;
73  }
74 
75  virtual bool truncate(const std::string&,
76  float,float,
77  std::string& a_out) const {
78  a_out.clear();
79  return false;
80  }
81 protected:
82  void update_sg(std::ostream&) {}
83 };
84 
85 }}
86 
87 #endif
tools::sg::dummy_freetype::create_gsto
virtual unsigned int create_gsto(std::ostream &a_out, render_manager &)
Definition: dummy_freetype:19
tools::sg::dummy_freetype::bbox
virtual void bbox(bbox_action &a_action)
Definition: dummy_freetype:39
pick_action
tools::sg::dummy_freetype::dummy_freetype
dummy_freetype(const dummy_freetype &a_from)
Definition: dummy_freetype:51
tools::sg::dummy_freetype::render
virtual void render(render_action &a_action)
Definition: dummy_freetype:24
render_action
tools::sg::dummy_freetype::get_bounds
virtual void get_bounds(float a_height, float &a_mn_x, float &a_mn_y, float &a_mn_z, float &a_mx_x, float &a_mx_y, float &a_mx_z) const
Definition: dummy_freetype:63
tools::sg::bbox_action
Definition: bbox_action:15
TOOLS_NODE
#define TOOLS_NODE(a__class, a__sclass, a__parent)
Definition: node:324
tools::sg::dummy_freetype
Definition: dummy_freetype:15
tools::sg::base_freetype
Definition: base_freetype:16
tools::sg::base_freetype::operator=
base_freetype & operator=(const base_freetype &a_from)
Definition: base_freetype:80
tools::sg::dummy_freetype::ascent
virtual float ascent(float) const
Definition: dummy_freetype:59
tools::sg::dummy_freetype::update_sg
void update_sg(std::ostream &)
Definition: dummy_freetype:82
tools::sg::pick_action
Definition: pick_action:59
tools::sg::render_manager
Definition: render_manager:16
base_freetype
tools::sg::render_action
Definition: render_action:24
tools::sg::dummy_freetype::operator=
dummy_freetype & operator=(const dummy_freetype &a_from)
Definition: dummy_freetype:53
tools
inlined C code : ///////////////////////////////////
Definition: aida_ntuple:26
tools::sg::dummy_freetype::~dummy_freetype
virtual ~dummy_freetype()
Definition: dummy_freetype:49
tools::sg::dummy_freetype::dummy_freetype
dummy_freetype()
Definition: dummy_freetype:48
tools::sg::dummy_freetype::y_advance
virtual float y_advance(float) const
Definition: dummy_freetype:61
tools::sg::dummy_freetype::pick
virtual void pick(pick_action &a_action)
Definition: dummy_freetype:31
tools::sg::action::out
std::ostream & out() const
Definition: action:51
tools::sg::dummy_freetype::descent
virtual float descent(float) const
Definition: dummy_freetype:60
tools::sg::dummy_freetype::truncate
virtual bool truncate(const std::string &, float, float, std::string &a_out) const
Definition: dummy_freetype:75
tools::sg::node::touched
virtual bool touched()
Definition: node:96
tools::sg::node::reset_touched
virtual void reset_touched()
Definition: node:102
bbox_action