12 #ifndef __CH_Manager_h__
13 #define __CH_Manager_h__
63 class CH_ScriptAccessManager;
67 class CH_UndoScopeChannels;
96 virtual
void changed() = 0;
120 bool scopeChannelInternal(
const CH_Channel *chp,
bool on_off);
121 bool scopeChannelInternal(
const CH_ChannelRef &chref,
bool on_off);
123 void scopeChannel(
const char *full_chan_path,
bool on_off);
124 void unscopeChannelsWithNodeId(
int node_id,
bool force=
false);
127 void scopeChanged(
unsigned flags,
bool propagate=
true );
128 void scopeChanged(
unsigned flags,
bool propagate,
133 bool isChannelScoped(
const char *full_chan_path)
const;
139 bool isChannelDisplayed(
CH_Channel *chp)
const;
141 bool isChannelDisplayed(
const char *full_chan_path )
const;
142 void clearDisplayedChannels(
bool propagate =
true );
143 void displayAllScopedChannels(
bool propagate =
true );
144 void displaySelectedScopedChannels(
bool propagate =
true );
147 bool propagate =
true );
148 void displayChannel(
const char *full_chan_path,
149 bool propagate =
true );
151 bool propagate =
true );
152 void undisplayChannel(
const char *full_chan_path,
153 bool propagate =
true );
154 void undisplayChannelsWithNodeId(
int node_id,
bool force=
false);
159 bool isChannelSelected(
const char *full_chan_path )
const;
160 void clearSelectedChannels(
bool propagate =
true );
161 void selectAllScopedChannels(
bool propagate =
true );
164 bool propagate =
true );
165 void selectChannel(
const char *full_chan_path,
166 bool propagate =
true );
168 bool propagate =
true );
169 void deselectChannel(
const char *full_chan_path,
170 bool propagate =
true );
175 void togglePinAllScopedChannels();
177 void pinAllScopedChannels(
bool propagate =
true );
178 void unpinAllScopedChannels(
bool propagate =
true );
179 void pinSelectedChannels(
bool propagate =
true,
181 void unpinSelectedChannels(
bool propagate =
true,
184 bool propagate =
true );
186 bool propagate =
true );
188 bool propagate =
true );
190 bool propagate =
true );
191 void unpinChannelsWithNodeId(
int node_id,
bool force=
false);
192 void clearPinnedChannels(
bool propagate =
true );
197 void clearLayerScope();
199 bool isLayerScoped(
const char *full_chan_path)
const;
202 void scopeLayer(
const char *full_chan_path,
bool on_off);
203 bool scopeLayerInternal(
CH_Channel *chp,
bool on_off);
204 bool scopeLayerInternal(
const CH_ChannelRef &chref,
bool on_off);
210 bool isLayerSelected(
const char *full_chan_path)
const;
211 void clearSelectedLayers(
bool propagate =
true);
212 void selectAllScopedLayers(
bool propagate =
true);
214 void selectLayer(
const CH_ChannelRef &chref,
bool propagate=
true);
215 void selectLayer(
const char *full_chan_path,
bool propagate=
true);
216 void deselectLayer(
const CH_ChannelRef &chref,
bool propagate=
true);
217 void deselectLayer(
const char *full_chan_path,
bool propagate=
true);
222 void togglePinAllScopedLayers();
224 void pinAllScopedLayers(
bool propagate =
true );
225 void unpinAllScopedLayers(
bool propagate =
true );
226 void pinSelectedLayers(
bool propagate =
true,
228 void unpinSelectedLayers(
bool propagate =
true,
231 bool propagate =
true );
233 bool propagate =
true );
235 bool propagate =
true );
237 bool propagate =
true );
238 void clearPinnedLayers(
bool propagate =
true );
244 bool isLayerDisplayed(
const char *full_chan_path )
const;
245 void clearDisplayedLayers(
bool propagate =
true );
246 void displayAllScopedLayers(
bool propagate =
true );
247 void displaySelectedScopedLayers(
bool propagate =
true );
250 bool propagate =
true );
251 void displayLayer(
const char *full_chan_path,
252 bool propagate =
true );
254 bool propagate =
true );
255 void undisplayLayer(
const char *full_chan_path,
256 bool propagate =
true );
261 bool isGraphSelected(
const char *full_chan_path )
const;
262 void clearGraphSelected(
bool propagate =
true );
264 bool propagate =
true );
265 void selectGraph(
const char *full_chan_path,
266 bool propagate =
true );
268 bool propagate =
true );
269 void deselectGraph(
const char *full_chan_path,
270 bool propagate =
true );
280 bool propagate =
true );
285 bool propagate =
true );
288 unsigned getChannelFlags(
const CH_ChannelRef &chref )
const;
293 void clearChannelScope(
bool clear_all_tables=
false);
299 int getNumScopedChanRefs();
302 int getNumScopedChanRefs(
bool filtered);
309 bool sorted=
false)
const;
313 void getScopedChannelsKeyFrames(
UT_IntArray &frames,
314 int minframe,
int maxframe);
316 bool hasScopedChannels();
321 FilterAnimationLayers = 1,
329 { myEnableFilter[filter_type] =
b; }
331 {
return myEnableFilter[filter_type]; }
334 { myFilter[filter_type] =
f;}
336 {
return myFilter[filter_type]; }
339 { myFilterTranlates =
b;}
341 {
return myFilterTranlates; }
344 { myFilterRotates =
b;}
346 {
return myFilterRotates; }
349 { myFilterScales =
b;}
351 {
return myFilterScales; }
354 { myFilterParmLabels[filter_type] =
b;}
356 {
return myFilterParmLabels[filter_type]; }
359 { myFilterFullNames[filter_type] =
b;}
361 {
return myFilterFullNames[filter_type]; }
363 void setFilterDirty(
FilterType filter_type,
bool propagate=
true);
368 bool hasFilter()
const;
370 void clearInvalidChannels();
372 void dirtySort(
bool propagate=
true);
391 mutable int myNumScopedChannels;
392 mutable int myTotalScopedChannels;
398 struct ChannelListWrap
404 ChannelListWrap myFiltered[NumFilterType];
406 bool myEnableFilter[NumFilterType];
407 bool myFilterParmLabels[NumFilterType];
408 bool myFilterFullNames[NumFilterType];
409 bool myIsFiltered[NumFilterType];
410 bool myFilterTranlates;
411 bool myFilterRotates;
427 bool myAllowExternal;
448 , myIsGlobal(src.myIsGlobal)
468 myIsGlobal = src.myIsGlobal;
479 void removeInterest();
493 CH_ON_COLLISION_ASSERT
494 } CollisionBehaviour;
497 CH_EXPANSION_TYPE_EXPRESSION = 1,
498 CH_EXPANSION_TYPE_VARIABLE = 1 << 1,
499 CH_EXPANSION_TYPE_TILDE = 1 << 2,
500 CH_EXPANSION_TYPE_NO_COMMENTS = 1 << 3,
501 CH_EXPANSION_TYPE_NO_RAWSTRINGS = 1 << 4,
502 CH_EXPANSION_TYPE_DEFAULT = CH_EXPANSION_TYPE_EXPRESSION |
503 CH_EXPANSION_TYPE_VARIABLE |
504 CH_EXPANSION_TYPE_TILDE,
513 static constexpr
int CH_SCOPE_REPLACED = 0;
514 static constexpr
int CH_SCOPE_FILTERED = 1;
519 CH_Manager(
bool init_the_expression_library =
true);
520 virtual ~CH_Manager();
526 virtual
void aboutToDelete();
529 static CH_Manager *getContext()
535 virtual void setContext();
539 void resetPlayback();
541 void resetChannelOptions(
bool notify =
true);
542 bool loadChannelOptions(
const char *
filename );
543 bool saveChannelOptions(
const char *
filename );
545 void setDefaultExpression(
const char *
s,
bool notify =
false);
548 {
return (
const char *)myDefaultExpression; }
550 {
return myShouldShowFakeAccelHandles; }
554 myDefaultRotationExpression.harden(s);
557 {
return (
const char *)myDefaultRotationExpression;}
561 {
return myAutoSlope; }
563 { myDefaultSlope = slope; }
565 {
return myDefaultSlope; }
566 void setAutoSplit(
bool onoff);
568 {
return myAutoSplit; }
569 void setDefaultSplitExpression(
const char *expr);
572 {
return (
const char *)myDefaultSplitExpression; }
575 { myHoldLastKey = onoff; }
577 {
return myHoldLastKey; }
579 {
return (
const char *)myChanCreateKeyExpression; }
581 { myChanCreateKeyExpression.harden(s ? s :
""); }
583 {
return myAlwaysCommitKey; }
585 { myAlwaysCommitKey = onoff; }
595 void clearChannelScope();
603 int getNumScopedChanRefs()
604 {
return myScopedChannels.getNumScopedChanRefs(); }
612 bool sorted=false) const;
622 void getScopedChannelsKeyFrames(
UT_IntArray &frames,
623 int minframe,
int maxframe);
627 void blockModifyScope(
int on_off);
635 void scopeChannel(const
char *full_chan_path,
bool on_off);
637 bool scopeChannelInternal(const
CH_Channel *chp,
bool on_off);
639 bool scopeChannelInternal(const
CH_ChannelRef &chref,
bool on_off);
641 virtual
void getChannelsWithNodeId(
CH_ChannelList &chans,
int node_id) const;
645 void scopeChanged(
unsigned flags,
bool propagate=true );
651 bool isChannelScoped(const
char *full_chan_path) const;
658 void clearPendingChannels();
660 bool hasPendingChannels() const;
670 bool isChannelDisplayed(
CH_Channel *chp) const;
674 bool isChannelDisplayed( const
char *full_chan_path ) const;
676 void clearDisplayedChannels(
bool propagate = true );
678 void displayAllScopedChannels(
bool propagate = true );
680 void displaySelectedScopedChannels(
bool propagate = true );
684 bool propagate = true );
686 void displayChannel( const
char *full_chan_path,
687 bool propagate = true );
690 bool propagate = true );
692 void undisplayChannel( const
char *full_chan_path,
693 bool propagate = true );
701 bool isChannelSelected( const
char *full_chan_path ) const;
703 void clearSelectedChannels(
bool propagate = true );
705 void selectAllScopedChannels(
bool propagate = true );
709 bool propagate = true );
711 void selectChannel( const
char *full_chan_path,
712 bool propagate = true );
715 bool propagate = true );
717 void deselectChannel( const
char *full_chan_path,
718 bool propagate = true );
724 void togglePinAllScopedChannels();
728 void pinAllScopedChannels(
bool propagate = true );
730 void unpinAllScopedChannels(
bool propagate = true );
732 void pinSelectedChannels(
bool propagate = true,
733 int operate_on = CH_SELECTED );
735 void unpinSelectedChannels(
bool propagate = true,
736 int operate_on = CH_SELECTED );
739 bool propagate = true );
742 bool propagate = true );
747 void clearLayerScope();
751 bool isLayerScoped(const
char *full_chan_path) const;
757 void scopeLayer(const
char *full_chan_path,
bool on_off);
759 bool scopeLayerInternal(
CH_Channel *chp,
bool on_off);
761 bool scopeLayerInternal(const
CH_ChannelRef &chref,
bool on_off);
769 bool isLayerSelected( const
char *full_chan_path ) const;
771 void clearSelectedLayers(
bool propagate = true );
773 void selectAllScopedLayers(
bool propagate = true );
776 void selectLayer( const
CH_ChannelRef &chref,
bool propagate = true );
778 void selectLayer( const
char *full_chan_path,
bool propagate = true );
780 void deselectLayer( const
CH_ChannelRef &chref,
bool propagate = true );
782 void deselectLayer( const
char *full_chan_path,
bool propagate = true );
788 void togglePinAllScopedLayers();
792 void pinAllScopedLayers(
bool propagate = true );
794 void unpinAllScopedLayers(
bool propagate = true );
796 void pinSelectedLayers(
bool propagate = true,
int operate_on =
CH_LAYER_SELECTED );
798 void unpinSelectedLayers(
bool propagate = true,
int operate_on = CH_LAYER_SELECTED );
811 bool isLayerDisplayed( const
char *full_chan_path ) const;
813 void clearDisplayedLayers(
bool propagate = true );
815 void displayAllScopedLayers(
bool propagate = true );
817 void displaySelectedScopedLayers(
bool propagate = true );
821 bool propagate = true );
823 void displayLayer( const
char *full_chan_path,
824 bool propagate = true );
827 bool propagate = true );
829 void undisplayLayer( const
char *full_chan_path,
830 bool propagate = true );
836 bool propagate = true );
838 unsigned getChannelFlags( const
CH_ChannelRef &chref ) const;
846 int expandString(const
char *
string,
UT_String &expanded,
849 int expansion_type = CH_EXPANSION_TYPE_DEFAULT,
851 context_options_stack =
nullptr,
855 void buildStringOpDependencies( const
char *str,
void *ref_id,
862 bool scanForVariableInString(const
char *variable,
863 const
char *
string) const;
865 const
char *new_fullpath,
866 const
char *old_fullpath,
868 const
char *chan_name,
869 const
char *old_chan_name,
880 context_options_stack =
nullptr,
881 DEP_ContextOptionsReadHandle context_options =
882 DEP_ContextOptionsReadHandle());
888 context_options_stack =
nullptr,
889 DEP_ContextOptionsReadHandle context_options =
890 DEP_ContextOptionsReadHandle());
894 static
void evaluationError(
int err,
int thread, const
char *
path);
905 bool getIsSettingGlobalParam()
const
906 {
return (mySettingGlobalParam > 0); }
907 void getGlobalParamF(
const char *token,
CH_Collection *scope,
909 bool add_dependencies );
910 void getGlobalParamS(
const char *token,
CH_Collection *scope,
912 int thread,
bool add_dependencies );
917 void getGlobalParamAnyScopeF(
const char *token,
CH_Collection *scope,
919 bool add_dependencies );
920 void getGlobalParamAnyScopeS(
const char *token,
CH_Collection *scope,
922 int thread,
bool add_dependencies );
924 int setGlobalFloatParam(
const char *token,
927 int setGlobalStringParam(
const char *token,
932 void dumpGlobalParams(std::ostream &out)
const;
936 void dirtyOrphanGlobalParamDependents(
const char *token,
944 {
return (mySettingGuideParam > 0); }
952 CH_Group *findGroup(
const char *const_path,
bool create =
false,
955 const char *
pattern,
bool minimal );
967 bool propagate =
true);
968 void updateGroupSelectionFromScoped(
void *by,
969 bool propagate =
true);
970 void updateCurrentGroup(
CH_Group *group,
972 bool propagate =
true);
973 void enforceLeafOnlyChannels(
CH_Group *group,
974 const char *
name=
"new_group");
977 CH_Group *createGroup(
const char *const_path,
978 bool do_rename =
true,
980 void renameGroup(
CH_Group *group,
const char *newname);
984 void extractGroup(
CH_Group *group, CollisionBehaviour cb );
987 void collapseChildren(
CH_Group *parent );
993 CollisionBehaviour cb,
994 const char *new_name =
nullptr );
996 CollisionBehaviour cb,
997 const char *new_name =
nullptr );
999 CollisionBehaviour cb );
1001 CollisionBehaviour cb );
1006 void channelCreated(
const CH_Channel *chp );
1007 void channelDeleted(
const CH_Channel *chp );
1014 bool include_temporary=
false);
1018 bool remove_existing =
true);
1024 static bool couldExpandString(
const char *str);
1028 {
return myDefaultExprLanguage; }
1030 { myDefaultExprLanguage = language; }
1034 {
return p == &myScopedChannels; }
1038 {
return myScopedChannels; }
1040 {
return myScopedChannels; }
1045 bool include_global,
bool include_pinned);
1047 bool include_global,
bool include_pinned)
const;
1049 bool hasExternalCollection(
const CH_Collection *collection)
const;
1054 void scopeExternalCollection(
CH_Collection *collection,
bool on_off=
true);
1067 CH_Channel *getExternalChannel(
const char *collection,
1068 const char *
name)
const;
1079 exint globExternalChannels(
1085 {
return myExternalCollections; }
1088 void timeGroupsChanged();
1090 bool do_rename=
true,
1093 void destroyTimeGroup(
int i);
1095 const char *newname,
1102 int getTimeGroupIdx(
const char *
name )
const;
1106 void bookmarksChanged(
1111 {
return myBookmarksMicroNode; }
1114 bool create_undo =
true);
1123 bool notify =
true);
1125 void destroyBookmark(
int index,
bool create_undo =
true,
1126 bool notify =
true);
1127 void destroyBookmarks(
1129 bool create_undo =
true,
1130 bool notify =
true);
1133 bool create_undo =
true,
1134 bool notify =
true);
1139 void frameBookmark(
int index,
1140 bool store_previous_range =
true);
1143 bool store_previous_range =
true);
1145 void clearBookmarks();
1151 void setMostRecentBookmark(
CH_Bookmark *bookmark);
1154 void setLeastRecentBookmark(
CH_Bookmark *bookmark);
1160 int getFramedBookmarkIndex()
const;
1167 {
return myBookmarks(i).get(); }
1178 {
return myRecentBookmarks; }
1183 static inline fpreal niceNumber(
fpreal num,
int digits=6);
1188 int niceFrameSeparation(
fpreal initial_sep,
1189 int minimum_sep = 1)
const;
1204 static fpreal getDefaultFPS();
1207 static int getDefaultChopMotionSamples();
1210 void setRawNumSamples(
int n,
bool notify =
true);
1212 void setSamplesPerSec(
fpreal fps,
bool notify =
true);
1214 void setRawSamplesPerSec(
fpreal fps,
bool notify =
true);
1216 void setChopMotionSamples(
int n,
bool notify =
true);
1221 {
return getFrame( myStart ); }
1223 {
return getFrame( myEnd ); }
1228 void setGlobalStart(
fpreal start,
bool notify =
true);
1239 return ((sample-1.0)/myFPS);
1249 return niceNumber(getSampleRaw(t));
1254 return (
int)
SYSfloor(getSampleRaw(t+getTolerance()));
1259 return sample_delta/myFPS;
1264 return time_delta*myFPS;
1269 return getTime(
SYSrint( getSampleRaw(t) ) );
1275 return getTime(getSnapSubsample(getSampleRaw(t)));
1290 return SYSrint((frame - getGlobalStartFrame())
1291 * (1.0 / mySampleStep))
1292 * mySampleStep + getGlobalStartFrame();
1306 snaptime = getSnapToFrameTime( t );
1307 return SYSisEqual(t, snaptime, getTolerance());
1319 void setIntegerFrameFlag(
int flag,
bool notify =
true);
1322 void setRestrictRangeFlag(
int flag,
bool notify =
true);
1325 void setShowRangeFlag(
int flag,
bool notify =
true);
1328 void setShowTicksFlag(
int flag,
bool notify =
true);
1331 void setShowAudioFlag(
int flag,
bool notify =
true);
1334 void setShowKeysFlag(
int flag,
bool notify =
true);
1337 void setShowBookmarksFlag(
int flag,
bool notify =
true);
1340 void setShowSimCacheFlag(
int flag,
bool notify =
true,
bool pref =
false);
1343 void setShowAnimCacheFlag(
int flag,
bool notify =
true,
bool pref =
false);
1346 void setShowAnimBarFlag(
int flag,
bool notify =
true);
1355 void parseUnitsString(
const char *
units,
1358 fpreal scaleToMKS(
const char *fromunits)
const;
1359 fpreal scaleFromMKS(
const char *tounits)
const;
1362 void setRealTimeFlag(
int flag,
bool notify =
true);
1364 void setRealTimeFactor(
fpreal f,
bool notify =
true);
1366 void setRealTimeDisableSkip(
bool b,
bool notify =
true);
1368 void setSampleStep(
fpreal s,
bool notify =
true);
1372 start = myRangeStart;
1381 int saveChannels(
const char *
filename,
bool binary,
bool compiled,
1383 bool displayed =
false)
const;
1384 int loadChannels(
const char *
filename,
1385 const char *src_pattern,
1386 const char *dest_pattern,
1391 bool delete_keys =
false,
1393 static bool readCHNFileHeader(
UT_IStream &is,
bool quiet,
1397 static bool skipCHNFileHeaderForCollection(
UT_IStream &is,
bool &is_fp64);
1398 static bool getFileType(
const char *
filename,
int &raw,
int &
binary );
1399 static bool printFileInfo(std::ostream &os,
const char *
filename,
1401 bool print_segments=
true );
1422 evalContext(thread).myCollection =
g;
1424 evalContext(thread).myChannel =
nullptr;
1425 evalContext(thread).mySegment =
nullptr;
1426 evalContext(thread).myChannelName =
nullptr;
1437 return evalContext(thread).myCollection;
1444 { myRootCollection = root; }
1446 {
return myRootCollection; }
1453 {
return myEvalContext.getValueForThread(thread); }
1457 {
return myEvalContext.getValueForThread(thread); }
1460 {
return evalContext(thread).myChannel; }
1462 {
return evalContext(thread).mySegment; }
1464 {
return evalContext(thread).myChannelName; }
1467 {
return evalContext(thread).myContextOptionsStack; }
1470 {
return evalContext(thread).myContextOptions; }
1475 {
return evalContext(thread).time(); }
1477 { evalContext(thread).setTime(time); }
1479 { evalContext(thread).setFlicks(fl); }
1495 bool getVariableValue(
UT_String &str,
int i,
1497 bool getVariableValue(
fpreal &
val,
int i,
1501 bool getVariableValue(
int &
val,
int i,
int thread)
const;
1504 virtual bool getVariableString(
const char *
name,
1517 static void lookupVariableNoThread(
const char *
name,
1521 static void lookupExpressionNoThread(
const char *
name,
1542 const char *
path)
const;
1563 bool use_alias=
false)
const;
1565 virtual bool isChanRefValid(
const CH_ChannelRef &chref)
const;
1567 void changeReferencesToNodeId(
int old_id,
int new_id);
1573 void removeReferencesToNodeId(
int node_id);
1575 void displayScope()
const;
1589 {
return myAutoKeyTuples; }
1591 { myAutoKeyTuples=
b; }
1596 {
return mySetAutoScopeOnChannelCreate; }
1598 { mySetAutoScopeOnChannelCreate=
b; }
1603 {
return myKeepChannelSelection; }
1605 { myKeepChannelSelection=
b; }
1610 {
return myAutoScopeIncludeAnimated; }
1612 { myAutoScopeIncludeAnimated=
b; }
1616 {
return myFollowScopedChannelReferences; }
1618 { myFollowScopedChannelReferences=
b; }
1631 fpreal evalCycleOffsetFunc(
1633 fpreal evalCycleOffsettFunc(
1660 {
return myAutoScopeIncludeChild; }
1662 { myAutoScopeIncludeChild=
b; }
1667 {
return myAutoScopeIncludeConstraints; }
1669 { myAutoScopeIncludeConstraints=
b; }
1677 {
return myDefaultContextOptions; }
1680 bool shouldSetGlobalContextOptionDependency(
1683 void addContextOptionDependency(
1685 bool set_dependency_on_global,
1687 void setDefaultContextOption(
1691 void setDefaultContextOption(
1697 void setDefaultContextOptionUiConfig(
1700 void removeDefaultContextOption(
1703 void clearDefaultContextOptions(
bool create_undo);
1704 bool saveDefaultContextOptions(std::ostream &os)
const;
1705 bool loadDefaultContextOptions(
UT_IStream &is);
1706 int addDefaultContextOptionCallback(
1708 void removeDefaultContextOptionCallback(
int id);
1709 bool isAutomaticContextOption(
1711 bool isAutomaticContextOptionOverridden(
1713 void pushRopCookContextOptions();
1714 void pushRopCookContextOptions(
bool ropcook,
1720 void resetRopCookContextOptions();
1721 void updateRopCookContextOptions(
bool ropcook,
1727 void popRopCookContextOptions();
1732 void setChannelChanged( CH_ChannelChanged *mgr );
1733 CH_ChannelChanged *getChannelChanged();
1734 void triggerChannelChanged();
1747 {
return myIgnoreUpdateScopeFlag; }
1749 { myIgnoreUpdateScopeFlag = onoff; }
1751 static int getSimpleSegmentTypeFromExpression(
const char *expr);
1763 void setTolerance(
fpreal tol);
1765 void initExpressionLibrary();
1769 void initLibraryGlue();
1778 void destroyExternalCollection(
1785 void internalScopeChanged(
unsigned flags,
1786 bool propagate=
true,
1787 const int &reason = CH_SCOPE_REPLACED);
1789 void playbackChanged();
1791 void handleGroupCollision(
CH_Group *new_group,
1793 CollisionBehaviour cb );
1795 void destroyContents();
1796 int internalSetGlobalParam(
const char *token,
1799 int setSingleGlobalParam(
const char *token,
1802 void internalDirtyOrphanGlobalParamDependents(
1807 void propagateDefaultContextOptionDirtied(
1810 static char *chExprExpander(
const char *str,
int thread);
1816 bool operator==(
const chParamKey &key)
const;
1828 {
return key.hash(); }
1877 chParamData *findGlobalParam(
const char *token,
1879 chParamData *findOrCreateGlobalParam(
1881 fpreal fval,
const char *sval);
1883 int mySettingGlobalParam;
1885 int mySettingGuideParam;
1887 int myChopMotionSamples;
1889 unsigned myGroupsSorted:1,
1892 myRealTimeDisableSkip:1,
1901 myShowSimCachePref:1,
1903 myShowAnimCachePref:1,
1906 mySetAutoScopeOnChannelCreate:1,
1907 myKeepChannelSelection:1,
1908 myAutoScopeIncludeAnimated:1,
1909 myFollowScopedChannelReferences:1,
1910 myAutoScopeIncludeChild:1,
1911 myAutoScopeIncludeConstraints:1;
1913 short myRawInterpFlag;
1916 bool myShouldShowFakeAccelHandles;
1920 SlopeMode myAutoSlope;
1924 bool myAlwaysCommitKey;
1937 int myBlockModifyScope;
1938 unsigned myPendingScopeChange;
1939 bool myPendingChannelChanged;
1942 CH_ChannelChanged *myChannelChanged;
1947 myDefaultContextOptionCallbacks;
1948 int myNextDefaultContextOptionCallbackId;
1950 bool myIgnoreUpdateScopeFlag;
1952 mutable UT_Lock myPendingChannelsLock;
1954 static CH_Manager *theManager;
1959 static constexpr
exint CH_SAMPLES_PER_FRAME = 1000;
1963 friend class CH_UndoScopeChannels;
1978 : myContext(chman.evalContext(thread))
1979 , myCollection(nullptr)
1980 , myPopCollection(false)
1981 , myPopContextOptions(false)
1983 #if defined(CH_USE_FLICKS)
1984 myFlicks = myContext.flicks();
1986 mySeconds = myContext.time();
1988 myContext.setTime(time);
1991 myPopCollection =
true;
1992 myCollection = myContext.myCollection;
1993 myContext.myCollection = ch;
1995 if (!context_options.isNull())
1997 myPopContextOptions =
true;
1998 myContextOptionsStack = myContext.myContextOptionsStack;
1999 myContext.myContextOptionsStack = context_options_stack;
2000 myContextOptions = myContext.myContextOptions;
2001 myContext.myContextOptions = context_options;
2007 #if defined(CH_USE_FLICKS)
2008 myContext.setFlicks(myFlicks);
2010 myContext.setTime(mySeconds);
2012 if (myPopCollection)
2013 myContext.myCollection = myCollection;
2014 if (myPopContextOptions)
2016 myContext.myContextOptionsStack = myContextOptionsStack;
2017 myContext.myContextOptions = myContextOptions;
2028 #if defined(CH_USE_FLICKS)
2033 bool myPopCollection;
2034 bool myPopContextOptions;
2045 : myContext(
CH_Manager::getContext()->evalContext(thread))
2047 myCollection = myContext.myCollection;
2049 myContext.myCollection = collection;
2053 return myContext.myCollection;
2058 myContext.myCollection = collection;
2062 myContext.myCollection = myCollection;
2079 CH_ActiveLayerContrib();
2080 ~CH_ActiveLayerContrib();
2112 : myOwner(owner), myChanRef(ref), myFlags(flags)
2160 return (
SYSrint(num * scale) / scale);
fpreal getSampleDelta(fpreal time_delta) const
CH_ScopedChannelsBase(CH_Manager *mgr)
fpreal getRealTimeFactor() const
bool SYSisEqual(const UT_Vector2T< T > &a, const UT_Vector2T< T > &b, S tol)
Componentwise equality.
void setFilterRotates(bool b)
CH_API void CHsortChannelRefs(CH_ChannelRefList &channels)
int getShowAnimCacheFlag() const
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)
GLenum GLuint GLenum GLsizei const GLchar * buf
DEP_ContextOptionsHandle getDefaultContextOptions() const
fpreal getSnapToSubframeTime(fpreal t) const
GT_API const UT_StringHolder filename
bool getAutoScopeIncludeConstraints() const
#define UT_AT_SCOPE_EXIT(...)
const char * getEvalChannelName(int thread) const
fpreal getSnapToFrameTime(fpreal t) const
fpreal getSecsPerSample() const
CH_ScopedChannels(const CH_ScopedChannels &src)
CH_API fpreal CHgetTimeFromFrame(fpreal frame)
Returns the time given a floating point frame.
bool isGlobalScopedChannels(CH_ScopedChannelsBase *p)
#define SYS_DEPRECATED(__V__)
void setAutoScopeOnChannelCreate(bool b)
CH_API fpreal CHgetSampleFromTime(fpreal time)
SYS_FORCE_INLINE CH_Manager * ourManager() const
virtual ~CH_ChannelColorManager()
void setAutoScopeIncludeChild(bool b)
*get result *(waiting if necessary)*A common idiom is to fire a bunch of sub tasks at the and then *wait for them to all complete We provide a helper class
const DEP_ContextOptionsStack * getEvalChannelContextOptionsStack(int thread) const
void setEnableFilter(FilterType filter_type, bool b)
void setAutoScopeIncludeConstraints(bool b)
fpreal getUnitLength() const
GT_API const UT_StringHolder time
bool(* CH_StringVarEvalFunc)(UT_String &val, int varid, int thread)
void setHoldFlag(int flag)
GLsizei const GLfloat * value
bool(* CH_IntVarEvalFunc)(int &val, int varid, int thread)
const GLuint GLenum const void * binary
GLsizei const GLchar *const * path
void setFilterParmLabels(FilterType filter_type, bool b)
bool getKeepChannelListSelection() const
const UT_StringMap< UT_UniquePtr< CH_Collection > > & getExternalCollections() const
bool getAutoScopeOnChannelCreate() const
fpreal getSampleRaw(fpreal t) const
const CH_TimeGroup * getTimeGroup(int i) const
std::size_t SYS_HashType
Define the type for hash values.
fpreal getSnapSample(fpreal frame) const
void setEvalCollection(CH_Collection *g, int thread)
int getShowSimCacheFlag() const
bool getFilterFullNames(FilterType filter_type) const
JSON reader class which handles parsing of JSON or bJSON files.
CH_API void CHsortChannelPaths(UT_StringArray &channel_paths)
CH_API void CHoutputChannelList(UT_WorkBuffer &info, CH_ChannelList &channels)
void setFilterScales(bool b)
bool getAutoScopeIncludeChild() const
Selectively extract and filter point data using a custom filter operator.
CH_API void CHbuildRange(int start, int end, UT_SuperIntervalR &r)
Builds a UT_SuperIntervalR given integer start and end frames.
Class which writes ASCII or binary JSON streams.
fpreal getTimeDelta(fpreal sample_delta) const
fpreal getTimeCodeOffset(fpreal) const
CH_Tweener * getChannelTweener()
void setFilter(FilterType filter_type, const UT_StringHolder &f)
**But if you need a result
bool getEnableFilter(FilterType filter_type) const
bool getIsSettingGuideParam() const
int getRealTimeFlag() const
CH_ScopeUndo(CH_ScopedChannels *owner, const CH_ChannelRef &ref, unsigned flags)
UT_Function< void(const UT_StringHolder &)> CH_DefaultContextOptionCallback
fpreal getSnapSubsample(fpreal frame) const
bool shouldShowFakeAccelHandles() const
const CH_EvalContext & evalContext(int thread) const
int getHoldLastKey() const
void setAutoScopeIncludeAnimated(bool b)
int getShowKeysFlag() const
virtual void beginChannelChanges()
fpreal getUnitMass() const
static bool getContextExists()
void setUnitMass(fpreal unitmass)
bool getRealTimeDisableSkip() const
SlopeMode getAutoSlope() const
virtual void channelsChanged()
DEP_MicroNode & getBookmarksMicroNode()
void setChanCreateKeyExpression(const char *s)
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
void setFollowScopedChannelReferences(bool b)
CH_AutoEvalCollection(int thread, CH_Collection *collection=nullptr)
#define SYS_DEPRECATED_REPLACE(__V__, __R__)
int getGlobalEndFrame() const
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
virtual void endChannelChanges()
GA_API const UT_StringHolder scale
bool getFollowScopedChannelReferences() const
int getNTimeGroups() const
CH_Bookmark * getBookmark(int i)
void getSampleRange(fpreal &start, fpreal &end)
int getFrame(fpreal t) const
fpreal getSampleStep() const
CH_API void CHsortLayerRefs(CH_ChannelRefList &channels)
int getShowBookmarksFlag() const
bool getAutoScopeIncludeAnimated() const
int getRawInterpolation()
CH_AutoEvaluateTime(CH_Manager &chman, int thread, fpreal time, CH_Collection *ch=nullptr, const DEP_ContextOptionsStack *context_options_stack=nullptr, DEP_ContextOptionsReadHandle context_options=DEP_ContextOptionsReadHandle())
CH_Manager * CHgetManager()
fpreal getGlobalStart() const
fpreal getSample(fpreal t) const
CH_ScopedChannels & operator=(const CH_ScopedChannels &src)
int getIntegerFrameFlag() const
const CH_Segment * getEvalSegment(int thread) const
bool getAutoKeyTuples() const
Auto-Key all Tuples is a preference to key tuples together.
DEP_ContextOptionsReadHandle getEvalChannelContextOptions(int thread) const
void setRootCollection(CH_Collection *root)
fpreal getSamplesPerSec() const
const CH_Bookmark * getBookmark(int i) const
constexpr auto set(type rhs) -> int
int getRestrictRangeFlag() const
void setDefaultSlope(fpreal slope)
int getNBookmarks() const
GLsizei GLsizei GLchar * source
void setEvaluateTime(SYS_Flicks fl, int thread)
Functions for obtaining and setting the current evaluation time.
void setAllowExternal(bool allow)
CH_EvalContext & evalContext(int thread)
SYS_API fpreal32 SYSfloor(const fpreal32 val)
CH_API void CHchannelsToCollections(CH_ChannelList const &channels, CH_CollectionList &collections)
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
const CH_Channel * getEvalChannel(int thread) const
#define checkPtr(ptr, msg)
void setRawInterpolation(int state)
CH_API void CHdisplayFlags(unsigned flags, std::ostream &s)
void setFilterFullNames(FilterType filter_type, bool b)
fpreal getGlobalEnd() const
void setDefaultExprLanguage(CH_ExprLanguage language)
bool getIgnoreUpdateScopeFlag() const
fpreal getAudioLevel() const
GLuint const GLchar * name
CH_Collection * collection() const
CH_API int CHgetFrameFromTime(fpreal time)
void setAudioLevel(fpreal lvl)
CH_ExprLanguage getDefaultExprLanguage()
const UT_StringHolder & getFilter(FilterType filter_type) const
void setAutoSlope(SlopeMode m)
std::function< T > UT_Function
GLboolean GLboolean GLboolean b
bool getAllowExternal() const
SYS_FORCE_INLINE UT_StringHolder getToken(Add enum_value)
fpreal getDefaultSlope() const
static CH_Manager * getContext()
int getShowAnimBarFlag() const
int getShowAudioFlag() const
bool getIsAtFrame(fpreal t) const
int getShowRangeFlag() const
const char * getDefaultExpression() const
GT_API const UT_StringHolder version
void setDefaultRotationExpression(const char *s)
const CH_ScopedChannels & getGlobalScopedChannels() const
CH_ScopedChannels * myOwner
fpreal getEvaluateTime(int thread) const
Functions for obtaining and setting the current evaluation time.
CH_Collection * getEvalCollection(int thread) 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
void setUnitLength(fpreal unitlength)
bool getFilterTranslates() const
UT_COWReadHandle< DEP_ContextOptions > DEP_ContextOptionsReadHandle
static fpreal niceNumber(fpreal num, int digits=6)
void setAutoKeyTuples(bool b)
Push & restore the evaluation time (and optionally a channel collection)
int getChopMotionSamples() const
CH_ScopedChannels & getGlobalScopedChannels()
SIM_API const UT_StringHolder force
const char * getDefaultRotationExpression() const
virtual ~CH_ChannelChanged()
SYS_HashType operator()(const chParamKey &key) const
LeafData & operator=(const LeafData &)=delete
void setAlwaysCommitKeyChange(bool onoff)
bool getAutoSplit() const
void setHoldLastKey(bool onoff)
bool getFilterRotates() const
fpreal getNumSamples() const
virtual CH_ScriptAccessManager * getAccessManager(int)
void setTimeCodeOffset(fpreal t)
void setKeepChannelListSelection(bool b)
bool getAlwaysCommitKeyChange() const
void set(CH_Collection *collection)
virtual bool channelsBeingChanged()
fpreal32 SYSrint(const fpreal32 val)
virtual bool getChannelAutoSelect(const CH_ChannelRef &chref) const
CH_TimeGroup * getTimeGroup(int i)
CH_Collection * getRootCollection() const
GLubyte GLubyte GLubyte GLubyte w
bool getFilterParmLabels(FilterType filter_type) const
bool operator!=(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
fpreal getFrameTolerance() const
bool getFilterScales() const
const UT_Array< exint > & getBookmarksOrderByRecentUsage()
const char * getDefaultSplitExpression() const
void setIgnoreUpdateScopeFlag(bool onoff)
bool(* CH_FloatVarEvalFunc)(fpreal &val, int varid, int thread)
void setEvaluateTime(fpreal time, int thread)
Functions for obtaining and setting the current evaluation time.
CH_API int CHgetIntegerFrameFromTime(fpreal time)
int getGlobalStartFrame() const
fpreal getTolerance() const
fpreal getTime(fpreal sample) const
void setFilterTranslates(bool b)
int getShowTicksFlag() const
CH_API void CHsortChannels(CH_ChannelList &channels)
ImageBuf OIIO_API channels(const ImageBuf &src, int nchannels, cspan< int > channelorder, cspan< float > channelvalues={}, cspan< std::string > newchannelnames={}, bool shuffle_channel_names=false, int nthreads=0)
CH_ScopedChannels & CHgetScopedChannels()
const char * getChanCreateKeyExpression() const