Panda3D

showInterval.cxx

00001 // Filename: showInterval.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 "showInterval.h"
00016 
00017 int ShowInterval::_unique_index;
00018 TypeHandle ShowInterval::_type_handle;
00019 
00020 ////////////////////////////////////////////////////////////////////
00021 //     Function: ShowInterval::Constructor
00022 //       Access: Published
00023 //  Description: 
00024 ////////////////////////////////////////////////////////////////////
00025 ShowInterval::
00026 ShowInterval(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       << "ShowInterval-" << node.node()->get_name() << "-" << ++_unique_index;
00035     _name = name_strm.str();
00036   }
00037 }
00038 
00039 ////////////////////////////////////////////////////////////////////
00040 //     Function: ShowInterval::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 ShowInterval::
00048 priv_instant() {
00049   check_stopped(get_class_type(), "priv_instant");
00050   _node.show();
00051   _state = S_final;
00052 }
00053 
00054 ////////////////////////////////////////////////////////////////////
00055 //     Function: ShowInterval::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 ShowInterval::
00064 priv_reverse_instant() {
00065   check_stopped(get_class_type(), "priv_reverse_instant");
00066   _node.hide();
00067   _state = S_initial;
00068 }
 All Classes Functions Variables Enumerations