15 #include "geomTextGlyph.h"
19 #include "datagramIterator.h"
20 #include "bamReader.h"
32 GeomTextGlyph(DynamicTextGlyph *glyph,
const GeomVertexData *data) :
38 if (glyph != (DynamicTextGlyph *)NULL) {
40 _glyphs.push_back(glyph);
68 for (gi = _glyphs.begin(); gi != _glyphs.end(); ++gi) {
69 DynamicTextGlyph *glyph = (*gi);
70 nassertv(glyph != (DynamicTextGlyph *)NULL);
85 for (gi = _glyphs.begin(); gi != _glyphs.end(); ++gi) {
86 DynamicTextGlyph *glyph = (*gi);
87 nassertv(glyph != (DynamicTextGlyph *)NULL);
89 nassertv((*gi)->_geom_count >= 0);
91 _glyphs = copy._glyphs;
92 for (gi = _glyphs.begin(); gi != _glyphs.end(); ++gi) {
93 DynamicTextGlyph *glyph = (*gi);
94 nassertv(glyph != (DynamicTextGlyph *)NULL);
107 for (gi = _glyphs.begin(); gi != _glyphs.end(); ++gi) {
108 DynamicTextGlyph *glyph = (*gi);
109 nassertv(glyph != (DynamicTextGlyph *)NULL);
110 glyph->_geom_count--;
111 nassertv(glyph->_geom_count >= 0);
149 DCAST_INTO_R(tother, other,
false);
152 Glyphs::const_iterator gi;
153 for (gi = tother->_glyphs.begin(); gi != tother->_glyphs.end(); ++gi) {
154 _glyphs.push_back(*gi);
155 (*gi)->_geom_count++;
174 count_geom(
const Geom *other) {
175 if (other->
is_of_type(GeomTextGlyph::get_class_type())) {
177 DCAST_INTO_V(tother, other);
179 Glyphs::const_iterator gi;
180 for (gi = tother->_glyphs.begin(); gi != tother->_glyphs.end(); ++gi) {
181 _glyphs.push_back(*gi);
182 (*gi)->_geom_count++;
193 output(ostream &out)
const {
195 out <<
", glyphs: [";
196 Glyphs::const_iterator gi;
197 for (gi = _glyphs.begin(); gi != _glyphs.end(); ++gi) {
198 DynamicTextGlyph *glyph = (*gi);
199 nassertv(glyph != (DynamicTextGlyph *)NULL);
200 out <<
" " << glyph->get_character();
211 write(ostream &out,
int indent_level)
const {
212 Geom::write(out, indent_level);
213 indent(out, indent_level)
215 Glyphs::const_iterator gi;
216 for (gi = _glyphs.begin(); gi != _glyphs.end(); ++gi) {
217 DynamicTextGlyph *glyph = (*gi);
218 nassertv(glyph != (DynamicTextGlyph *)NULL);
219 out <<
" " << glyph->get_character();
246 parse_params(params, scan, manager);
247 me->fillin(scan, manager);
251 #endif // HAVE_FREETYPE
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.
bool is_of_type(TypeHandle handle) const
Returns true if the current object is or derives from the indicated type.
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...
virtual Geom * make_copy() const
Returns a newly-allocated Geom that is a shallow copy of this one.
void register_factory(TypeHandle handle, CreateFunc *func)
Registers a new kind of thing the Factory will be able to create.
static WritableFactory * get_factory()
Returns the global WritableFactory for generating TypedWritable objects.
virtual bool copy_primitives_from(const Geom *other)
Copies the primitives from the indicated Geom into this one.
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.
static void register_with_read_factory()
Tells the BamReader how to create objects of type Geom.
TypeHandle is the identifier used to differentiate C++ class types.