Panda3D
pointParticleFactory.cxx
1 // Filename: pointParticleFactory.cxx
2 // Created by: charles (05Jul00)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #include "pointParticleFactory.h"
16 #include "pointParticle.h"
17 
18 #include <stdlib.h>
19 
20 ////////////////////////////////////////////////////////////////////
21 // Function : PointParticleFactory
22 // Access : public
23 // Description : default constructor
24 ////////////////////////////////////////////////////////////////////
28 }
29 
30 ////////////////////////////////////////////////////////////////////
31 // Function : PointParticleFactory
32 // Access : public
33 // Description : copy constructor
34 ////////////////////////////////////////////////////////////////////
37  BaseParticleFactory(copy) {
38 }
39 
40 ////////////////////////////////////////////////////////////////////
41 // Function : ~PointParticleFactory
42 // Access : public
43 // Description : destructor
44 ////////////////////////////////////////////////////////////////////
47 }
48 
49 ////////////////////////////////////////////////////////////////////
50 // Function : populate_child_particle
51 // Access : public
52 // Description : child particle generation function
53 ////////////////////////////////////////////////////////////////////
54 void PointParticleFactory::
55 populate_child_particle(BaseParticle *bp) const {
56  bp->set_oriented(false);
57 }
58 
59 ////////////////////////////////////////////////////////////////////
60 // Function : alloc_particle
61 // Access : public
62 // Description : child particle generation function
63 ////////////////////////////////////////////////////////////////////
64 BaseParticle *PointParticleFactory::
65 alloc_particle() const {
66  return new PointParticle;
67 }
68 
69 ////////////////////////////////////////////////////////////////////
70 // Function : output
71 // Access : Public
72 // Description : Write a string representation of this instance to
73 // <out>.
74 ////////////////////////////////////////////////////////////////////
76 output(ostream &out) const {
77  #ifndef NDEBUG //[
78  out<<"PointParticleFactory";
79  #endif //] NDEBUG
80 }
81 
82 ////////////////////////////////////////////////////////////////////
83 // Function : write
84 // Access : Public
85 // Description : Write a string representation of this instance to
86 // <out>.
87 ////////////////////////////////////////////////////////////////////
89 write(ostream &out, int indent) const {
90  #ifndef NDEBUG //[
91  out.width(indent); out<<""; out<<"PointParticleFactory:\n";
92  BaseParticleFactory::write(out, indent+2);
93  #endif //] NDEBUG
94 }
virtual void write(ostream &out, int indent=0) const
Write a string representation of this instance to <out>.
Describes a particle that requires representation by a point (pixel, sparkle, billboard) ...
Definition: pointParticle.h:25
Pure Virtual base class for creating particles.
Creates point particles to user specs.
PointParticleFactory()
default constructor
virtual void write(ostream &out, int indent=0) const
Write a string representation of this instance to <out>.
virtual void output(ostream &out) const
Write a string representation of this instance to <out>.
An individual, physically-modelable particle abstract base class.
Definition: baseParticle.h:26
virtual ~PointParticleFactory()
destructor
void set_oriented(bool flag)
Set flag to determine whether this object should do any rotation or orientation calculations.