2016-03-01 15:47:10 +00:00
|
|
|
#ifndef R_INTERPOLATE_H
|
|
|
|
#define R_INTERPOLATE_H
|
|
|
|
|
|
|
|
#include "dobject.h"
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
class DInterpolation : public DObject
|
|
|
|
{
|
|
|
|
friend struct FInterpolator;
|
|
|
|
|
|
|
|
DECLARE_ABSTRACT_CLASS(DInterpolation, DObject)
|
|
|
|
HAS_OBJECT_POINTERS
|
|
|
|
|
2017-03-08 12:34:26 +00:00
|
|
|
TObjPtr<DInterpolation*> Next;
|
|
|
|
TObjPtr<DInterpolation*> Prev;
|
2016-03-01 15:47:10 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
int refcount;
|
|
|
|
|
|
|
|
DInterpolation();
|
|
|
|
|
|
|
|
public:
|
|
|
|
int AddRef();
|
|
|
|
int DelRef(bool force = false);
|
|
|
|
|
2017-01-12 21:49:18 +00:00
|
|
|
void OnDestroy() override;
|
2016-03-01 15:47:10 +00:00
|
|
|
virtual void UpdateInterpolation() = 0;
|
|
|
|
virtual void Restore() = 0;
|
2016-03-30 15:11:31 +00:00
|
|
|
virtual void Interpolate(double smoothratio) = 0;
|
2016-09-19 17:14:30 +00:00
|
|
|
|
2016-09-19 11:36:58 +00:00
|
|
|
virtual void Serialize(FSerializer &arc);
|
2016-03-01 15:47:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
struct FInterpolator
|
|
|
|
{
|
2017-03-08 12:34:26 +00:00
|
|
|
TObjPtr<DInterpolation*> Head;
|
2016-03-01 15:47:10 +00:00
|
|
|
bool didInterp;
|
|
|
|
int count;
|
|
|
|
|
|
|
|
int CountInterpolations ();
|
|
|
|
|
|
|
|
public:
|
|
|
|
FInterpolator()
|
|
|
|
{
|
|
|
|
Head = NULL;
|
|
|
|
didInterp = false;
|
|
|
|
count = 0;
|
|
|
|
}
|
|
|
|
void UpdateInterpolations();
|
|
|
|
void AddInterpolation(DInterpolation *);
|
|
|
|
void RemoveInterpolation(DInterpolation *);
|
2016-03-30 15:11:31 +00:00
|
|
|
void DoInterpolations(double smoothratio);
|
2016-03-01 15:47:10 +00:00
|
|
|
void RestoreInterpolations();
|
|
|
|
void ClearInterpolations();
|
|
|
|
};
|
|
|
|
|
|
|
|
extern FInterpolator interpolator;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|