Panda3D
Loading...
Searching...
No Matches
vertexSlider.cxx
Go to the documentation of this file.
1/**
2 * PANDA 3D SOFTWARE
3 * Copyright (c) Carnegie Mellon University. All rights reserved.
4 *
5 * All use of this software is subject to the terms of the revised BSD
6 * license. You should have received a copy of this license along
7 * with this source code in a file named "LICENSE."
8 *
9 * @file vertexSlider.cxx
10 * @author drose
11 * @date 2005-03-28
12 */
13
14#include "vertexSlider.h"
15#include "vertexTransform.h"
16#include "bamReader.h"
17#include "bamWriter.h"
18#include "indent.h"
19#include "sliderTable.h"
20
21TypeHandle VertexSlider::_type_handle;
22
23/**
24 *
25 */
26VertexSlider::
27VertexSlider(const InternalName *name) : _name(name) {
28}
29
30/**
31 *
32 */
33VertexSlider::
34~VertexSlider() {
35 // We shouldn't destruct while any SliderTables are holding our pointer.
36 nassertv(_tables.empty());
37}
38
39/**
40 *
41 */
42void VertexSlider::
43output(std::ostream &out) const {
44 out << get_type() << " " << *get_name();
45}
46
47/**
48 *
49 */
50void VertexSlider::
51write(std::ostream &out, int indent_level) const {
52 indent(out, indent_level)
53 << *this << " = " << get_slider() << "\n";
54}
55
56/**
57 * Intended to be called by a derived class whenever the reported transform
58 * might have changed. Without calling this method, changes to get_slider()
59 * may not be propagated through the system.
60 */
61void VertexSlider::
62mark_modified(Thread *current_thread) {
63 CDWriter cdata(_cycler, true, current_thread);
64 cdata->_modified = VertexTransform::get_next_modified(current_thread);
65
66 Tables::iterator ti;
67 for (ti = _tables.begin(); ti != _tables.end(); ++ti) {
68 (*ti)->update_modified(cdata->_modified, current_thread);
69 }
70}
71
72/**
73 * Writes the contents of this object to the datagram for shipping out to a
74 * Bam file.
75 */
80
81/**
82 * This internal function is called by make_from_bam to read in all of the
83 * relevant data from the BamFile for the new VertexSlider.
84 */
85void VertexSlider::
86fillin(DatagramIterator &scan, BamReader *manager) {
87 TypedWritable::fillin(scan, manager);
88}
89
90/**
91 *
92 */
93CycleData *VertexSlider::CData::
94make_copy() const {
95 return new CData(*this);
96}
97
98/**
99 * Writes the contents of this object to the datagram for shipping out to a
100 * Bam file.
101 */
102void VertexSlider::CData::
103write_datagram(BamWriter *manager, Datagram &dg) const {
104}
105
106/**
107 * Receives an array of pointers, one for each time manager->read_pointer()
108 * was called in fillin(). Returns the number of pointers processed.
109 */
110int VertexSlider::CData::
111complete_pointers(TypedWritable **p_list, BamReader *manager) {
112 int pi = CycleData::complete_pointers(p_list, manager);
113
114 return pi;
115}
116
117/**
118 * This internal function is called by make_from_bam to read in all of the
119 * relevant data from the BamFile for the new VertexSlider.
120 */
121void VertexSlider::CData::
122fillin(DatagramIterator &scan, BamReader *manager) {
123}
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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...
Definition bamReader.h:110
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
Definition bamWriter.h:63
A single page of data maintained by a PipelineCycler.
Definition cycleData.h:50
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().
Definition cycleData.cxx:48
A class to retrieve the individual data elements previously stored in a Datagram.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
Definition datagram.h:38
Encodes a string name in a hash table, mapping it to a pointer.
A thread; that is, a lightweight process.
Definition thread.h:46
TypeHandle is the identifier used to differentiate C++ class types.
Definition typeHandle.h:81
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.
get_name
Returns the name of this particular 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.
static UpdateSeq get_next_modified(Thread *current_thread)
Returns a monotonically increasing sequence.
std::ostream & indent(std::ostream &out, int indent_level)
A handy function for doing text formatting.
Definition indent.cxx:20
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.