Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

Controller.h

00001 #ifndef CONTROLLER_H
00002 #define CONTROLLER_H
00003 
00004 #include "AbstractEditor.h"
00005 #include "AbstractEditable.h"
00006 #include "SpecificKeyIterator.h"
00007 #include <string>
00008 
00010 template<class T>
00011 class VController : public VAbstractEditable, public VSpecificKeyIterator<T>
00012 {
00013 protected:
00014         T m_CurrentValue;
00015         int m_nStartFrame, m_nEndFrame;
00016 
00017 public:
00018         VController() {}
00019         VController(VController<T> *p)
00020         {
00021                 if (p != NULL)
00022                 {
00023                         m_CurrentValue = p->m_CurrentValue;
00024                         m_nStartFrame = p->m_nStartFrame;
00025                         m_nEndFrame = p->m_nEndFrame;
00026                 }
00027         }
00028 
00029         virtual VController<T>* Clone() = 0;
00030 
00032         virtual T Evaluate(int nFrame)=0;
00033 
00035         virtual VAbstractEditor* CreateEditor()  = 0;
00036 
00037 
00039         void StartFrame(int nFrame) { m_nStartFrame = nFrame; }
00041         int StartFrame() const { return m_nStartFrame; }
00042         
00044         void EndFrame(int nFrame) { m_nEndFrame = nFrame; }
00046         int EndFrame() const { return m_nEndFrame; }
00047 
00048 
00050         virtual void OnLink( ) {}
00051 
00054 
00055 
00056                 virtual int Count() const
00057                 {
00058                         return -1;
00059                 }
00060 
00061                 virtual void SetFrame(int pos, int f)
00062                 {
00063                 }
00064 
00065                 virtual int GetFrame(int pos)
00066                 {
00067                         return -1;
00068                 }
00069 
00070                 virtual void SetKey(int pos, T key)
00071                 {
00072                 }
00073 
00074                 virtual T GetKey(int pos)
00075                 {
00076                         return m_CurrentValue;
00077                 }
00078 
00079                 virtual void AddUpdate(int f, T key)
00080                 {
00081                 }
00082 
00083                 virtual void Delete(int pos)
00084                 {
00085                 }
00086 
00088                 virtual bool SupportsDirectManipulation() const { return false;}
00089 
00091 
00093         virtual string Identify() const = 0;
00094 
00096         virtual bool MaintainsLinkToShape(void*) const
00097         {
00098                 return false;
00099         }
00100 
00102         virtual void UnlinkShape(void*) {}
00103 };
00104 
00105 
00106 #endif

Generated at Wed Aug 29 19:58:55 2001 for Pocket Animator by doxygen1.2.5 written by Dimitri van Heesch, © 1997-2001