|
static void | get_bounds (float a_height, const std::string &a_encoding, font_type a_font, const std::vector< std::string > &a_ss, float &a_mn_x, float &a_mn_y, float &a_mn_z, float &a_mx_x, float &a_mx_y, float &a_mx_z) |
|
static void | get_bounds (float a_height, const std::string &a_encoding, font_type a_font, const std::string &a_s, float &a_mn_x, float &a_mn_y, float &a_mn_z, float &a_mx_x, float &a_mx_y, float &a_mx_z) |
|
|
static float | _descent (float a_height) |
|
static bool | _truncate (const std::string &a_string, float a_height, font_type a_font, float a_cut_width, std::string &a_out) |
|
static void | get_char_bound (char a_char, font_type a_font, float a_scale, bool a_bar, float &a_mn_x, float &a_mn_y, float &a_mn_z, float &a_mx_x, float &a_mx_y, float &a_mx_z) |
|
static void | string_segs (bool aGEN_POINTS, const std::string &a_string, float a_height, const std::string &a_encoding, font_type a_font, float &aX, float &aY, std::vector< float > &a_segs, bool a_fill_segs) |
|
static float | char_segs (bool aGEN_POINTS, char a_char, font_type a_font, float a_scale, bool aBar, float aX, float aY, std::vector< float > &a_segs, bool a_fill_segs) |
|
static void | decode_plain (const std::string &a_s, sencoded &a_sed) |
|
static void | decode_PAW (const std::string &a_s, sencoded &a_sed) |
| PAW encoding //////////////////////////////////////////////////////////. More...
|
|
Definition at line 82 of file text_hershey.
◆ sencoded
◆ text_hershey() [1/2]
tools::sg::text_hershey::text_hershey |
( |
| ) |
|
|
inline |
◆ ~text_hershey()
virtual tools::sg::text_hershey::~text_hershey |
( |
| ) |
|
|
inlinevirtual |
◆ text_hershey() [2/2]
tools::sg::text_hershey::text_hershey |
( |
const text_hershey & |
a_from | ) |
|
|
inline |
◆ _descent()
static float tools::sg::text_hershey::_descent |
( |
float |
a_height | ) |
|
|
inlinestaticprotected |
Definition at line 336 of file text_hershey.
338 float mn_x,mn_y,mn_z;
339 float mx_x,mx_y,mx_z;
◆ _truncate()
static bool tools::sg::text_hershey::_truncate |
( |
const std::string & |
a_string, |
|
|
float |
a_height, |
|
|
font_type |
a_font, |
|
|
float |
a_cut_width, |
|
|
std::string & |
a_out |
|
) |
| |
|
inlinestaticprotected |
Definition at line 346 of file text_hershey.
356 const unsigned int mx_poly = 4;
357 const unsigned int mx_point = 160;
359 int max_point[mx_poly];
375 float advance = cwidth + a_height * 0.01F;
377 if((width+cwidth)>=a_cut_width)
return true;
◆ ascent()
virtual float tools::sg::text_hershey::ascent |
( |
float |
a_height | ) |
const |
|
inlinevirtual |
◆ bbox()
virtual void tools::sg::text_hershey::bbox |
( |
bbox_action & |
a_action | ) |
|
|
inlinevirtual |
◆ char_segs()
static float tools::sg::text_hershey::char_segs |
( |
bool |
aGEN_POINTS, |
|
|
char |
a_char, |
|
|
font_type |
a_font, |
|
|
float |
a_scale, |
|
|
bool |
aBar, |
|
|
float |
aX, |
|
|
float |
aY, |
|
|
std::vector< float > & |
a_segs, |
|
|
bool |
a_fill_segs |
|
) |
| |
|
inlinestaticprotected |
Definition at line 488 of file text_hershey.
499 const unsigned int mx_poly = 8;
500 const unsigned int mx_point = 160;
502 int max_point[mx_poly];
515 if(!aGEN_POINTS)
return width;
521 for (
int ipoly=0;ipoly<number;ipoly++) {
522 pointn = max_point[ipoly];
524 for(
int count=0;count<pointn-1;count++) {
525 ymax = mx<float>(ymax,yp[ipoint]);
527 a_segs.push_back(aX+xp[ipoint]);
528 a_segs.push_back(aY+yp[ipoint]);
530 ymax = mx<float>(ymax,yp[ipoint+1]);
532 a_segs.push_back(aX+xp[ipoint+1]);
533 a_segs.push_back(aY+yp[ipoint+1]);
543 float ybar = ymax * 1.3F;
546 a_segs.push_back(aX+xbar);
547 a_segs.push_back(aY+ybar);
549 a_segs.push_back(aX+xbar+width);
550 a_segs.push_back(aY+ybar);
◆ create_gsto()
virtual unsigned int tools::sg::text_hershey::create_gsto |
( |
std::ostream & |
, |
|
|
sg::render_manager & |
a_mgr |
|
) |
| |
|
inlineprotectedvirtual |
Reimplemented from tools::sg::gstos.
Definition at line 103 of file text_hershey.
104 std::vector<float> gsto_data;
106 {
size_t npts =
m_segs.size()/2;
107 size_t ngsto = npts*3;
108 size_t sz = gsto_data.size();
109 gsto_data.resize(sz+ngsto);
110 float* pxyz = vec_data<float>(gsto_data)+sz;
111 const float* data = vec_data<float>(
m_segs);
116 if(gsto_data.empty())
return 0;
118 return a_mgr.create_gsto_from_data(gsto_data);
◆ decode_PAW()
static void tools::sg::text_hershey::decode_PAW |
( |
const std::string & |
a_s, |
|
|
sencoded & |
a_sed |
|
) |
| |
|
inlinestaticprotected |
PAW encoding //////////////////////////////////////////////////////////.
Definition at line 586 of file text_hershey.
643 if(a_sed.size()) a_sed[a_sed.size()-1].m_cr =
true;
◆ decode_plain()
static void tools::sg::text_hershey::decode_plain |
( |
const std::string & |
a_s, |
|
|
sencoded & |
a_sed |
|
) |
| |
|
inlinestaticprotected |
Definition at line 559 of file text_hershey.
566 if(a_sed.size()) a_sed[a_sed.size()-1].m_cr =
true;
◆ descent()
virtual float tools::sg::text_hershey::descent |
( |
float |
a_height | ) |
const |
|
inlinevirtual |
◆ get_bounds() [1/3]
static void tools::sg::text_hershey::get_bounds |
( |
float |
a_height, |
|
|
const std::string & |
a_encoding, |
|
|
font_type |
a_font, |
|
|
const std::string & |
a_s, |
|
|
float & |
a_mn_x, |
|
|
float & |
a_mn_y, |
|
|
float & |
a_mn_z, |
|
|
float & |
a_mx_x, |
|
|
float & |
a_mx_y, |
|
|
float & |
a_mx_z |
|
) |
| |
|
inlinestatic |
Definition at line 259 of file text_hershey.
265 float HEIGHT = a_height;
266 float Y_ADVANCE = 2 * HEIGHT;
269 std::vector<float> dummy;
271 string_segs(
false,a_s,a_height,a_encoding,a_font,XL,Y,dummy,
false);
273 width = mx<float>(width,XL);
◆ get_bounds() [2/3]
static void tools::sg::text_hershey::get_bounds |
( |
float |
a_height, |
|
|
const std::string & |
a_encoding, |
|
|
font_type |
a_font, |
|
|
const std::vector< std::string > & |
a_ss, |
|
|
float & |
a_mn_x, |
|
|
float & |
a_mn_y, |
|
|
float & |
a_mn_z, |
|
|
float & |
a_mx_x, |
|
|
float & |
a_mx_y, |
|
|
float & |
a_mx_z |
|
) |
| |
|
inlinestatic |
Definition at line 229 of file text_hershey.
236 float HEIGHT = a_height;
237 float Y_ADVANCE = 2 * HEIGHT;
240 std::vector<float> dummy;
243 string_segs(
false,*it,a_height,a_encoding,a_font,XL,Y,dummy,
false);
245 width = mx<float>(width,XL);
249 a_mn_y = -Y_ADVANCE*(a_ss.size()-1)-
_descent(a_height);
◆ get_bounds() [3/3]
virtual void tools::sg::text_hershey::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 |
|
inlinevirtual |
◆ get_char_bound()
static void tools::sg::text_hershey::get_char_bound |
( |
char |
a_char, |
|
|
font_type |
a_font, |
|
|
float |
a_scale, |
|
|
bool |
a_bar, |
|
|
float & |
a_mn_x, |
|
|
float & |
a_mn_y, |
|
|
float & |
a_mn_z, |
|
|
float & |
a_mx_x, |
|
|
float & |
a_mx_y, |
|
|
float & |
a_mx_z |
|
) |
| |
|
inlinestaticprotected |
Definition at line 385 of file text_hershey.
392 const unsigned int mx_poly = 4;
393 const unsigned int mx_point = 160;
395 int max_point[mx_poly];
412 for (
int ipoly=0;ipoly<number;ipoly++) {
413 int pointn = max_point[ipoly];
415 for(
int count=0;count<pointn-1;count++) {
416 ymax = mx<float>(ymax,yp[ipoint]);
417 box_3f_extend_by(a_mn_x,a_mn_y,a_mn_z,a_mx_x,a_mx_y,a_mx_z,xp[ipoint],yp[ipoint],0);
419 ymax = mx<float>(ymax,yp[ipoint+1]);
420 box_3f_extend_by(a_mn_x,a_mn_y,a_mn_z,a_mx_x,a_mx_y,a_mx_z,xp[ipoint+1],yp[ipoint+1],0);
430 float ybar = ymax * 1.3F;
432 box_3f_extend_by(a_mn_x,a_mn_y,a_mn_z,a_mx_x,a_mx_y,a_mx_z,xbar+width,ybar,0);
◆ get_segments()
void tools::sg::text_hershey::get_segments |
( |
std::vector< float > & |
a_segs | ) |
const |
|
inlineprotected |
Definition at line 290 of file text_hershey.
295 float mn_x,mn_y,mn_z;
296 float mx_x,mx_y,mx_z;
298 float szy = mx_y - mn_y;
308 float Y_ADVANCE = 2 * HEIGHT;
318 float mn_x,mn_y,mn_z;
319 float mx_x,mx_y,mx_z;
321 mn_x,mn_y,mn_z,mx_x,mx_y,mx_z);
322 float szx = mx_x - mn_x;
◆ node_desc_fields()
virtual const desc_fields& tools::sg::text_hershey::node_desc_fields |
( |
| ) |
const |
|
inlinevirtual |
◆ operator=()
◆ pick()
virtual void tools::sg::text_hershey::pick |
( |
pick_action & |
a_action | ) |
|
|
inlinevirtual |
◆ render()
virtual void tools::sg::text_hershey::render |
( |
render_action & |
a_action | ) |
|
|
inlinevirtual |
◆ string_segs()
static void tools::sg::text_hershey::string_segs |
( |
bool |
aGEN_POINTS, |
|
|
const std::string & |
a_string, |
|
|
float |
a_height, |
|
|
const std::string & |
a_encoding, |
|
|
font_type |
a_font, |
|
|
float & |
aX, |
|
|
float & |
aY, |
|
|
std::vector< float > & |
a_segs, |
|
|
bool |
a_fill_segs |
|
) |
| |
|
inlinestaticprotected |
Definition at line 436 of file text_hershey.
448 float HEIGHT = a_height;
450 bool encod_PAW = (a_encoding==
encoding_PAW()?
true:
false);
457 const hchar& hc = *it;
461 hershey_font = hc.m_font;
463 hershey_font = a_font;
466 float scale = HEIGHT;
473 ymove = -HEIGHT*0.6F;
475 if(hc.m_back) aX = oldX;
480 float advance =
char_segs(aGEN_POINTS,hc.m_char,hershey_font,scale,hc.m_bar,aX,aY,a_segs,a_fill_segs) + HEIGHT * 0.01F;
◆ truncate()
virtual bool tools::sg::text_hershey::truncate |
( |
const std::string & |
a_string, |
|
|
float |
a_height, |
|
|
float |
a_cut_width, |
|
|
std::string & |
a_out |
|
) |
| const |
|
inlinevirtual |
◆ update_sg()
void tools::sg::text_hershey::update_sg |
( |
| ) |
|
|
inlineprotected |
◆ y_advance()
virtual float tools::sg::text_hershey::y_advance |
( |
float |
a_height | ) |
const |
|
inlinevirtual |
◆ encoding
◆ font
◆ m_gsto_sz
size_t tools::sg::text_hershey::m_gsto_sz |
|
protected |
◆ m_segs
std::vector<float> tools::sg::text_hershey::m_segs |
|
protected |
The documentation for this class was generated from the following file:
- /Users/barrand/private/dev/softinex/g4tools/g4tools/tools/sg/text_hershey
static void decode_PAW(const std::string &a_s, sencoded &a_sed)
PAW encoding //////////////////////////////////////////////////////////.
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
std::vector< hchar > sencoded
sf_enum< sg::hjust > hjust
std::vector< float > m_segs
static void string_segs(bool aGEN_POINTS, const std::string &a_string, float a_height, const std::string &a_encoding, font_type a_font, float &aX, float &aY, std::vector< float > &a_segs, bool a_fill_segs)
sf_enum< sg::vjust > vjust
static float _descent(float a_height)
static float char_segs(bool aGEN_POINTS, char a_char, font_type a_font, float a_scale, bool aBar, float aX, float aY, std::vector< float > &a_segs, bool a_fill_segs)
static void get_char_bound(char a_char, font_type a_font, float a_scale, bool a_bar, float &a_mn_x, float &a_mn_y, float &a_mn_z, float &a_mx_x, float &a_mx_y, float &a_mx_z)
#define TOOLS_FIELD_DESC_NODE_CLASS(a__class)
#define tools_sforcit(a__s, a__it)
sf_enum< font_type > font
#define tools_vforcit(a__T, a__v, a__it)
static bool _truncate(const std::string &a_string, float a_height, font_type a_font, float a_cut_width, std::string &a_out)
static void decode_plain(const std::string &a_s, sencoded &a_sed)
#define TOOLS_ARG_FIELD_DESC(a__field)
void get_segments(std::vector< float > &a_segs) const