Panda3D
 All Classes Functions Variables Enumerations
lightNode.cxx
00001 // Filename: lightNode.cxx
00002 // Created by:  drose (26Mar02)
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 "lightNode.h"
00016 #include "bamWriter.h"
00017 #include "bamReader.h"
00018 #include "datagram.h"
00019 #include "datagramIterator.h"
00020 
00021 TypeHandle LightNode::_type_handle;
00022 
00023 ////////////////////////////////////////////////////////////////////
00024 //     Function: LightNode::Constructor
00025 //       Access: Published
00026 //  Description:
00027 ////////////////////////////////////////////////////////////////////
00028 LightNode::
00029 LightNode(const string &name) : 
00030   PandaNode(name) 
00031 {
00032 }
00033 
00034 ////////////////////////////////////////////////////////////////////
00035 //     Function: LightNode::Copy Constructor
00036 //       Access: Protected
00037 //  Description:
00038 ////////////////////////////////////////////////////////////////////
00039 LightNode::
00040 LightNode(const LightNode &copy) : 
00041   Light(copy),
00042   PandaNode(copy)
00043 {
00044 }
00045 
00046 ////////////////////////////////////////////////////////////////////
00047 //     Function: LightNode::as_node
00048 //       Access: Published, Virtual
00049 //  Description: Returns the Light object upcast to a PandaNode.
00050 ////////////////////////////////////////////////////////////////////
00051 PandaNode *LightNode::
00052 as_node() {
00053   return this;
00054 }
00055 
00056 ////////////////////////////////////////////////////////////////////
00057 //     Function: LightNode::as_light
00058 //       Access: Public, Virtual
00059 //  Description: Cross-casts the node to a Light pointer, if it is one
00060 //               of the four kinds of Light nodes, or returns NULL if
00061 //               it is not.
00062 ////////////////////////////////////////////////////////////////////
00063 Light *LightNode::
00064 as_light() {
00065   return this;
00066 }
00067 
00068 ////////////////////////////////////////////////////////////////////
00069 //     Function: LightNode::output
00070 //       Access: Public, Virtual
00071 //  Description:
00072 ////////////////////////////////////////////////////////////////////
00073 void LightNode::
00074 output(ostream &out) const {
00075   PandaNode::output(out);
00076 }
00077 
00078 ////////////////////////////////////////////////////////////////////
00079 //     Function: LightNode::write
00080 //       Access: Public, Virtual
00081 //  Description:
00082 ////////////////////////////////////////////////////////////////////
00083 void LightNode::
00084 write(ostream &out, int indent_level) const {
00085   PandaNode::write(out, indent_level);
00086 }
00087 
00088 ////////////////////////////////////////////////////////////////////
00089 //     Function: LightNode::write_datagram
00090 //       Access: Public, Virtual
00091 //  Description: Writes the contents of this object to the datagram
00092 //               for shipping out to a Bam file.
00093 ////////////////////////////////////////////////////////////////////
00094 void LightNode::
00095 write_datagram(BamWriter *manager, Datagram &dg) {
00096   PandaNode::write_datagram(manager, dg);
00097   Light::write_datagram(manager, dg);
00098 }
00099 
00100 ////////////////////////////////////////////////////////////////////
00101 //     Function: LightNode::fillin
00102 //       Access: Protected
00103 //  Description: This internal function is called by make_from_bam to
00104 //               read in all of the relevant data from the BamFile for
00105 //               the new LightNode.
00106 ////////////////////////////////////////////////////////////////////
00107 void LightNode::
00108 fillin(DatagramIterator &scan, BamReader *manager) {
00109   PandaNode::fillin(scan, manager);
00110   Light::fillin(scan, manager);
00111 }
 All Classes Functions Variables Enumerations