#include <textNode.h>
Inheritance diagram for TextNode:
Public Member Functions | |
INLINE void | set_wtext (const wstring &wtext) |
INLINE void | append_wtext (const wstring &text) |
INLINE float | calc_width (const wstring &line) const |
INLINE wstring | wordwrap_to (const wstring &wtext, float wordwrap_width, bool preserve_trailing_whitespace) const |
virtual int | get_unsafe_to_apply_attribs () const |
virtual void | apply_attribs_to_vertices (const AccumulatedAttribs &attribs, int attrib_types, GeomTransformer &transformer) |
virtual | CPT (TransformState) calc_tight_bounds(LPoint3f &min_point |
virtual bool | has_cull_callback () const |
virtual bool | cull_callback (CullTraverser *trav, CullTraverserData &data) |
virtual BoundingVolume * | recompute_internal_bound () |
virtual TypeHandle | get_type () const |
virtual TypeHandle | force_init_type () |
Static Public Member Functions | |
TypeHandle | get_class_type () |
void | init_type () |
Public Attributes | |
virtual LPoint3f & | max_point |
virtual LPoint3f bool & | found_any |
virtual LPoint3f bool const TransformState *transform | const |
Private Types | |
enum | Alignment { A_left, A_right, A_center } |
enum | CheesyPlacement { CP_above, CP_below, CP_top, CP_bottom, CP_within } |
enum | CheesyTransform { CT_none, CT_mirror_x, CT_mirror_y, CT_rotate_90, CT_rotate_180, CT_rotate_270, CT_squash, CT_squash_mirror_y, CT_squash_mirror_diag, CT_small_squash, CT_small_squash_mirror_y, CT_small, CT_small_rotate_270, CT_tiny, CT_tiny_mirror_x, CT_tiny_rotate_270 } |
enum | Flags { F_has_text_color = 0x00000001, F_has_wordwrap = 0x00000002, F_has_frame = 0x00000004, F_frame_as_margin = 0x00000008, F_has_card = 0x00000010, F_card_as_margin = 0x00000020, F_has_card_texture = 0x00000040, F_has_shadow = 0x00000080, F_frame_corners = 0x00000100, F_card_transp = 0x00000200, F_has_card_border = 0x00000400, F_needs_rebuild = 0x00004000, F_needs_measure = 0x00008000, F_small_caps = 0x00010000 } |
Private Member Functions | |
~TextNode () | |
INLINE int | freeze () |
INLINE int | thaw () |
INLINE void | set_font (TextFont *font) |
INLINE TextFont * | get_font () const |
INLINE float | get_line_height () const |
INLINE void | set_small_caps (bool small_caps) |
INLINE bool | get_small_caps () const |
INLINE void | set_small_caps_scale (float small_caps_scale) |
INLINE float | get_small_caps_scale () const |
INLINE void | set_slant (float slant) |
INLINE float | get_slant () const |
INLINE void | set_align (Alignment align_type) |
INLINE Alignment | get_align () const |
INLINE void | set_wordwrap (float width) |
INLINE void | clear_wordwrap () |
INLINE bool | has_wordwrap () const |
INLINE float | get_wordwrap () const |
INLINE void | set_text_color (float r, float g, float b, float a) |
INLINE void | set_text_color (const Colorf &text_color) |
INLINE void | clear_text_color () |
INLINE bool | has_text_color () const |
INLINE Colorf | get_text_color () const |
INLINE void | set_frame_color (float r, float g, float b, float a) |
INLINE void | set_frame_color (const Colorf &frame_color) |
INLINE Colorf | get_frame_color () const |
INLINE void | set_card_border (float size, float uv_portion) |
INLINE void | clear_card_border () |
INLINE float | get_card_border_size () const |
INLINE float | get_card_border_uv_portion () const |
INLINE bool | has_card_border () const |
INLINE void | set_card_color (float r, float g, float b, float a) |
INLINE void | set_card_color (const Colorf &card_color) |
INLINE Colorf | get_card_color () const |
INLINE void | set_card_texture (Texture *card_texture) |
INLINE void | clear_card_texture () |
INLINE bool | has_card_texture () const |
INLINE Texture * | get_card_texture () const |
INLINE void | set_shadow_color (float r, float g, float b, float a) |
INLINE void | set_shadow_color (const Colorf &shadow_color) |
INLINE Colorf | get_shadow_color () const |
INLINE void | set_frame_as_margin (float left, float right, float bottom, float top) |
INLINE void | set_frame_actual (float left, float right, float bottom, float top) |
INLINE void | clear_frame () |
INLINE bool | has_frame () const |
INLINE bool | is_frame_as_margin () const |
INLINE LVecBase4f | get_frame_as_set () const |
INLINE LVecBase4f | get_frame_actual () const |
INLINE void | set_frame_line_width (float line_width) |
INLINE float | get_frame_line_width () const |
INLINE void | set_frame_corners (bool corners) |
INLINE bool | get_frame_corners () const |
INLINE void | set_card_as_margin (float left, float right, float bottom, float top) |
INLINE void | set_card_actual (float left, float right, float bottom, float top) |
INLINE void | clear_card () |
INLINE bool | has_card () const |
INLINE bool | is_card_as_margin () const |
INLINE LVecBase4f | get_card_as_set () const |
INLINE LVecBase4f | get_card_actual () const |
INLINE LVecBase4f | get_card_transformed () const |
INLINE void | set_shadow (float xoffset, float yoffset) |
INLINE void | clear_shadow () |
INLINE bool | has_shadow () const |
INLINE LVecBase2f | get_shadow () const |
INLINE void | set_bin (const string &bin) |
INLINE void | clear_bin () |
INLINE bool | has_bin () const |
INLINE const string & | get_bin () const |
INLINE int | set_draw_order (int draw_order) |
INLINE int | get_draw_order () const |
INLINE void | set_transform (const LMatrix4f &transform) |
INLINE LMatrix4f | get_transform () const |
INLINE void | set_coordinate_system (CoordinateSystem cs) |
INLINE CoordinateSystem | get_coordinate_system () const |
INLINE void | set_text (const string &text) |
INLINE void | set_text (const string &text, Encoding encoding) |
INLINE void | clear_text () |
INLINE void | append_text (const string &text) |
INLINE void | append_unicode_char (int character) |
INLINE float | calc_width (int character) const |
INLINE float | calc_width (const string &line) const |
string | wordwrap_to (const string &text, float wordwrap_width, bool preserve_trailing_whitespace) const |
virtual void | write (ostream &out, int indent_level=0) const |
INLINE float | get_left () const |
INLINE float | get_right () const |
INLINE float | get_bottom () const |
INLINE float | get_top () const |
INLINE float | get_height () const |
INLINE float | get_width () const |
INLINE LPoint3f | get_upper_left_3d () const |
INLINE LPoint3f | get_lower_right_3d () const |
INLINE int | get_num_rows () const |
PT (PandaNode) generate() | |
INLINE void | update () |
INLINE void | force_update () |
INLINE void | invalidate_no_measure () |
INLINE void | invalidate_with_measure () |
INLINE void | check_rebuild () const |
INLINE void | check_measure () const |
void | do_rebuild () |
void | do_measure () |
float | assemble_row (wstring::iterator &si, const wstring::iterator &send, TextFont *font, GeomNode *dest, const LMatrix4f &mat) |
void | measure_text (wstring::iterator si, const wstring::iterator &send, TextFont *font, LVector2f &ul, LVector2f &lr, int &num_rows) |
void | get_character_glyphs (int character, TextFont *font, bool &got_glyph, const TextGlyph *&glyph, const TextGlyph *&second_glyph, UnicodeLatinMap::AccentType &accent_type, int &additional_flags, float &glyph_scale, float &advance_scale) |
void | tack_on_accent (UnicodeLatinMap::AccentType accent_type, const LPoint3f &min_vert, const LPoint3f &max_vert, const LPoint3f ¢roid, TextFont *font, GeomNode *dest, Geom *geom_array[], int &num_geoms) |
bool | tack_on_accent (char accent_mark, CheesyPlacement placement, CheesyTransform transform, const LPoint3f &min_vert, const LPoint3f &max_vert, const LPoint3f ¢roid, TextFont *font, GeomNode *dest, Geom *geom_array[], int &num_geoms) |
PT (PandaNode) make_frame() | |
PT (PandaNode) make_card() | |
PT (PandaNode) make_card_with_border() | |
PT (TextFont) _font | |
PT (PandaNode) _internal_geom | |
PT (Texture) _card_texture | |
Static Private Member Functions | |
INLINE void | set_default_font (TextFont *) |
INLINE TextFont * | get_default_font () |
void | load_default_font () |
PT (TextFont) _default_font | |
Private Attributes | |
PUBLISHED | __pad0__: TextNode(const string &name) |
PT(PandaNode) assemble_text(wstring floa | measure_row )(wstring::iterator &si, const wstring::iterator &send, TextFont *font) |
float | _slant |
Colorf | _text_color |
Colorf | _shadow_color |
Colorf | _frame_color |
Colorf | _card_color |
int | _flags |
Alignment | _align |
float | _wordwrap_width |
float | _frame_width |
float | _card_border_size |
float | _card_border_uv_portion |
float | _small_caps_scale |
LVector2f | _frame_ul |
LVector2f | _frame_lr |
LVector2f | _card_ul |
LVector2f | _card_lr |
LVector2f | _shadow_offset |
string | _bin |
int | _draw_order |
LMatrix4f | _transform |
CoordinateSystem | _coordinate_system |
LPoint2f | _ul2d |
LPoint2f | _lr2d |
LPoint3f | _ul3d |
LPoint3f | _lr3d |
int | _num_rows |
Static Private Attributes | |
bool | _loaded_default_font |
TypeHandle | _type_handle |
|
Definition at line 61 of file textNode.h. |
|
Definition at line 248 of file textNode.h. |
|
Definition at line 255 of file textNode.h. |
|
Reimplemented from TextEncoder. Definition at line 310 of file textNode.h. |
|
Definition at line 126 of file textNode.cxx. |
|
Reimplemented from TextEncoder. |
|
Reimplemented from TextEncoder. |
|
Reimplemented from TextEncoder. |
|
Reimplemented from PandaNode. Definition at line 455 of file textNode.cxx. References _card_color, _flags, _frame_color, _lr3d, _shadow_color, _text_color, _transform, _ul3d, SceneGraphReducer::apply_attribs(), c, Colorf, DCAST, F_has_text_color, F_needs_measure, F_needs_rebuild, ColorAttrib::get_color(), ColorAttrib::get_color_type(), ColorScaleAttrib::get_scale(), NULL, s, ColorAttrib::T_flat, SceneGraphReducer::TT_color, SceneGraphReducer::TT_color_scale, and SceneGraphReducer::TT_transform. |
|
|
|
|
|
|
Referenced by PGEntry::keystroke(), PGEntry::press(), and PGEntry::update_cursor(). |
|
Referenced by recompute_internal_bound(). |
|
Referenced by cull_callback(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
Reimplemented from TextEncoder. |
|
|
|
|
|
Reimplemented from PandaNode. Referenced by tack_on_accent(). |
|
Reimplemented from PandaNode. Definition at line 582 of file textNode.cxx. References check_rebuild(), data, NULL, and CullTraverser::traverse(). |
|
Definition at line 651 of file textNode.cxx. References _flags, _lr2d, _lr3d, _num_rows, _transform, _ul2d, _ul3d, _wordwrap_width, F_needs_measure, get_default_font(), get_font(), TextEncoder::get_wtext(), TextEncoder::has_text(), has_wordwrap(), measure_text(), NULL, and TextFont::wordwrap_to(). |
|
Definition at line 637 of file textNode.cxx. References _flags, F_needs_measure, and F_needs_rebuild. |
|
Reimplemented from PandaNode. Definition at line 365 of file textNode.h. References PandaNode::get_class_type(), and PandaNode::init_type(). |
|
|
|
|
|
Referenced by PGEntry::setup(), and PGEntry::update_text(). |
|
|
|
|
|
Referenced by PGButton::setup(), and write(). |
|
Referenced by write(). |
|
|
|
|
|
|
|
|
|
|
|
|
Reimplemented from TextEncoder. Definition at line 353 of file textNode.h. |
|
|
|
Referenced by do_measure(). |
|
|
|
Referenced by do_measure(). |
|
Referenced by write(). |
|
Referenced by write(). |
|
|
|
Referenced by write(). |
|
|
|
|
|
Referenced by PGEntry::update_text(). |
|
Referenced by PGEntry::setup(), and PGEntry::update_cursor(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
Referenced by get_character_glyphs(). |
|
Referenced by get_character_glyphs(). |
|
|
|
|
|
Reimplemented from PandaNode. Referenced by PGEntry::setup(). |
|
Reimplemented from PandaNode. Definition at line 362 of file textNode.h. References PandaNode::get_class_type(). |
|
Reimplemented from PandaNode. Definition at line 433 of file textNode.cxx. References SceneGraphReducer::TT_other, and SceneGraphReducer::TT_tex_matrix. |
|
|
|
|
|
|
|
Referenced by write(). |
|
Referenced by write(). |
|
|
|
|
|
Reimplemented from PandaNode. Definition at line 558 of file textNode.cxx. |
|
Referenced by write(). |
|
Referenced by write(). |
|
Referenced by write(). |
|
Referenced by do_measure(), and write(). |
|
Reimplemented from TextEncoder. Definition at line 356 of file textNode.h. References TextEncoder::get_class_type(), PandaNode::get_class_type(), PandaNode::init_type(), and register_type(). Referenced by init_libtext(). |
|
|
|
|
|
Referenced by write(). |
|
Referenced by write(). |
|
Definition at line 1699 of file textNode.cxx. References _loaded_default_font, FontPool::load_font(), and text_default_font. |
|
Definition at line 953 of file textNode.cxx. References _align, A_left, A_right, TextFont::get_line_height(), and measure_row. Referenced by do_measure(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Referenced by assemble_row(), and tack_on_accent(). |
|
Reimplemented from PandaNode. Definition at line 603 of file textNode.cxx. References _lr3d, _ul3d, GeometricBoundingVolume::around(), check_measure(), DCAST, NULL, and PandaNode::recompute_internal_bound(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Reimplemented from TextEncoder. |
|
Reimplemented from TextEncoder. Referenced by PGButton::setup(). |
|
|
|
|
|
|
|
|
|
Reimplemented from TextEncoder. Referenced by PGEntry::update_text(). |
|
|
|
|
|
|
|
|
|
Definition at line 139 of file textNode.cxx. References TextEncoder::decode_text(), TextEncoder::encode_wtext(), and NULL. Referenced by PGEntry::keystroke(), PGEntry::press(), and PGEntry::update_text(). |
|
Reimplemented from PandaNode. Definition at line 155 of file textNode.cxx. References _bin, _card_color, _coordinate_system, _draw_order, _frame_color, _frame_width, _shadow_color, _shadow_offset, _text_color, _transform, _wordwrap_width, A_center, A_left, A_right, decompose_matrix(), get_card_actual(), get_card_as_set(), get_frame_actual(), get_frame_as_set(), get_frame_corners(), Namable::get_name(), TextEncoder::get_text(), has_bin(), has_card(), has_frame(), has_shadow(), has_text_color(), has_wordwrap(), indent(), is_card_as_margin(), is_frame_as_margin(), NULL, and scale. |
|
Reimplemented from TextEncoder. Definition at line 58 of file textNode.h. |
|
Definition at line 328 of file textNode.h. Referenced by measure_text(). |
|
Definition at line 339 of file textNode.h. Referenced by write(). |
|
Definition at line 331 of file textNode.h. |
|
Definition at line 332 of file textNode.h. |
|
Definition at line 308 of file textNode.h. Referenced by apply_attribs_to_vertices(), and write(). |
|
Definition at line 336 of file textNode.h. |
|
Definition at line 336 of file textNode.h. |
|
Definition at line 343 of file textNode.h. Referenced by write(). |
|
Definition at line 340 of file textNode.h. Referenced by write(). |
|
Reimplemented from TextEncoder. Definition at line 327 of file textNode.h. Referenced by apply_attribs_to_vertices(), do_measure(), and do_rebuild(). |
|
Definition at line 307 of file textNode.h. Referenced by apply_attribs_to_vertices(), and write(). |
|
Definition at line 335 of file textNode.h. |
|
Definition at line 335 of file textNode.h. |
|
Definition at line 330 of file textNode.h. Referenced by write(). |
|
Definition at line 350 of file textNode.h. Referenced by load_default_font(). |
|
Definition at line 345 of file textNode.h. Referenced by do_measure(). |
|
Definition at line 346 of file textNode.h. Referenced by apply_attribs_to_vertices(), do_measure(), and recompute_internal_bound(). |
|
Definition at line 347 of file textNode.h. Referenced by do_measure(). |
|
Definition at line 306 of file textNode.h. Referenced by apply_attribs_to_vertices(), and write(). |
|
Definition at line 337 of file textNode.h. Referenced by write(). |
|
Definition at line 302 of file textNode.h. |
|
Definition at line 333 of file textNode.h. |
|
Definition at line 305 of file textNode.h. Referenced by apply_attribs_to_vertices(), and write(). |
|
Definition at line 342 of file textNode.h. Referenced by apply_attribs_to_vertices(), do_measure(), and write(). |
|
Reimplemented from TextEncoder. Definition at line 54 of file textNode.cxx. |
|
Definition at line 345 of file textNode.h. Referenced by do_measure(). |
|
Definition at line 346 of file textNode.h. Referenced by apply_attribs_to_vertices(), do_measure(), and recompute_internal_bound(). |
|
Definition at line 329 of file textNode.h. Referenced by do_measure(), and write(). |
|
Reimplemented from PandaNode. Definition at line 217 of file textNode.h. |
|
Reimplemented from PandaNode. Definition at line 217 of file textNode.h. Referenced by assemble_row(), and tack_on_accent(). |
|
Reimplemented from PandaNode. Definition at line 217 of file textNode.h. |
|
Definition at line 906 of file textNode.cxx. Referenced by measure_text(). |