27 TextPropertiesManager::
28 TextPropertiesManager() {
34 TextPropertiesManager::
35 ~TextPropertiesManager() {
49 _properties[name] = properties;
63 Properties::const_iterator pi;
64 pi = _properties.find(name);
65 if (pi != _properties.end()) {
70 <<
"Creating default TextProperties for name '" << name <<
"'\n";
73 _properties[name] = default_properties;
74 return default_properties;
86 Properties::const_iterator pi;
87 pi = _properties.find(name);
88 return (pi != _properties.end());
96 _properties.erase(name);
110 _graphics[name] = graphic;
121 LPoint3 min_point, max_point;
125 min_point.dot(LVector3::right()),
126 max_point.dot(LVector3::right()),
127 min_point.dot(LVector3::up()),
128 max_point.dot(LVector3::up()));
130 _graphics[name] = graphic;
144 Graphics::const_iterator pi;
145 pi = _graphics.find(name);
146 if (pi != _graphics.end()) {
151 <<
"Creating default TextGraphic for name '" << name <<
"'\n";
154 _graphics[name] = default_graphic;
155 return default_graphic;
167 Graphics::const_iterator pi;
168 pi = _graphics.find(name);
169 return (pi != _graphics.end());
177 _graphics.erase(name);
183 void TextPropertiesManager::
184 write(std::ostream &out,
int indent_level)
const {
185 Properties::const_iterator pi;
186 for (pi = _properties.begin(); pi != _properties.end(); ++pi) {
188 <<
"TextProperties " << (*pi).first <<
":\n";
189 (*pi).second.write(out, indent_level + 2);
198 if (_global_ptr ==
nullptr) {
210 Properties::const_iterator pi;
211 pi = _properties.find(name);
212 if (pi != _properties.end()) {
213 return &(*pi).second;
224 Graphics::const_iterator pi;
225 pi = _graphics.find(name);
226 if (pi != _graphics.end()) {
227 return &(*pi).second;
void set_graphic(const std::string &name, const TextGraphic &graphic)
Defines the TextGraphic associated with the indicated name.
TextGraphic get_graphic(const std::string &name)
Returns the TextGraphic associated with the indicated name.
void clear_properties(const std::string &name)
Removes the named TextProperties structure from the manager.
void set_properties(const std::string &name, const TextProperties &properties)
Defines the TextProperties associated with the indicated name.
bool calc_tight_bounds(LPoint3 &min_point, LPoint3 &max_point, const NodePath &other=NodePath(), Thread *current_thread=Thread::get_current_thread()) const
Calculates the minimum and maximum vertices of all Geoms at this NodePath's bottom node and below.
static TextPropertiesManager * get_global_ptr()
Returns the pointer to the global TextPropertiesManager object.
void clear_graphic(const std::string &name)
Removes the named TextGraphic structure from the manager.
bool has_properties(const std::string &name) const
Returns true if a TextProperties structure has been associated with the indicated name,...
std::ostream & indent(std::ostream &out, int indent_level)
A handy function for doing text formatting.
bool has_graphic(const std::string &name) const
Returns true if a TextGraphic structure has been associated with the indicated name,...
const TextProperties * get_properties_ptr(const std::string &name)
Returns a pointer to the TextProperties with the indicated name, or NULL if there is no properties wi...
This defines the set of visual properties that may be assigned to the individual characters of the te...
This defines all of the TextProperties structures that might be referenced by name from an embedded t...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
TextProperties get_properties(const std::string &name)
Returns the TextProperties associated with the indicated name.
const TextGraphic * get_graphic_ptr(const std::string &name)
Returns a pointer to the TextGraphic with the indicated name, or NULL if there is no graphic with tha...
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This defines a special model that has been constructed for the purposes of embedding an arbitrary gra...