Panda3D
Loading...
Searching...
No Matches
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
16int HideInterval::_unique_index;
17TypeHandle HideInterval::_type_handle;
18
19/**
20 *
21 */
22HideInterval::
23HideInterval(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 */
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 */
56 check_stopped(get_class_type(), "priv_reverse_instant");
57 _node.show();
58 _state = S_initial;
59}
The base class for timeline components.
Definition cInterval.h:36
virtual void priv_instant()
This is called in lieu of priv_initialize() .
virtual void priv_reverse_instant()
This is called in lieu of priv_reverse_initialize() .
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
Definition nodePath.h:159
void show()
Undoes the effect of a previous hide() on this node: makes the referenced node (and the entire subgra...
Definition nodePath.I:1796
void hide()
Makes the referenced node (and the entire subgraph below this node) invisible to all cameras.
Definition nodePath.I:1853
bool is_empty() const
Returns true if the NodePath contains no nodes.
Definition nodePath.I:188
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
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.