Panda3D
textGraphic.h
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file textGraphic.h
10  * @author drose
11  * @date 2006-08-18
12  */
13 
14 #ifndef TEXTGRAPHIC_H
15 #define TEXTGRAPHIC_H
16 
17 #include "pandabase.h"
18 
19 #include "config_text.h"
20 #include "nodePath.h"
21 
22 /**
23  * This defines a special model that has been constructed for the purposes of
24  * embedding an arbitrary graphic image within a text paragraph.
25  *
26  * It can be any arbitrary model, though it should be built along the same
27  * scale as the text, and it should probably be at least mostly two-
28  * dimensional. Typically, this means it should be constructed in the X-Z
29  * plane, and it should have a maximum vertical (Z) height of 1.0.
30  *
31  * The frame specifies an arbitrary bounding volume in the form (left, right,
32  * bottom, top). This indicates the amount of space that will be reserved
33  * within the paragraph. The actual model is not actually required to fit
34  * within this rectangle, but if it does not, it may visually overlap with
35  * nearby text.
36  */
37 class EXPCL_PANDA_TEXT TextGraphic {
38 PUBLISHED:
39  INLINE TextGraphic();
40  INLINE explicit TextGraphic(const NodePath &model, const LVecBase4 &frame);
41  INLINE explicit TextGraphic(const NodePath &model, PN_stdfloat left, PN_stdfloat right, PN_stdfloat bottom, PN_stdfloat top);
42 
43  INLINE NodePath get_model() const;
44  INLINE void set_model(const NodePath &model);
45  MAKE_PROPERTY(model, get_model, set_model);
46 
47  INLINE LVecBase4 get_frame() const;
48  INLINE void set_frame(const LVecBase4 &frame);
49  INLINE void set_frame(PN_stdfloat left, PN_stdfloat right, PN_stdfloat bottom, PN_stdfloat top);
50  MAKE_PROPERTY(frame, get_frame, set_frame);
51 
52  INLINE bool get_instance_flag() const;
53  INLINE void set_instance_flag(bool instance_flag);
54  MAKE_PROPERTY(instance_flag, get_instance_flag, set_instance_flag);
55 
56 private:
57  NodePath _model;
58  LVecBase4 _frame;
59  bool _instance_flag;
60 };
61 
62 #include "textGraphic.I"
63 
64 #endif
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
Definition: nodePath.h:161
This defines a special model that has been constructed for the purposes of embedding an arbitrary gra...
Definition: textGraphic.h:37
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.