15 #include "textPropertiesManager.h" 29 TextPropertiesManager::
30 TextPropertiesManager() {
38 TextPropertiesManager::
39 ~TextPropertiesManager() {
57 _properties[name] = properties;
74 Properties::const_iterator pi;
75 pi = _properties.find(name);
76 if (pi != _properties.end()) {
81 <<
"Creating default TextProperties for name '" << name <<
"'\n";
84 _properties[name] = default_properties;
85 return default_properties;
101 Properties::const_iterator pi;
102 pi = _properties.find(name);
103 return (pi != _properties.end());
114 _properties.erase(name);
132 _graphics[name] = graphic;
156 _graphics[name] = graphic;
173 Graphics::const_iterator pi;
174 pi = _graphics.find(name);
175 if (pi != _graphics.end()) {
180 <<
"Creating default TextGraphic for name '" << name <<
"'\n";
183 _graphics[name] = default_graphic;
184 return default_graphic;
200 Graphics::const_iterator pi;
201 pi = _graphics.find(name);
202 return (pi != _graphics.end());
213 _graphics.erase(name);
221 void TextPropertiesManager::
222 write(ostream &out,
int indent_level)
const {
223 Properties::const_iterator pi;
224 for (pi = _properties.begin(); pi != _properties.end(); ++pi) {
225 indent(out, indent_level)
226 <<
"TextProperties " << (*pi).first <<
":\n";
227 (*pi).second.write(out, indent_level + 2);
254 Properties::const_iterator pi;
255 pi = _properties.find(name);
256 if (pi != _properties.end()) {
257 return &(*pi).second;
271 Graphics::const_iterator pi;
272 pi = _graphics.find(name);
273 if (pi != _graphics.end()) {
274 return &(*pi).second;
const TextGraphic * get_graphic_ptr(const string &name)
Returns a pointer to the TextGraphic with the indicated name, or NULL if there is no graphic with tha...
bool calc_tight_bounds(LPoint3 &min_point, LPoint3 &max_point, 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...
TextProperties get_properties(const string &name)
Returns the TextProperties associated with the indicated name.
void clear_properties(const string &name)
Removes the named TextProperties structure from the manager.
This is a three-component point in space (as opposed to a three-component vector, which represents a ...
static TextPropertiesManager * get_global_ptr()
Returns the pointer to the global TextPropertiesManager object.
void clear_graphic(const string &name)
Removes the named TextGraphic structure from the manager.
bool has_graphic(const string &name) const
Returns true if a TextGraphic structure has been associated with the indicated name, false otherwise.
const TextProperties * get_properties_ptr(const string &name)
Returns a pointer to the TextProperties with the indicated name, or NULL if there is no properties wi...
static LVector3f right(CoordinateSystem cs=CS_default)
Returns the right vector for the given coordinate system.
void set_properties(const string &name, const TextProperties &properties)
Defines the TextProperties associated with the indicated name.
This defines the set of visual properties that may be assigned to the individual characters of the te...
void set_graphic(const string &name, const TextGraphic &graphic)
Defines the TextGraphic associated with the indicated name.
bool has_properties(const string &name) const
Returns true if a TextProperties structure has been associated with the indicated name...
This defines all of the TextProperties structures that might be referenced by name from an embedded t...
TextGraphic get_graphic(const string &name)
Returns the TextGraphic associated with the indicated name.
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
static LVector3f up(CoordinateSystem cs=CS_default)
Returns the up vector for the given coordinate system.
This defines a special model that has been constructed for the purposes of embedding an arbitrary gra...