12 #ifndef __CH_Segment_h__
13 #define __CH_Segment_h__
30 #define CH_EXPRESSION_CONSTANT "constant()"
31 #define CH_EXPRESSION_BEZIER "bezier()"
32 #define CH_EXPRESSION_LINEAR "linear()"
33 #define CH_EXPRESSION_CUBIC "cubic()"
34 #define CH_EXPRESSION_EASE "ease()"
35 #define CH_EXPRESSION_EASEIN "easein()"
36 #define CH_EXPRESSION_EASEOUT "easeout()"
37 #define CH_EXPRESSION_SPLINE "spline()"
38 #define CH_EXPRESSION_QLINEAR "qlinear()"
39 #define CH_EXPRESSION_QCUBIC "qcubic()"
40 #define CH_EXPRESSION_QUINTIC "quintic()"
42 #define CH_SEGMENT_MINIMUM_LENGTH 0.000001F
66 void save(std::ostream &os,
int binary)
const;
70 bool isDefault()
const;
74 unsigned isConstant:1,
103 #define CH_MAX_SLOPE 1e8
104 #define CH_MAX_ACCEL 1e8
129 int64 getMemoryUsage(
bool inclusive)
const;
132 fpreal getTolerance()
const;
134 void save(std::ostream &os,
int binary,
bool compiled,
135 bool disabled)
const;
136 template <
typename FPREAL_TYPE>
150 void unresolveLocalVars(
int thread);
163 int isMatchFunction()
const;
169 void lockStart(
int onoff) { myFlags.lockStart = onoff; }
170 void lockEnd(
int onoff) { myFlags.lockEnd = onoff; }
171 void tieInValue(
int onoff,
bool dotie =
true);
172 void tieOutValue(
int onoff,
bool dotie =
true);
173 void tieInSlope(
int onoff,
bool dotie =
true,
175 void tieOutSlope(
int onoff,
bool dotie =
true,
177 void tieInAccel(
int onoff,
bool dotie =
true);
178 void tieOutAccel(
int onoff,
bool dotie =
true);
180 void autoInSlope(
int onoff);
181 void autoOutSlope(
int onoff);
184 void cook(
int state,
int unused = 0);
197 int isCubic()
const {
return myFlags.isCubic; }
203 int isEase()
const {
return myFlags.isEase; }
208 {
return isQLinear() || isQCubic(); }
210 {
return myFlags.isBezier ||
211 myFlags.isLinear || myFlags.isQLinear ||
212 myFlags.isConstant ||
213 myFlags.isCubic || myFlags.isQCubic ||
220 {
return isStandard() || myFlags.isQuintic; }
223 {
return myFlags.isLinear || myFlags.isQLinear ||
235 bool isInSlopeFixed(
bool force)
const;
236 bool isOutSlopeFixed(
bool force)
const;
239 int isOutValueUsed();
241 int isOutSlopeUsed();
243 int isOutAccelUsed();
250 bool getFunctionKeyUserFlags(
int thread,
unsigned &
flags);
255 bool computeFastTimeDep(
bool &is_special)
const;
263 return computeFastTimeDep(is_special);
272 inline bool isTimeDependentAndGetValue(
274 inline bool isTimeDependentAndGetValue(
277 bool hasNonIntegerKeys()
const;
278 unsigned isDataDependent()
const;
284 void changeLength(
fpreal len,
286 bool accel_ratio =
true);
294 const char *getExpression()
const;
310 return getAccelRatio(myInSlope, myInAccel,
315 return getAccelRatio(myOutSlope, myOutAccel,
325 return length * ratio * SYSsqrt( slope*slope + 1 );
346 return (t - myStart) * myInverseLength;
350 bool convert_accels,
bool post_process=
true);
351 void changeExpression(
const char *expr,
353 void changeExpressionToBezierOrCubic();
359 static bool expressionIsAnimationFunctionCall(
360 const char *expression);
361 bool expressionIsAnimationFunctionCall();
365 void setInValue(
fpreal v,
bool dotie =
true);
366 void setOutValue(
fpreal v,
bool dotie =
true);
367 void setInSlope(
fpreal v,
bool dotie =
true,
fpreal ar = 0.0);
368 void setOutSlope(
fpreal v,
bool dotie =
true,
fpreal ar = 0.0);
369 void setInAccel(
fpreal v,
bool dotie =
true);
370 void setOutAccel(
fpreal v,
bool dotie =
true);
373 fpreal v = getAccelFromRatio(myInSlope, ratio,
375 setInAccel( v, dotie );
379 fpreal v = getAccelFromRatio(myOutSlope, ratio,
381 setOutAccel( v, dotie );
384 void clampOutAccel();
385 void normalizeAccels();
386 void postProcessFakeSlopeAccelHandles();
387 void postProcessHybridSlopes();
390 void makeMonotone(
bool do_prev=
false,
bool do_next=
false);
392 bool isMonotone()
const;
411 void buildOpDependencies(
void *ref_id,
int thread);
412 int changeOpRef(
const char *new_fullpath,
413 const char *old_fullpath,
415 const char *chan_name,
416 const char *old_chan_name,
419 int findString(
const char *str,
bool fullword,
420 bool usewildcards)
const;
421 int changeString(
const char *from,
const char *to,
422 bool fullword,
int thread);
427 void setModified(
bool on_off);
429 void dirtyExprCache();
452 void checkExpression();
453 void constructorInit();
454 void isCooking(
int state)
455 { myFlags.isCooking = state; }
457 void saveTimeGroups(std::ostream &is,
int binary)
const;
459 void holdLastKey(
fpreal v,
bool dotie);
461 void updateExprFlags();
464 static constexpr
unsigned
469 bool isExprTimeDep()
const;
482 fpreal myInValue, myOutValue;
483 fpreal myInSlope, myOutSlope;
484 fpreal myInAccel, myOutAccel;
531 return (myInValue != myOutValue) || myInSlope || myOutSlope;
538 return myInValue != myOutValue;
545 return isExprTimeDep();
CH_Channel * getChannel() const
void setOutAccelRatio(fpreal ratio, bool dotie=true)
void setPrev(CH_Segment *segp)
fpreal getInAccelRatio() const
PXL_API void reload()
Reload the configuration.
fpreal relativeTime(fpreal t) const
int isInValueTied() const
GA_API const UT_StringHolder accel
bool isEndSegment() const
CH_Expression * getCHExpr()
const GLuint GLenum const void * binary
void reverse(I begin, I end)
fpreal getInValue() const
GLuint GLsizei GLsizei * length
**But if you need a result
int isLengthLocked() const
__hostdev__ void setValue(uint32_t offset, bool v)
static fpreal getAccelFromRatio(fpreal slope, fpreal ratio, fpreal length)
CH_TimeGroup * getTimeGroup() const
bool shouldShowFakeAccelHandles() const
fpreal getInSlope() const
fpreal getOutValue() const
int isOutSlopeTied() const
int isStartLocked() const
__hostdev__ float getValue(uint32_t i) const
bool isTimeDependent() const
bool treatExtendAsHold() const
GA_API const UT_StringHolder scale
int isInAccelTied() const
int isLockedSegment() const
int isOutAccelTied() const
bool computeFastTimeDep(bool &is_special) const
bool hasFakeAccelHandles() const
bool hasFakeSlopeHandles() const
int isOutValueTied() const
void lockLength(int onoff)
const CH_Expression * getCHExpr() const
const CH_Segment * getPrev() const
int isInSlopeTied() const
void lockStart(int onoff)
void setNext(CH_Segment *segp)
int isInSlopeAuto() const
**Note that the tasks the is the thread number *for the or if it s being executed by a non pool thread(this *can happen in cases where the whole pool is occupied and the calling *thread contributes to running the work load).**Thread pool.Have fun
int operator==(const CH_Segment &)
SIM_API const UT_StringHolder force
void setPrevNext(CH_Segment *p, CH_Segment *n)
int isChopSegment() const
fpreal getILength() const
LeafData & operator=(const LeafData &)=delete
fpreal getOutSlope() const
fpreal getOutAccel() const
fpreal getInAccel() const
fpreal getOutAccelRatio() const
CH_SegmentFlags getFlags() const
const CH_Segment * getNext() const
int isOutSlopeAuto() const
void setChannel(CH_Channel *chp)
void setInAccelRatio(fpreal ratio, bool dotie=true)