00001 // Filename: lerpfunctor.cxx 00002 // Created by: frang (26May00) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved 00008 // 00009 // All use of this software is subject to the terms of the Panda 3d 00010 // Software license. You should have received a copy of this license 00011 // along with this source code; you will also find a current copy of 00012 // the license at http://www.panda3d.org/license.txt . 00013 // 00014 // To contact the maintainers of this program write to 00015 // panda3d@yahoogroups.com . 00016 // 00017 //////////////////////////////////////////////////////////////////// 00018 00019 #include "lerpfunctor.h" 00020 00021 TypeHandle LerpFunctor::_type_handle; 00022 TypeHandle MultiLerpFunctor::_type_handle; 00023 00024 LerpFunctor::LerpFunctor(const LerpFunctor&) 00025 { 00026 } 00027 00028 LerpFunctor::~LerpFunctor(void) 00029 { 00030 } 00031 00032 LerpFunctor& LerpFunctor::operator=(const LerpFunctor&) { 00033 return *this; 00034 } 00035 00036 void LerpFunctor::operator()(float) { 00037 // should not be here 00038 } 00039 00040 MultiLerpFunctor::MultiLerpFunctor(const MultiLerpFunctor& c) 00041 : LerpFunctor(c), _funcs(c._funcs) {} 00042 00043 MultiLerpFunctor::~MultiLerpFunctor(void) {} 00044 00045 MultiLerpFunctor& MultiLerpFunctor::operator=(const MultiLerpFunctor& c) { 00046 _funcs = c._funcs; 00047 LerpFunctor::operator=(c); 00048 return *this; 00049 } 00050 00051 void MultiLerpFunctor::operator()(float f) { 00052 for (Functors::iterator i=_funcs.begin(); i!=_funcs.end(); ++i) 00053 (*(*i))(f); 00054 } 00055 00056 void MultiLerpFunctor::add_functor(LerpFunctor* func) { 00057 _funcs.insert(func); 00058 } 00059 00060 void MultiLerpFunctor::remove_functor(LerpFunctor* func) { 00061 _funcs.erase(func); 00062 }