1 | /**********************************************************************
|
---|
2 | *<
|
---|
3 | FILE: keyreduc.h
|
---|
4 |
|
---|
5 | DESCRIPTION: Key reduction
|
---|
6 |
|
---|
7 | CREATED BY: Rolf Berteig
|
---|
8 |
|
---|
9 | HISTORY: created 9/30/95
|
---|
10 |
|
---|
11 | *> Copyright (c) 1994, All Rights Reserved.
|
---|
12 | **********************************************************************/
|
---|
13 |
|
---|
14 | #ifndef __KEYREDUC__
|
---|
15 | #define __KEYREDUC__
|
---|
16 |
|
---|
17 | #define DEFULAT_KEYREDUCE_THRESHOLD (0.5f)
|
---|
18 |
|
---|
19 | // Values returned from Progress
|
---|
20 | #define KEYREDUCE_ABORT -1 // Stops processing and undoes any key reduction
|
---|
21 | #define KEYREDUCE_STOP 0 // Stops processing, but keeps any reduction done so far
|
---|
22 | #define KEYREDUCE_CONTINUE 1 // Keeps going.
|
---|
23 |
|
---|
24 | // A callback so progress can be made during key reduction
|
---|
25 | class KeyReduceStatus {
|
---|
26 | public:
|
---|
27 | // Called once before reduction starts. 'total' is the number
|
---|
28 | // reduction canidate keys.
|
---|
29 | virtual void Init(int total)=0;
|
---|
30 |
|
---|
31 | // Called every now and again. 'p' is the number of keys
|
---|
32 | // processed. So % done is p/total * 100.
|
---|
33 | virtual int Progress(int p)=0;
|
---|
34 | };
|
---|
35 |
|
---|
36 | // Attempts to delete keys that lie within the given time range.
|
---|
37 | // The controller will be sampled within the range in 'step' size
|
---|
38 | // increments. After the key reduction, the controller's values
|
---|
39 | // at each step are gauranteed to be withen 'threshold' distance
|
---|
40 | // from their original values.
|
---|
41 | //
|
---|
42 | CoreExport int ApplyKeyReduction(
|
---|
43 | Control *cont,Interval range,float thresh,TimeValue step,
|
---|
44 | KeyReduceStatus *status);
|
---|
45 |
|
---|
46 |
|
---|
47 | #endif //__KEYREDUC__
|
---|
48 |
|
---|