31 if (glyph !=
nullptr) {
33 _glyphs.push_back(glyph);
64 if (glyph !=
nullptr) {
66 _glyphs.push_back(glyph);
76 _glyphs = copy._glyphs;
113 DCAST_INTO_R(tother, other,
false);
116 _glyphs.reserve(_glyphs.size() + tother->_glyphs.size());
117 _glyphs.insert(_glyphs.end(), tother->_glyphs.begin(), tother->_glyphs.end());
132 if (other->
is_of_type(GeomTextGlyph::get_class_type())) {
134 DCAST_INTO_V(tother, other);
136 _glyphs.reserve(_glyphs.size() + tother->_glyphs.size());
137 _glyphs.insert(_glyphs.end(), tother->_glyphs.begin(), tother->_glyphs.end());
145 output(std::ostream &out)
const {
147 out <<
", glyphs: [";
148 Glyphs::const_iterator gi;
149 for (gi = _glyphs.begin(); gi != _glyphs.end(); ++gi) {
151 nassertv(glyph !=
nullptr);
161 write(std::ostream &out,
int indent_level)
const {
162 Geom::write(out, indent_level);
165 Glyphs::const_iterator gi;
166 for (gi = _glyphs.begin(); gi != _glyphs.end(); ++gi) {
168 nassertv(glyph !=
nullptr);
179 _glyphs.push_back(glyph);
201 me->fillin(scan, manager);
static TypedWritable * make_GeomTextGlyph(const FactoryParams ¶ms)
Factory method to generate a GeomTextGlyph object.
virtual bool copy_primitives_from(const Geom *other)
Copies the primitives from the indicated Geom into this one.
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
Base class for objects that can be written to and read from Bam files.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual Geom * make_copy() const
Returns a newly-allocated Geom that is a shallow copy of this one.
void parse_params(const FactoryParams ¶ms, DatagramIterator &scan, BamReader *&manager)
Takes in a FactoryParams, passed from a WritableFactory into any TypedWritable's make function,...
void count_geom(const Geom *other)
Records the reference count of the other Geom within this Geom, as if the primitives were copied in v...
std::ostream & indent(std::ostream &out, int indent_level)
A handy function for doing text formatting.
This defines the actual numeric vertex data stored in a Geom, in the structure defined by a particula...
A container for geometry primitives.
An instance of this class is passed to the Factory when requesting it to do its business and construc...
void register_factory(TypeHandle handle, CreateFunc *func, void *user_data=nullptr)
Registers a new kind of thing the Factory will be able to create.
A representation of a single glyph (character) from a font.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
get_character
Returns the Unicode value that corresponds to the character this glyph represents.
static WritableFactory * get_factory()
Returns the global WritableFactory for generating TypedWritable objects.
void add_glyph(const TextGlyph *glyph)
Adds a glyph to the list of glyphs referenced by this Geom.
virtual bool copy_primitives_from(const Geom *other)
Copies the primitives from the indicated Geom into this one.
static void register_with_read_factory()
Factory method to generate a GeomTextGlyph object.
bool is_of_type(TypeHandle handle) const
Returns true if the current object is or derives from the indicated type.
A class to retrieve the individual data elements previously stored in a Datagram.
void operator=(const Geom ©)
The copy assignment operator is not pipeline-safe.
TypeHandle is the identifier used to differentiate C++ class types.
This is a specialization on Geom for containing a primitive intended to represent a TextGlyph.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.