Panda3D
hideInterval.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 hideInterval.cxx
10  * @author drose
11  * @date 2002-08-27
12  */
13 
14 #include "hideInterval.h"
15 
16 int HideInterval::_unique_index;
17 TypeHandle HideInterval::_type_handle;
18 
19 /**
20  *
21  */
22 HideInterval::
23 HideInterval(const NodePath &node, const std::string &name) :
24  CInterval(name, 0.0, true),
25  _node(node)
26 {
27  nassertv(!node.is_empty());
28  if (_name.empty()) {
29  std::ostringstream name_strm;
30  name_strm
31  << "HideInterval-" << node.node()->get_name() << "-" << ++_unique_index;
32  _name = name_strm.str();
33  }
34 }
35 
36 /**
37  * This is called in lieu of priv_initialize() .. priv_step() ..
38  * priv_finalize(), when everything is to happen within one frame. The
39  * interval should initialize itself, then leave itself in the final state.
40  */
41 void HideInterval::
43  check_stopped(get_class_type(), "priv_instant");
44  _node.hide();
45  _state = S_final;
46 }
47 
48 /**
49  * This is called in lieu of priv_reverse_initialize() .. priv_step() ..
50  * priv_reverse_finalize(), when everything is to happen within one frame.
51  * The interval should initialize itself, then leave itself in the initial
52  * state.
53  */
54 void HideInterval::
56  check_stopped(get_class_type(), "priv_reverse_instant");
57  _node.show();
58  _state = S_initial;
59 }
bool is_empty() const
Returns true if the NodePath contains no nodes.
Definition: nodePath.I:188
virtual void priv_reverse_instant()
This is called in lieu of priv_reverse_initialize() .
The base class for timeline components.
Definition: cInterval.h:35
void show()
Undoes the effect of a previous hide() on this node: makes the referenced node (and the entire subgra...
Definition: nodePath.I:1788
virtual void priv_instant()
This is called in lieu of priv_initialize() .
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PandaNode * node() const
Returns the referenced node of the path.
Definition: nodePath.I:227
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:81
void hide()
Makes the referenced node (and the entire subgraph below this node) invisible to all cameras.
Definition: nodePath.I:1843
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
Definition: nodePath.h:161