Panda3D

Loading...
Searching...
No Matches
nodePathComponent.I
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 nodePathComponent.I
10 * @author drose
11 * @date 2002-02-25
12 */
13
14/**
15 *
16 */
17INLINE NodePathComponent::CData::
18CData() {
19 _length = 1;
20}
21
22/**
23 *
24 */
25INLINE NodePathComponent::CData::
26CData(const NodePathComponent::CData &copy) :
27 _next(copy._next),
28 _length(copy._length)
29{
30}
31
32/**
33 *
34 */
35INLINE NodePathComponent::
36~NodePathComponent() {
37 nassertv(_node != nullptr);
38 _node->delete_component(this);
39}
40
41/**
42 * Returns the node referenced by this component.
43 */
44INLINE PandaNode *NodePathComponent::
45 get_node() const {
46 nassertr(_node != nullptr, _node);
47 return _node;
48}
49
50/**
51 * Returns true if the key for this component has already been generated,
52 * false otherwise. Even if this returns false, calling get_key() will still
53 * return a valid key; that will simply cause the key to be generated on-the-
54 * fly.
55 */
56INLINE bool NodePathComponent::
57 has_key() const {
58 return (_key != 0);
59}
60
61/**
62 * Returns the next component in the path.
63 */
64INLINE NodePathComponent *NodePathComponent::
65 get_next(int pipeline_stage, Thread *current_thread) const {
66 CDStageReader cdata(_cycler, pipeline_stage, current_thread);
67 return cdata->_next;
68}
69
70INLINE std::ostream &operator << (std::ostream &out, const NodePathComponent &comp) {
71 comp.output(out);
72 return out;
73}
NodePathComponent
This is one component of a NodePath.
Definition nodePathComponent.h:42
NodePathComponent::get_node
PandaNode * get_node() const
Returns the node referenced by this component.
Definition nodePathComponent.I:45
NodePathComponent::has_key
bool has_key() const
Returns true if the key for this component has already been generated, false otherwise.
Definition nodePathComponent.I:57
NodePathComponent::get_next
NodePathComponent * get_next(int pipeline_stage, Thread *current_thread) const
Returns the next component in the path.
Definition nodePathComponent.I:65
NodePathComponent::output
void output(std::ostream &out) const
The recursive implementation of NodePath::output(), this writes the names of each node component in o...
Definition nodePathComponent.cxx:124
Thread
A thread; that is, a lightweight process.
Definition thread.h:46