Panda3D
Loading...
Searching...
No Matches
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
20TypeHandle LightNode::_type_handle;
21
22/**
23 *
24 */
25LightNode::
26LightNode(const std::string &name) :
27 PandaNode(name)
28{
29}
30
31/**
32 *
33 */
34LightNode::
35LightNode(const LightNode &copy) :
36 Light(copy),
37 PandaNode(copy)
38{
39}
40
41/**
42 * Returns the Light object upcast to a PandaNode.
43 */
45as_node() {
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 */
54as_light() {
55 return this;
56}
57
58/**
59 *
60 */
61void LightNode::
62output(std::ostream &out) const {
63 PandaNode::output(out);
64}
65
66/**
67 *
68 */
69void LightNode::
70write(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 */
79write_datagram(BamWriter *manager, Datagram &dg) {
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 */
88void LightNode::
89fillin(DatagramIterator &scan, BamReader *manager) {
90 PandaNode::fillin(scan, manager);
91 Light::fillin(scan, manager);
92}
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 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
A derivative of Light and of PandaNode.
Definition lightNode.h:27
virtual PandaNode * as_node()
Returns the Light object upcast to a PandaNode.
Definition lightNode.cxx:45
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
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
The abstract interface to all kinds of lights.
Definition light.h:38
A basic node of the scene graph or data graph.
Definition pandaNode.h:65
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
TypeHandle is the identifier used to differentiate C++ class types.
Definition typeHandle.h:81
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.