![]() |
|
#1
|
||||
|
||||
overriding variable typesI've defined several classes for doing interpolation. They are:
Interpolator: The interpolator base class. Scalar Interpolator: Interpolates scalars. Inherits from Interpolator. QuaternionInterpolator: Interpolates quaternions. Inherits from Interpolator. Keyframe: The keyframe base class. ScalarKeyframe: A Keyframe used in scalar interpolation. Inherits from Keyframe. QuaternionKeyframe: A Keyframe used in quaternion interpolation. Inherits from keyframe. Each interpolator has an stl map containg Keyframe pointers and time values (floats). The map is contained in the base class so that I can define all the iterator functions, etc, there, rather than redefining them in both leaf classes. The one annoying thing is that I always need to cast a Keyframe* as either a ScalarKeyframe* or QuaternionKeyframe* when I dereference an iterator. Is there a way to override the typedefs in the leaf classes that will prevent that problem? I couild fix it be overriding the function definitions, but I would rather not do that. Here's the interpolator header (QuaternionInterpolator not shown because it is still a work in progress). The list of virtual functions that return iterators in the Interpolator class are the ones causing problems. CPP / C++ / C Code:
And the keyframe header (QuaternionKeyframe not shown for the same reason) CPP / C++ / C Code:
I'm using MS Visual C++ (the free version) on Windows XP Professional. |
Recent GIDBlog
NARMY by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| char variable problems | Swys | C++ Forum | 11 | 08-Aug-2005 19:41 |
| [Tutorial] Pointers in C (Part II) | Stack Overflow | C Programming Language | 0 | 27-Apr-2005 17:36 |
| [Tutorial] Pointers in C (Part I) | Stack Overflow | C Programming Language | 1 | 08-Apr-2005 18:35 |
| Data types and Hardware dependencies | karthikeyansen | C Programming Language | 2 | 03-Apr-2005 21:58 |
| making string data into a variable | dopee | MySQL / PHP Forum | 0 | 25-Oct-2004 04:30 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The