15 #include "fltVertexList.h" 16 #include "fltRecordReader.h" 17 #include "fltRecordWriter.h" 18 #include "fltHeader.h" 38 return _vertices.size();
48 nassertr(n >= 0 && n < (
int)_vertices.size(), 0);
69 _header->add_vertex(vertex);
70 _vertices.push_back(vertex);
83 out << _vertices.size() <<
" vertices";
96 if (!FltRecord::extract_record(reader)) {
100 nassertr(reader.
get_opcode() == FO_vertex_list,
false);
104 while (iterator.get_remaining_size() >= 4) {
105 int vertex_offset = iterator.get_be_int32();
106 _vertices.push_back(_header->get_vertex_by_offset(vertex_offset));
123 if (!FltRecord::build_record(writer)) {
130 Vertices::const_iterator vi;
131 for (vi = _vertices.begin(); vi != _vertices.end(); ++vi) {
This class writes a sequence of FltRecords to an ostream, handling opcode and size counts properly...
This class turns an istream into a sequence of FltRecords by reading a sequence of Datagrams and extr...
virtual void output(ostream &out) const
Writes a quick one-line description of the record, but not its children.
int get_num_vertices() const
Returns the number of vertices in this vertex list.
void check_remaining_size(const DatagramIterator &di, const string &name=string()) const
Checks that the iterator has no bytes left, as it should at the end of a successfully read record...
DatagramIterator & get_iterator()
Returns an iterator suitable for extracting data from the current record.
void add_vertex(FltVertex *vertex)
Adds a new vertex to the end of the vertex list.
The base class for all kinds of records in a MultiGen OpenFlight file.
Represents a single vertex in the vertex palette.
void clear_vertices()
Removes all vertices from this vertex list.
FltOpcode get_opcode() const
Returns the opcode associated with the current record.
FltVertex * get_vertex(int n) const
Returns the nth vertex of this vertex list.
A class to retrieve the individual data elements previously stored in a Datagram. ...
void add_be_uint32(PN_uint32 value)
Adds an unsigned 32-bit big-endian integer to the datagram.
TypeHandle is the identifier used to differentiate C++ class types.
void set_opcode(FltOpcode opcode)
Sets the opcode associated with the current record.
Datagram & update_datagram()
Returns a modifiable reference to the datagram associated with the current record.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...