33TransformBlendTable() {
41 _blends(copy._blends),
49void TransformBlendTable::
51 _blends = copy._blends;
60~TransformBlendTable() {
68 nassertv(n < _blends.size());
77 nassertv(n < _blends.size());
78 _blends.erase(_blends.begin() + n);
88 consider_rebuild_index();
90 BlendIndex::iterator bi;
91 bi = _blend_index.find(&blend);
92 if (bi != _blend_index.end()) {
97 bool needs_realloc = (_blends.size() >= _blends.capacity());
98 size_t new_position = _blends.size();
99 _blends.push_back(blend);
109 _blend_index[&added_blend] = new_position;
110 _max_simultaneous_transforms = std::max(_max_simultaneous_transforms,
115 _num_transforms = -1;
124void TransformBlendTable::
125write(std::ostream &out,
int indent_level)
const {
126 for (
size_t i = 0; i < _blends.size(); ++i) {
128 << i <<
". " << _blends[i] <<
"\n";
135void TransformBlendTable::
137 _blend_index.clear();
144void TransformBlendTable::
146 _blend_index.clear();
150 _max_simultaneous_transforms = 0;
154 for (
size_t i = 0; i < _blends.size(); ++i) {
156 _blend_index[&blend] = i;
161 _max_simultaneous_transforms = std::max((
size_t)_max_simultaneous_transforms,
165 _num_transforms = transforms.size();
172void TransformBlendTable::
173recompute_modified(TransformBlendTable::CData *cdata,
Thread *current_thread) {
180 Blends::const_iterator bi;
181 for (bi = _blends.begin(); bi != _blends.end(); ++bi) {
182 seq = std::max(seq, (*bi).get_modified(current_thread));
185 cdata->_modified = seq;
191void TransformBlendTable::
192clear_modified(
Thread *current_thread) {
193 CDWriter cdata(_cycler,
true, current_thread);
215 Blends::const_iterator bi;
216 for (bi = _blends.begin(); bi != _blends.end(); ++bi) {
217 (*bi).write_datagram(manager, dg);
234 for (bi = _blends.begin(); bi != _blends.end(); ++bi) {
235 pi += (*bi).complete_pointers(p_list + pi, manager);
253 object->fillin(scan, manager);
262void TransformBlendTable::
267 _blends.reserve(num_blends);
269 for (i = 0; i < num_blends; ++i) {
271 blend.
fillin(scan, manager);
272 _blends.push_back(blend);
291 return new CData(*
this);
298void TransformBlendTable::CData::
306void TransformBlendTable::CData::
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void parse_params(const FactoryParams ¶ms, DatagramIterator &scan, BamReader *&manager)
Takes in a FactoryParams, passed from a WritableFactory into any TypedWritable's make function,...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
int get_file_minor_ver() const
Returns the minor version number of the Bam file currently being read.
void read_cdata(DatagramIterator &scan, PipelineCyclerBase &cycler)
Reads in the indicated CycleData object.
static WritableFactory * get_factory()
Returns the global WritableFactory for generating TypedWritable objects.
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
void write_cdata(Datagram &packet, const PipelineCyclerBase &cycler)
Writes out the indicated CycleData object.
This base class provides basic reference counting, but also can be used with a CopyOnWritePointer to ...
A single page of data maintained by a PipelineCycler.
A class to retrieve the individual data elements previously stored in a Datagram.
uint16_t get_uint16()
Extracts an unsigned 16-bit integer.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
void add_uint16(uint16_t value)
Adds an unsigned 16-bit integer to the datagram.
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.
void write_datagram(BamWriter *manager, Datagram &dg) const
Writes the contents of this object to the datagram for shipping out to a Bam file.
void read_datagram(DatagramIterator &scan, BamReader *manager)
Reads the object that was previously written to a Bam file.
A thread; that is, a lightweight process.
get_current_thread
Returns a pointer to the currently-executing Thread object.
TypeHandle is the identifier used to differentiate C++ class types.
Base class for objects that can be written to and read from Bam files.
virtual void fillin(DatagramIterator &scan, BamReader *manager)
This internal function is intended to be called by each class's make_from_bam() method to read in all...
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
virtual int complete_pointers(TypedWritable **p_list, BamReader *manager)
Receives an array of pointers, one for each time manager->read_pointer() was called in fillin().
This is a sequence number that increments monotonically.
This is our own Panda specialization on the default STL set.
std::ostream & indent(std::ostream &out, int indent_level)
A handy function for doing text formatting.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.