Back to home page

EIC code displayed by LXR

 
 

    


Warning, /include/Geant4/tools/sg/dummy_freetype is written in an unsupported language. File is not indexed.

0001 // Copyright (C) 2010, Guy Barrand. All rights reserved.
0002 // See the file tools.license for terms.
0003 
0004 #ifndef tools_sg_dummy_freetype
0005 #define tools_sg_dummy_freetype
0006 
0007 #include "base_freetype"
0008 #include "render_action"
0009 #include "bbox_action"
0010 #include "pick_action"
0011 
0012 namespace tools {
0013 namespace sg {
0014 
0015 class dummy_freetype : public base_freetype {
0016 public:
0017   TOOLS_NODE(dummy_freetype,tools::sg::dummy_freetype,base_freetype)
0018 protected: //gstos
0019   virtual unsigned int create_gsto(std::ostream& a_out,render_manager&) {
0020     a_out << "tools::sg::dummy_freetype::create_gsto : dummy" << std::endl;
0021     return 0;
0022   }
0023 public:
0024   virtual void render(render_action& a_action) {
0025     a_action.out() << "tools::sg::dummy_freetype::render : dummy" << std::endl;
0026     if(touched()) {
0027       update_sg(a_action.out());
0028       reset_touched();
0029     }
0030   }
0031   virtual void pick(pick_action& a_action) {
0032     a_action.out() << "tools::sg::dummy_freetype::pick : dummy" << std::endl;
0033     if(touched()) {
0034       update_sg(a_action.out());
0035       reset_touched();
0036     }
0037   }
0038 
0039   virtual void bbox(bbox_action& a_action) {
0040     a_action.out() << "tools::sg::dummy_freetype::bbox : dummy" << std::endl;
0041     if(touched()) {
0042       update_sg(a_action.out());
0043       reset_touched();
0044     }
0045   }
0046 
0047 public:
0048   dummy_freetype():base_freetype() {}
0049   virtual ~dummy_freetype(){}
0050 public:
0051   dummy_freetype(const dummy_freetype& a_from):base_freetype(a_from) {}
0052 
0053   dummy_freetype& operator=(const dummy_freetype& a_from){
0054     base_freetype::operator=(a_from);
0055     return *this;
0056   }
0057 
0058 public: //base_text :
0059   virtual float ascent(float) const {return 0;}
0060   virtual float descent(float) const {return 0;}
0061   virtual float y_advance(float) const {return 0;}
0062 
0063   virtual void get_bounds(float a_height,
0064                           float& a_mn_x,float& a_mn_y,float& a_mn_z,
0065                           float& a_mx_x,float& a_mx_y,float& a_mx_z) const {
0066     (void)a_height;
0067     a_mn_x = 0;
0068     a_mn_y = 0;
0069     a_mn_z = 0;
0070     a_mx_x = 0;
0071     a_mx_y = 0;
0072     a_mx_z = 0;
0073   }
0074 
0075   virtual bool truncate(const std::string&,
0076                         float,float,
0077                         std::string& a_out) const {
0078     a_out.clear();
0079     return false;
0080   }
0081 protected:
0082   void update_sg(std::ostream&) {}
0083 };
0084 
0085 }}
0086 
0087 #endif