36 _is_registered(false),
37 _sliders(copy._sliders),
38 _sliders_by_name(copy._sliders_by_name)
47 nassertv(!_is_registered);
48 _sliders = copy._sliders;
49 _sliders_by_name = copy._sliders_by_name;
67 nassertv(!_is_registered);
68 nassertv(n < _sliders.size());
70 if (_sliders[n]._slider->get_name() != slider->
get_name()) {
71 _sliders_by_name[_sliders[n]._slider->get_name()].clear_bit(n);
72 _sliders_by_name[slider->
get_name()].set_bit(n);
75 _sliders[n]._slider = slider;
87 nassertv(n < _sliders.size());
89 _sliders[n]._rows = rows;
97 nassertv(!_is_registered);
98 nassertv(n < _sliders.size());
100 _sliders_by_name[_sliders[n]._slider->get_name()].clear_bit(n);
101 _sliders.erase(_sliders.begin() + n);
110 nassertr(!_is_registered, 0);
112 size_t new_index = _sliders.size();
114 SliderDef slider_def;
115 slider_def._slider = slider;
116 slider_def._rows = rows;
117 _sliders.push_back(slider_def);
118 _sliders_by_name[slider->
get_name()].set_bit(new_index);
127 write(std::ostream &out)
const {
128 for (
size_t i = 0; i < _sliders.size(); ++i) {
129 out << i <<
". " << *_sliders[i]._slider <<
" " 130 << _sliders[i]._rows <<
"\n";
139 nassertv(!_is_registered);
141 Sliders::iterator si;
142 for (si = _sliders.begin(); si != _sliders.end(); ++si) {
144 bool inserted = ((
VertexSlider *)slider)->_tables.insert(
this).second;
147 _is_registered =
true;
156 nassertv(_is_registered);
158 Sliders::iterator si;
159 for (si = _sliders.begin(); si != _sliders.end(); ++si) {
163 _is_registered =
false;
183 Sliders::const_iterator si;
184 for (si = _sliders.begin(); si != _sliders.end(); ++si) {
187 (*si)._rows.write_datagram(manager, dg);
201 for (
size_t n = 0; n < _sliders.size(); ++n) {
205 _sliders[n]._slider = slider;
206 _sliders_by_name[name].set_bit(n);
224 object->fillin(scan, manager);
238 _sliders.reserve(num_sliders);
239 for (
size_t i = 0; i < num_sliders; ++i) {
242 _sliders.push_back(SliderDef());
244 _sliders[i]._rows.read_datagram(scan, manager);
260 return new CData(*
this);
267 void SliderTable::CData::
275 void SliderTable::CData::
This class records a set of integers, where each integer is either present or not present in the set.
void set_slider(size_t n, const VertexSlider *slider)
Replaces the nth slider.
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...
void read_cdata(DatagramIterator &scan, PipelineCyclerBase &cycler)
Reads in the indicated CycleData object.
void set_slider_rows(size_t n, const SparseArray &rows)
Replaces the rows affected by the nth slider.
get_name
Returns the name of this particular slider.
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 an abstract base class that retains some slider value, which is a linear value that typically...
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
void remove_slider(size_t n)
Removes the nth slider.
virtual int complete_pointers(TypedWritable **plist, BamReader *manager)
Receives an array of pointers, one for each time manager->read_pointer() was called in fillin().
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.
size_t add_slider(const VertexSlider *slider, const SparseArray &rows)
Adds a new slider to the table, and returns the index number of the new slider.
Stores the total set of VertexSliders that the vertices in a particular GeomVertexData object might d...
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().
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.
Encodes a string name in a hash table, mapping it to a pointer.
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.
bool read_pointer(DatagramIterator &scan)
The interface for reading a pointer to another object from a Bam file.
static void register_with_read_factory()
Tells the BamReader how to create objects of type SliderTable.
A class to retrieve the individual data elements previously stored in a Datagram.
TypeHandle is the identifier used to differentiate C++ class types.
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void write_pointer(Datagram &packet, const TypedWritable *dest)
The interface for writing a pointer to another object to a Bam file.