13 #ifndef __CL_SimpleChannel_h__
14 #define __CL_SimpleChannel_h__
56 bool clamp_slopes =
true);
70 void splitAndFindSlopeLengths(
fpreal t,
110 return x0 + u*(x1 + u*(
x2 + u*x3));
155 static void getMonotoneSlopeSDDE2ViaConic
162 void display()
const;
290 bool canEval()
const;
305 bool no_disabling =
false)
const;
318 bool isAtHardKey(
fpreal gtime)
const;
320 int getSegmentIdx(
fpreal ltime)
const;
328 { mySegmentExpressions[
index] = expr; }
331 {
return mySegmentInSlopesAuto[
index]; }
333 {
return mySegmentOutSlopesAuto[
index]; }
357 bool insertKeyFrame(
fpreal global_time,
bool auto_slope =
true);
362 bool destroyKeyFrame(
fpreal global_time);
367 bool destroyKeyFrames(
fpreal gtime_start,
fpreal gtime_end);
375 bool destroySegments(
int start_idx,
int end_idx);
411 bool setKeyAutoSlope(
fpreal gtime,
bool auto_slope,
415 bool setRawValues(
fpreal from,
419 bool auto_slope =
true);
448 bool isAllDisabled()
const;
449 bool isAllEnabled()
const;
450 bool isDisabled(
fpreal gtime)
const;
451 void disableAll(
fpreal gtime);
457 {
return myDisableSegments; }
469 void setTolerance(
fpreal tolerance) { myTolerance = tolerance; }
523 void moveKeysWithDeltas(
528 void smoothAutoSlopesForSegments(
533 void smoothAutoSlopes(
bool force =
false);
537 void trimStart(
float gtime);
540 void trimEnd(
float gtime);
554 static void setAutoSplit(
bool onoff);
559 {
return theDefaultSegmentType; }
562 {
return theDefaultSplitSegmentType; }
567 static fpreal theTolerance;
568 static constexpr
fpreal theDefaultAccelRatio = 1.0 / 3.0;
571 static bool theAutoSplit;
579 return length * ratio * SYSsqrt( slope*slope + 1 );
589 bool is_end_segment);
593 bool is_end_segment);
597 void splitSegment(
fpreal gtime,
bool auto_slope =
true);
599 void changeSegmentLength(
int index,
601 bool scale_accels =
true);
612 void insertSegment(
int index,
616 void removeSegment(
int index);
621 bool clamp_slopes =
true);
625 void removeSegments(
int start_index,
int end_index);
628 void recomputeBezierCoeffs(
int start_index = 0,
int end_index = -1);
636 void shiftKey(
int index,
fpreal t,
bool recompute_coeffs =
true);
641 int getDisableSegmentIndex(
fpreal ltime,
bool closest_earlier =
false)
const;
688 bool myIsAllDisabled;
const UT_Array< CL_SimpleSegment > & getSegments() const
fpreal getPostSlope() const
GLsizei GLenum const void * indices
#define SYS_DEPRECATED(__V__)
GA_API const UT_StringHolder accel
imath_half_bits_t half
if we're in a C-only context, alias the half bits type to half
const UT_Array< UT_StringHolder > & getSegmentExpressions() const
CL_ChannelBehavior getPreType() const
int getNSegments() const
Returns the number of segments including the end segment.
GLsizei const GLfloat * value
void setPostType(CL_ChannelBehavior type)
static CL_SimpleSegmentType getDefaultSegmentType()
GLboolean GLboolean GLboolean GLboolean a
GLuint GLsizei GLsizei * length
UT_StringHolder getSegmentExpression(int index) const
void setPreType(CL_ChannelBehavior type)
fpreal getDisabledValue() const
GLfloat GLfloat GLfloat v2
GLfloat GLfloat GLfloat GLfloat v3
void setStart(fpreal start)
fpreal getEndValue() const
const UT_Array< UT_Vector2R > & getDisableSegments() const
constexpr auto in(type t, int set) -> bool
UT_SharedPtr< const CL_SimpleChannel > CL_SimpleChannelConstPtr
const CL_SimpleSegment & getSegment(int index) const
void setType(CL_SimpleSegmentType type)
GLint GLint GLsizei GLint GLenum GLenum type
void setDefaultValue(fpreal value)
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
int getSegmentInSlopeAuto(int index) const
void setSegmentInSlopeAuto(int index, bool value)
void setSegmentOutSlopeAuto(int index, bool value)
void setSegmentExpression(int index, const UT_StringHolder &expr)
fpreal localTime(fpreal t) const
fpreal getTolerance() const
void setExtraData(int index, fpreal data)
void setPreSlope(fpreal slope)
HUSD_API bool eval(VtValue &val, T &ret_val)
GLboolean GLboolean GLboolean b
CL_SimpleSegmentType getType() const
fpreal getDefaultValue() const
void setPreValue(fpreal value)
UT_SharedPtr< CL_SimpleChannel > CL_SimpleChannelPtr
static CL_SimpleSegmentType getDefaultSegmentSplitType()
fpreal evalP(fpreal u) const
SIM_API const UT_StringHolder force
GLenum GLsizei GLsizei GLint * values
static void setChannelTolerance(fpreal tol)
CL_ChannelBehavior getPostType() const
fpreal getPreValue() const
static fpreal getChannelTolerance()
LeafData & operator=(const LeafData &)=delete
void setPostSlope(fpreal slope)
fpreal globalTime(fpreal t) const
int getSegmentOutSlopeAuto(int index) const
fpreal getPreSlope() const
void OIIO_UTIL_API split(string_view str, std::vector< string_view > &result, string_view sep=string_view(), int maxsplit=-1)
fpreal getPostValue() const
static bool getAutoSplit()
GA_API const UT_StringHolder segs
CL_SimpleSegment & getSegment(int index)
void setDisabledValue(fpreal value)
void setPostValue(fpreal value)
fpreal getStartValue() const