Panda3D
baseForce.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 baseForce.cxx
10  * @author charles
11  * @date 2000-08-08
12  */
13 
14 #include "baseForce.h"
15 #include "indent.h"
16 
17 TypeHandle BaseForce::_type_handle;
18 
19 /**
20  * constructor
21  */
22 BaseForce::
23 BaseForce(bool active) :
24  _force_node(nullptr),
25  _active(active)
26 {
27 }
28 
29 /**
30  * copy constructor
31  */
32 BaseForce::
33 BaseForce(const BaseForce &copy) :
35 {
36  _active = copy._active;
37  _force_node = nullptr;
38 }
39 
40 /**
41  * destructor
42  */
45 }
46 
47 /**
48  * Write a string representation of this instance to <out>.
49  */
50 void BaseForce::
51 output(std::ostream &out) const {
52  out << "BaseForce (id " << this << ")";
53 }
54 
55 /**
56  * Write a string representation of this instance to <out>.
57  */
58 void BaseForce::
59 write(std::ostream &out, int indent_level) const {
60  indent(out, indent_level)
61  << "BaseForce (id " << this << "):\n";
62 
63  indent(out, indent_level + 2)
64  << "_force_node ";
65  if (_force_node) {
66  out << _force_node_path << "\n";
67  } else {
68  out << "null\n";
69  }
70 
71  indent(out, indent_level + 2)
72  << "_active " << _active << "\n";
73 }
A base class for things which need to inherit from both TypedObject and from ReferenceCount.
virtual ~BaseForce()
destructor
Definition: baseForce.cxx:44
pure virtual base class for all forces that could POSSIBLY exist.
Definition: baseForce.h:29
virtual void write(std::ostream &out, int indent_level=0) const
Write a string representation of this instance to <out>.
Definition: baseForce.cxx:59
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
std::ostream & indent(std::ostream &out, int indent_level)
A handy function for doing text formatting.
Definition: indent.cxx:20
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:81
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual void output(std::ostream &out) const
Write a string representation of this instance to <out>.
Definition: baseForce.cxx:51