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;
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 ||
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);
287 void changeLength(
fpreal len,
290 bool out_accel_ratio);
298 const char *getExpression()
const;
314 return getAccelRatio(myInSlope, myInAccel,
319 return getAccelRatio(myOutSlope, myOutAccel,
329 return length * ratio * SYSsqrt( slope*slope + 1 );
350 return (t - myStart) * myInverseLength;
354 bool convert_accels,
bool post_process=
true);
355 void changeExpression(
const char *expr,
357 void changeExpressionToBezierOrCubic();
363 static bool expressionIsAnimationFunctionCall(
364 const char *expression);
365 bool expressionIsAnimationFunctionCall();
369 void setInValue(
fpreal v,
bool dotie =
true);
370 void setOutValue(
fpreal v,
bool dotie =
true);
371 void setInSlope(
fpreal v,
bool dotie =
true,
fpreal ar = 0.0);
374 void setOutSlope(
fpreal v,
bool dotie =
true,
fpreal ar = 0.0);
377 void setInAccel(
fpreal v,
bool dotie =
true);
378 void setOutAccel(
fpreal v,
bool dotie =
true);
381 fpreal v = getAccelFromRatio(myInSlope, ratio,
383 setInAccel( v, dotie );
387 fpreal v = getAccelFromRatio(myOutSlope, ratio,
389 setOutAccel( v, dotie );
392 void clampOutAccel();
393 void normalizeAccels();
394 void postProcessFakeSlopeAccelHandles();
395 void postProcessHybridSlopes();
398 void makeMonotone(
bool do_prev=
false,
bool do_next=
false);
400 bool isMonotone()
const;
419 void buildOpDependencies(
void *ref_id,
int thread);
420 int changeOpRef(
const char *new_fullpath,
421 const char *old_fullpath,
423 const char *chan_name,
424 const char *old_chan_name,
427 int findString(
const char *str,
bool fullword,
428 bool usewildcards)
const;
429 int changeString(
const char *from,
const char *to,
430 bool fullword,
int thread);
435 void setModified(
bool on_off);
437 void dirtyExprCache();
460 void checkExpression();
461 void constructorInit();
462 void isCooking(
int state)
463 { myFlags.isCooking =
state; }
465 void saveTimeGroups(std::ostream &is,
int binary)
const;
467 void holdLastKey(
fpreal v,
bool dotie);
469 void updateExprFlags();
472 static constexpr
unsigned
477 bool isExprTimeDep()
const;
490 fpreal myInValue, myOutValue;
491 fpreal myInSlope, myOutSlope;
492 fpreal myInAccel, myOutAccel;
540 return (myInValue != myOutValue) || myInSlope || myOutSlope;
547 return myInValue != myOutValue;
554 return isExprTimeDep();
CH_Channel * getChannel() const
void setOutAccelRatio(fpreal ratio, bool dotie=true)
void setPrev(CH_Segment *segp)
CE_API bool evaluate(const CE_OSDRefinement &topo, const CE_OSDEvaluator &eval, const cl::Buffer &coarse, const CE_OSDPatchCoords &patch_coords, const CE_FloatArray *refined_data, cl::Buffer &out, cl::Buffer *du, cl::Buffer *dv)
fpreal getInAccelRatio() const
PXL_API void reload()
Reload the configuration.
bool isDefault(const cgltf_texture_view &tv)
fpreal relativeTime(fpreal t) const
int isInValueTied() const
GA_API const UT_StringHolder accel
bool isEndSegment() const
CH_Expression * getCHExpr()
GLsizei const GLfloat * value
const GLuint GLenum const void * binary
PUGI__FN void reverse(I begin, I end)
fpreal getInValue() const
GLuint GLsizei GLsizei * length
**But if you need a result
int isLengthLocked() const
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
GLint GLint GLsizei GLint GLenum GLenum type
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)