Panda3D
lightNode.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 lightNode.cxx
10  * @author drose
11  * @date 2002-03-26
12  */
13 
14 #include "lightNode.h"
15 #include "bamWriter.h"
16 #include "bamReader.h"
17 #include "datagram.h"
18 #include "datagramIterator.h"
19 
20 TypeHandle LightNode::_type_handle;
21 
22 /**
23  *
24  */
25 LightNode::
26 LightNode(const std::string &name) :
27  PandaNode(name)
28 {
29 }
30 
31 /**
32  *
33  */
34 LightNode::
35 LightNode(const LightNode &copy) :
36  Light(copy),
37  PandaNode(copy)
38 {
39 }
40 
41 /**
42  * Returns the Light object upcast to a PandaNode.
43  */
46  return this;
47 }
48 
49 /**
50  * Cross-casts the node to a Light pointer, if it is one of the four kinds of
51  * Light nodes, or returns NULL if it is not.
52  */
55  return this;
56 }
57 
58 /**
59  *
60  */
61 void LightNode::
62 output(std::ostream &out) const {
63  PandaNode::output(out);
64 }
65 
66 /**
67  *
68  */
69 void LightNode::
70 write(std::ostream &out, int indent_level) const {
71  PandaNode::write(out, indent_level);
72 }
73 
74 /**
75  * Writes the contents of this object to the datagram for shipping out to a
76  * Bam file.
77  */
78 void LightNode::
80  PandaNode::write_datagram(manager, dg);
81  Light::write_datagram(manager, dg);
82 }
83 
84 /**
85  * This internal function is called by make_from_bam to read in all of the
86  * relevant data from the BamFile for the new LightNode.
87  */
88 void LightNode::
89 fillin(DatagramIterator &scan, BamReader *manager) {
90  PandaNode::fillin(scan, manager);
91  Light::fillin(scan, manager);
92 }
A basic node of the scene graph or data graph.
Definition: pandaNode.h:64
The abstract interface to all kinds of lights.
Definition: light.h:38
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
Definition: lightNode.cxx:79
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
Definition: pandaNode.cxx:3589
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
Definition: bamReader.h:110
A derivative of Light and of PandaNode.
Definition: lightNode.h:27
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual PandaNode * as_node()
Returns the Light object upcast to a PandaNode.
Definition: lightNode.cxx:45
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
Definition: bamWriter.h:63
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual Light * as_light()
Cross-casts the node to a Light pointer, if it is one of the four kinds of Light nodes,...
Definition: lightNode.cxx:54
A class to retrieve the individual data elements previously stored in a Datagram.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:81
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
Definition: datagram.h:38
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.