33 TransformBlendTable() {
41 _blends(copy._blends),
49 void 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;
124 void TransformBlendTable::
125 write(std::ostream &out,
int indent_level)
const {
126 for (
size_t i = 0; i < _blends.size(); ++i) {
128 << i <<
". " << _blends[i] <<
"\n";
135 void TransformBlendTable::
137 _blend_index.clear();
144 void 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();
172 void TransformBlendTable::
173 recompute_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;
191 void TransformBlendTable::
192 clear_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);
262 void 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);
298 void TransformBlendTable::CData::
306 void TransformBlendTable::CData::
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
void read_cdata(DatagramIterator &scan, PipelineCyclerBase &cycler)
Reads in the indicated CycleData object.
void write_datagram(BamWriter *manager, Datagram &dg) const
Writes the contents of this object to the datagram for shipping out to a Bam file.
A single page of data maintained by a PipelineCycler.
Base class for objects that can be written to and read from Bam files.
void write_cdata(Datagram &packet, const PipelineCyclerBase &cycler)
Writes out the indicated CycleData object.
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
int get_file_minor_ver() const
Returns the minor version number of the Bam file currently being read.
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.
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 add_uint16(uint16_t value)
Adds an unsigned 16-bit integer to the datagram.
get_current_thread
Returns a pointer to the currently-executing Thread object.
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().
std::ostream & indent(std::ostream &out, int indent_level)
A handy function for doing text formatting.
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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This base class provides basic reference counting, but also can be used with a CopyOnWritePointer to ...
uint16_t get_uint16()
Extracts an unsigned 16-bit integer.
static WritableFactory * get_factory()
Returns the global WritableFactory for generating TypedWritable objects.
A thread; that is, a lightweight process.
This is our own Panda specialization on the default STL set.
A class to retrieve the individual data elements previously stored in a Datagram.
TypeHandle is the identifier used to differentiate C++ class types.
This is a sequence number that increments monotonically.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
void read_datagram(DatagramIterator &scan, BamReader *manager)
Reads the object that was previously written to a Bam file.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.