Panda3D
|
00001 // Filename: hideInterval.cxx 00002 // Created by: drose (27Aug02) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 #include "hideInterval.h" 00016 00017 int HideInterval::_unique_index; 00018 TypeHandle HideInterval::_type_handle; 00019 00020 //////////////////////////////////////////////////////////////////// 00021 // Function: HideInterval::Constructor 00022 // Access: Published 00023 // Description: 00024 //////////////////////////////////////////////////////////////////// 00025 HideInterval:: 00026 HideInterval(const NodePath &node, const string &name) : 00027 CInterval(name, 0.0, true), 00028 _node(node) 00029 { 00030 nassertv(!node.is_empty()); 00031 if (_name.empty()) { 00032 ostringstream name_strm; 00033 name_strm 00034 << "HideInterval-" << node.node()->get_name() << "-" << ++_unique_index; 00035 _name = name_strm.str(); 00036 } 00037 } 00038 00039 //////////////////////////////////////////////////////////////////// 00040 // Function: HideInterval::instant 00041 // Access: Published, Virtual 00042 // Description: This is called in lieu of priv_initialize() .. priv_step() 00043 // .. priv_finalize(), when everything is to happen within 00044 // one frame. The interval should initialize itself, 00045 // then leave itself in the final state. 00046 //////////////////////////////////////////////////////////////////// 00047 void HideInterval:: 00048 priv_instant() { 00049 check_stopped(get_class_type(), "priv_instant"); 00050 _node.hide(); 00051 _state = S_final; 00052 } 00053 00054 //////////////////////////////////////////////////////////////////// 00055 // Function: HideInterval::reverse_instant 00056 // Access: Published, Virtual 00057 // Description: This is called in lieu of priv_reverse_initialize() 00058 // .. priv_step() .. priv_reverse_finalize(), when everything is 00059 // to happen within one frame. The interval should 00060 // initialize itself, then leave itself in the initial 00061 // state. 00062 //////////////////////////////////////////////////////////////////// 00063 void HideInterval:: 00064 priv_reverse_instant() { 00065 check_stopped(get_class_type(), "priv_reverse_instant"); 00066 _node.show(); 00067 _state = S_initial; 00068 }