Panda3D
 All Classes Functions Variables Enumerations
vertexSlider.cxx
00001 // Filename: vertexSlider.cxx
00002 // Created by:  drose (28Mar05)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 #include "vertexSlider.h"
00016 #include "vertexTransform.h"
00017 #include "bamReader.h"
00018 #include "bamWriter.h"
00019 #include "indent.h"
00020 #include "sliderTable.h"
00021 
00022 TypeHandle VertexSlider::_type_handle;
00023 
00024 ////////////////////////////////////////////////////////////////////
00025 //     Function: VertexSlider::Constructor
00026 //       Access: Published
00027 //  Description: 
00028 ////////////////////////////////////////////////////////////////////
00029 VertexSlider::
00030 VertexSlider(const InternalName *name) : _name(name) {
00031 }
00032 
00033 ////////////////////////////////////////////////////////////////////
00034 //     Function: VertexSlider::Destructor
00035 //       Access: Published, Virtual
00036 //  Description: 
00037 ////////////////////////////////////////////////////////////////////
00038 VertexSlider::
00039 ~VertexSlider() {
00040   // We shouldn't destruct while any SliderTables are holding our
00041   // pointer.
00042   nassertv(_tables.empty());
00043 }
00044 
00045 ////////////////////////////////////////////////////////////////////
00046 //     Function: VertexSlider::output
00047 //       Access: Published, Virtual
00048 //  Description: 
00049 ////////////////////////////////////////////////////////////////////
00050 void VertexSlider::
00051 output(ostream &out) const {
00052   out << get_type() << " " << *get_name();
00053 }
00054 
00055 ////////////////////////////////////////////////////////////////////
00056 //     Function: VertexSlider::write
00057 //       Access: Published, Virtual
00058 //  Description: 
00059 ////////////////////////////////////////////////////////////////////
00060 void VertexSlider::
00061 write(ostream &out, int indent_level) const {
00062   indent(out, indent_level) 
00063     << *this << " = " << get_slider() << "\n";
00064 }
00065 
00066 ////////////////////////////////////////////////////////////////////
00067 //     Function: VertexSlider::mark_modified
00068 //       Access: Protected
00069 //  Description: Intended to be called by a derived class whenever the
00070 //               reported transform might have changed.  Without
00071 //               calling this method, changes to get_slider() may not
00072 //               be propagated through the system.
00073 ////////////////////////////////////////////////////////////////////
00074 void VertexSlider::
00075 mark_modified(Thread *current_thread) {
00076   CDWriter cdata(_cycler, true, current_thread);
00077   cdata->_modified = VertexTransform::get_next_modified(current_thread);
00078   
00079   Tables::iterator ti;
00080   for (ti = _tables.begin(); ti != _tables.end(); ++ti) {
00081     (*ti)->update_modified(cdata->_modified, current_thread);
00082   }
00083 }
00084 
00085 ////////////////////////////////////////////////////////////////////
00086 //     Function: VertexSlider::write_datagram
00087 //       Access: Public, Virtual
00088 //  Description: Writes the contents of this object to the datagram
00089 //               for shipping out to a Bam file.
00090 ////////////////////////////////////////////////////////////////////
00091 void VertexSlider::
00092 write_datagram(BamWriter *manager, Datagram &dg) {
00093   TypedWritable::write_datagram(manager, dg);
00094 }
00095 
00096 ////////////////////////////////////////////////////////////////////
00097 //     Function: VertexSlider::fillin
00098 //       Access: Protected
00099 //  Description: This internal function is called by make_from_bam to
00100 //               read in all of the relevant data from the BamFile for
00101 //               the new VertexSlider.
00102 ////////////////////////////////////////////////////////////////////
00103 void VertexSlider::
00104 fillin(DatagramIterator &scan, BamReader *manager) {
00105   TypedWritable::fillin(scan, manager);
00106 }
00107 
00108 ////////////////////////////////////////////////////////////////////
00109 //     Function: VertexSlider::CData::make_copy
00110 //       Access: Public, Virtual
00111 //  Description:
00112 ////////////////////////////////////////////////////////////////////
00113 CycleData *VertexSlider::CData::
00114 make_copy() const {
00115   return new CData(*this);
00116 }
00117 
00118 ////////////////////////////////////////////////////////////////////
00119 //     Function: VertexSlider::CData::write_datagram
00120 //       Access: Public, Virtual
00121 //  Description: Writes the contents of this object to the datagram
00122 //               for shipping out to a Bam file.
00123 ////////////////////////////////////////////////////////////////////
00124 void VertexSlider::CData::
00125 write_datagram(BamWriter *manager, Datagram &dg) const {
00126 }
00127 
00128 ////////////////////////////////////////////////////////////////////
00129 //     Function: VertexSlider::CData::complete_pointers
00130 //       Access: Public, Virtual
00131 //  Description: Receives an array of pointers, one for each time
00132 //               manager->read_pointer() was called in fillin().
00133 //               Returns the number of pointers processed.
00134 ////////////////////////////////////////////////////////////////////
00135 int VertexSlider::CData::
00136 complete_pointers(TypedWritable **p_list, BamReader *manager) {
00137   int pi = CycleData::complete_pointers(p_list, manager);
00138 
00139   return pi;
00140 }
00141 
00142 ////////////////////////////////////////////////////////////////////
00143 //     Function: VertexSlider::CData::fillin
00144 //       Access: Public, Virtual
00145 //  Description: This internal function is called by make_from_bam to
00146 //               read in all of the relevant data from the BamFile for
00147 //               the new VertexSlider.
00148 ////////////////////////////////////////////////////////////////////
00149 void VertexSlider::CData::
00150 fillin(DatagramIterator &scan, BamReader *manager) {
00151 }
 All Classes Functions Variables Enumerations