Panda3D

lerpfunctor.cxx

00001 // Filename: lerpfunctor.cxx
00002 // Created by:  frang (26May00)
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 "lerpfunctor.h"
00016 
00017 TypeHandle LerpFunctor::_type_handle;
00018 TypeHandle MultiLerpFunctor::_type_handle;
00019 
00020 LerpFunctor::LerpFunctor(const LerpFunctor&)
00021 {
00022 }
00023 
00024 LerpFunctor::~LerpFunctor()
00025 {
00026 }
00027 
00028 LerpFunctor& LerpFunctor::operator=(const LerpFunctor&) {
00029   return *this;
00030 }
00031 
00032 void LerpFunctor::operator()(float) {
00033   // should not be here
00034 }
00035 
00036 MultiLerpFunctor::MultiLerpFunctor(const MultiLerpFunctor& c)
00037   : LerpFunctor(c), _funcs(c._funcs) {}
00038 
00039 MultiLerpFunctor::~MultiLerpFunctor() {}
00040 
00041 MultiLerpFunctor& MultiLerpFunctor::operator=(const MultiLerpFunctor& c) {
00042   _funcs = c._funcs;
00043   LerpFunctor::operator=(c);
00044   return *this;
00045 }
00046 
00047 void MultiLerpFunctor::operator()(float f) {
00048   for (Functors::iterator i=_funcs.begin(); i!=_funcs.end(); ++i)
00049     (*(*i))(f);
00050 }
00051 
00052 void MultiLerpFunctor::add_functor(LerpFunctor* func) {
00053   _funcs.insert(func);
00054 }
00055 
00056 void MultiLerpFunctor::remove_functor(LerpFunctor* func) {
00057   _funcs.erase(func);
00058 }
 All Classes Functions Variables Enumerations