33 return _vertices.size();
41 nassertr(n >= 0 && n < (
int)_vertices.size(),
nullptr);
58 _header->add_vertex(vertex);
59 _vertices.push_back(vertex);
69 out << _vertices.size() <<
" vertices";
79 if (!FltRecord::extract_record(reader)) {
83 nassertr(reader.
get_opcode() == FO_vertex_list,
false);
87 while (iterator.get_remaining_size() >= 4) {
88 int vertex_offset = iterator.get_be_int32();
89 _vertices.push_back(_header->get_vertex_by_offset(vertex_offset));
103 if (!FltRecord::build_record(writer)) {
110 Vertices::const_iterator vi;
111 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...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void check_remaining_size(const DatagramIterator &di, const std::string &name=std::string()) const
Checks that the iterator has no bytes left, as it should at the end of a successfully read record.
int get_num_vertices() const
Returns the number of vertices in this vertex list.
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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Represents a single vertex in the vertex palette.
void clear_vertices()
Removes all vertices from this vertex list.
void add_be_uint32(uint32_t value)
Adds an unsigned 32-bit big-endian integer to the datagram.
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.
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 ...
virtual void output(std::ostream &out) const
Writes a quick one-line description of the record, but not its children.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.