Go to the documentation of this file.
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::
Stores the total set of VertexSliders that the vertices in a particular GeomVertexData object might d...
A single page of data maintained by a PipelineCycler.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
uint16_t get_uint16()
Extracts an unsigned 16-bit integer.
void set_slider(size_t n, const VertexSlider *slider)
Replaces the nth slider.
A class to retrieve the individual data elements previously stored in a Datagram.
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 the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
void write_pointer(Datagram &packet, const TypedWritable *dest)
The interface for writing a pointer to another object to a Bam file.
Encodes a string name in a hash table, mapping it to a pointer.
static WritableFactory * get_factory()
Returns the global WritableFactory for generating TypedWritable objects.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Base class for objects that can be written to and read from Bam files.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
void set_slider_rows(size_t n, const SparseArray &rows)
Replaces the rows affected by the nth slider.
get_current_thread
Returns a pointer to the currently-executing Thread object.
TypeHandle is the identifier used to differentiate C++ class types.
void add_uint16(uint16_t value)
Adds an unsigned 16-bit integer to the datagram.
virtual int complete_pointers(TypedWritable **plist, BamReader *manager)
Receives an array of pointers, one for each time manager->read_pointer() was called in fillin().
void read_cdata(DatagramIterator &scan, PipelineCyclerBase &cycler)
Reads in the indicated CycleData object.
An instance of this class is passed to the Factory when requesting it to do its business and construc...
void remove_slider(size_t n)
Removes the nth slider.
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
This class records a set of integers, where each integer is either present or not present in the set.
This is an abstract base class that retains some slider value, which is a linear value that typically...
get_name
Returns the name of this particular slider.
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.
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_cdata(Datagram &packet, const PipelineCyclerBase &cycler)
Writes out the indicated CycleData object.
static void register_with_read_factory()
Tells the BamReader how to create objects of type SliderTable.
bool read_pointer(DatagramIterator &scan)
The interface for reading a pointer to another object from a Bam file.
int get_file_minor_ver() const
Returns the minor version number of the Bam file currently being read.
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 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...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A thread; that is, a lightweight process.
void parse_params(const FactoryParams ¶ms, DatagramIterator &scan, BamReader *&manager)
Takes in a FactoryParams, passed from a WritableFactory into any TypedWritable's make function,...