12 #ifndef __CH_Manager_h__
13 #define __CH_Manager_h__
64 class CH_ScriptAccessManager;
68 class CH_UndoScopeChannels;
95 virtual
void changed() = 0;
119 bool scopeChannelInternal(
const CH_Channel *chp,
bool on_off);
120 bool scopeChannelInternal(
const CH_ChannelRef &chref,
bool on_off);
122 void scopeChannel(
const char *full_chan_path,
bool on_off);
123 void unscopeChannelsWithNodeId(
int node_id,
bool force=
false);
126 void scopeChanged(
unsigned flags,
bool propagate=
true );
127 void scopeChanged(
unsigned flags,
bool propagate,
132 bool isChannelScoped(
const char *full_chan_path)
const;
138 bool isChannelDisplayed(
CH_Channel *chp)
const;
140 bool isChannelDisplayed(
const char *full_chan_path )
const;
141 void clearDisplayedChannels(
bool propagate =
true );
142 void displayAllScopedChannels(
bool propagate =
true );
143 void displaySelectedScopedChannels(
bool propagate =
true );
146 bool propagate =
true );
147 void displayChannel(
const char *full_chan_path,
148 bool propagate =
true );
150 bool propagate =
true );
151 void undisplayChannel(
const char *full_chan_path,
152 bool propagate =
true );
153 void undisplayChannelsWithNodeId(
int node_id,
bool force=
false);
158 bool isChannelSelected(
const char *full_chan_path )
const;
159 void clearSelectedChannels(
bool propagate =
true );
160 void selectAllScopedChannels(
bool propagate =
true );
163 bool propagate =
true );
164 void selectChannel(
const char *full_chan_path,
165 bool propagate =
true );
167 bool propagate =
true );
168 void deselectChannel(
const char *full_chan_path,
169 bool propagate =
true );
174 void togglePinAllScopedChannels();
176 void pinAllScopedChannels(
bool propagate =
true );
177 void unpinAllScopedChannels(
bool propagate =
true );
178 void pinSelectedChannels(
bool propagate =
true,
180 void unpinSelectedChannels(
bool propagate =
true,
183 bool propagate =
true );
185 bool propagate =
true );
187 bool propagate =
true );
189 bool propagate =
true );
190 void unpinChannelsWithNodeId(
int node_id,
bool force=
false);
191 void clearPinnedChannels(
bool propagate =
true );
196 void clearLayerScope();
198 bool isLayerScoped(
const char *full_chan_path)
const;
201 void scopeLayer(
const char *full_chan_path,
bool on_off);
202 bool scopeLayerInternal(
CH_Channel *chp,
bool on_off);
203 bool scopeLayerInternal(
const CH_ChannelRef &chref,
bool on_off);
209 bool isLayerSelected(
const char *full_chan_path)
const;
210 void clearSelectedLayers(
bool propagate =
true);
211 void selectAllScopedLayers(
bool propagate =
true);
213 void selectLayer(
const CH_ChannelRef &chref,
bool propagate=
true);
214 void selectLayer(
const char *full_chan_path,
bool propagate=
true);
215 void deselectLayer(
const CH_ChannelRef &chref,
bool propagate=
true);
216 void deselectLayer(
const char *full_chan_path,
bool propagate=
true);
221 void togglePinAllScopedLayers();
223 void pinAllScopedLayers(
bool propagate =
true );
224 void unpinAllScopedLayers(
bool propagate =
true );
225 void pinSelectedLayers(
bool propagate =
true,
227 void unpinSelectedLayers(
bool propagate =
true,
230 bool propagate =
true );
232 bool propagate =
true );
234 bool propagate =
true );
236 bool propagate =
true );
237 void clearPinnedLayers(
bool propagate =
true );
243 bool isLayerDisplayed(
const char *full_chan_path )
const;
244 void clearDisplayedLayers(
bool propagate =
true );
245 void displayAllScopedLayers(
bool propagate =
true );
246 void displaySelectedScopedLayers(
bool propagate =
true );
249 bool propagate =
true );
250 void displayLayer(
const char *full_chan_path,
251 bool propagate =
true );
253 bool propagate =
true );
254 void undisplayLayer(
const char *full_chan_path,
255 bool propagate =
true );
260 bool isGraphSelected(
const char *full_chan_path )
const;
261 void clearGraphSelected(
bool propagate =
true );
263 bool propagate =
true );
264 void selectGraph(
const char *full_chan_path,
265 bool propagate =
true );
267 bool propagate =
true );
268 void deselectGraph(
const char *full_chan_path,
269 bool propagate =
true );
279 bool propagate =
true );
284 bool propagate =
true );
287 unsigned getChannelFlags(
const CH_ChannelRef &chref )
const;
292 void clearChannelScope(
bool clear_all_tables=
false);
298 int getNumScopedChanRefs();
301 int getNumScopedChanRefs(
bool filtered);
308 bool sorted=
false)
const;
312 void getScopedChannelsKeyFrames(
UT_IntArray &frames,
313 int minframe,
int maxframe);
315 bool hasScopedChannels();
318 {
return myKeepChannelSelection; }
320 { myKeepChannelSelection =
b;}
325 FilterAnimationLayers = 1,
333 { myEnableFilter[filter_type] =
b; }
335 {
return myEnableFilter[filter_type]; }
338 { myFilter[filter_type] =
f;}
340 {
return myFilter[filter_type]; }
343 { myFilterTranlates =
b;}
345 {
return myFilterTranlates; }
348 { myFilterRotates =
b;}
350 {
return myFilterRotates; }
353 { myFilterScales =
b;}
355 {
return myFilterScales; }
358 { myFilterParmLabels[filter_type] =
b;}
360 {
return myFilterParmLabels[filter_type]; }
363 { myFilterFullNames[filter_type] =
b;}
365 {
return myFilterFullNames[filter_type]; }
367 void setFilterDirty(
FilterType filter_type,
bool propagate=
true);
372 bool hasFilter()
const;
374 void clearInvalidChannels();
376 void dirtySort(
bool propagate=
true);
395 bool myKeepChannelSelection;
396 mutable int myNumScopedChannels;
397 mutable int myTotalScopedChannels;
403 struct ChannelListWrap
409 ChannelListWrap myFiltered[NumFilterType];
411 bool myEnableFilter[NumFilterType];
412 bool myFilterParmLabels[NumFilterType];
413 bool myFilterFullNames[NumFilterType];
414 bool myIsFiltered[NumFilterType];
415 bool myFilterTranlates;
416 bool myFilterRotates;
432 bool myAllowExternal;
453 , myIsGlobal(src.myIsGlobal)
473 myIsGlobal = src.myIsGlobal;
484 void removeInterest();
498 CH_ON_COLLISION_ASSERT
499 } CollisionBehaviour;
502 CH_EXPANSION_TYPE_EXPRESSION = 1,
503 CH_EXPANSION_TYPE_VARIABLE = 1 << 1,
504 CH_EXPANSION_TYPE_TILDE = 1 << 2,
505 CH_EXPANSION_TYPE_NO_COMMENTS = 1 << 3,
506 CH_EXPANSION_TYPE_NO_RAWSTRINGS = 1 << 4,
507 CH_EXPANSION_TYPE_DEFAULT = CH_EXPANSION_TYPE_EXPRESSION |
508 CH_EXPANSION_TYPE_VARIABLE |
509 CH_EXPANSION_TYPE_TILDE,
518 static constexpr
int CH_SCOPE_REPLACED = 0;
519 static constexpr
int CH_SCOPE_FILTERED = 1;
524 CH_Manager(
bool init_the_expression_library =
true);
525 virtual ~CH_Manager();
531 virtual
void aboutToDelete();
534 static CH_Manager *getContext()
540 virtual void setContext();
544 void resetPlayback();
546 void resetChannelOptions(
bool notify =
true);
547 bool loadChannelOptions(
const char *
filename );
548 bool saveChannelOptions(
const char *
filename );
550 void setDefaultExpression(
const char *
s,
bool notify =
false);
553 {
return (
const char *)myDefaultExpression; }
555 {
return myShouldShowFakeAccelHandles; }
559 myDefaultRotationExpression.harden(s);
562 {
return (
const char *)myDefaultRotationExpression;}
566 {
return myAutoSlope; }
568 { myDefaultSlope = slope; }
570 {
return myDefaultSlope; }
571 void setAutoSplit(
bool onoff);
573 {
return myAutoSplit; }
574 void setDefaultSplitExpression(
const char *expr);
577 {
return (
const char *)myDefaultSplitExpression; }
580 { myHoldLastKey = onoff; }
582 {
return myHoldLastKey; }
584 {
return (
const char *)myChanCreateKeyExpression; }
586 { myChanCreateKeyExpression.harden(s ? s :
""); }
588 {
return myAlwaysCommitKey; }
590 { myAlwaysCommitKey = onoff; }
600 void clearChannelScope();
608 int getNumScopedChanRefs()
609 {
return myScopedChannels.getNumScopedChanRefs(); }
617 bool sorted=false) const;
627 void getScopedChannelsKeyFrames(
UT_IntArray &frames,
628 int minframe,
int maxframe);
632 void blockModifyScope(
int on_off);
640 void scopeChannel(const
char *full_chan_path,
bool on_off);
642 bool scopeChannelInternal(const
CH_Channel *chp,
bool on_off);
644 bool scopeChannelInternal(const
CH_ChannelRef &chref,
bool on_off);
646 virtual
void getChannelsWithNodeId(
CH_ChannelList &chans,
int node_id) const;
650 void scopeChanged(
unsigned flags,
bool propagate=true );
656 bool isChannelScoped(const
char *full_chan_path) const;
663 void clearPendingChannels();
665 bool hasPendingChannels() const;
675 bool isChannelDisplayed(
CH_Channel *chp) const;
679 bool isChannelDisplayed( const
char *full_chan_path ) const;
681 void clearDisplayedChannels(
bool propagate = true );
683 void displayAllScopedChannels(
bool propagate = true );
685 void displaySelectedScopedChannels(
bool propagate = true );
689 bool propagate = true );
691 void displayChannel( const
char *full_chan_path,
692 bool propagate = true );
695 bool propagate = true );
697 void undisplayChannel( const
char *full_chan_path,
698 bool propagate = true );
706 bool isChannelSelected( const
char *full_chan_path ) const;
708 void clearSelectedChannels(
bool propagate = true );
710 void selectAllScopedChannels(
bool propagate = true );
714 bool propagate = true );
716 void selectChannel( const
char *full_chan_path,
717 bool propagate = true );
720 bool propagate = true );
722 void deselectChannel( const
char *full_chan_path,
723 bool propagate = true );
729 void togglePinAllScopedChannels();
733 void pinAllScopedChannels(
bool propagate = true );
735 void unpinAllScopedChannels(
bool propagate = true );
737 void pinSelectedChannels(
bool propagate = true,
738 int operate_on = CH_SELECTED );
740 void unpinSelectedChannels(
bool propagate = true,
741 int operate_on = CH_SELECTED );
744 bool propagate = true );
747 bool propagate = true );
752 void clearLayerScope();
756 bool isLayerScoped(const
char *full_chan_path) const;
762 void scopeLayer(const
char *full_chan_path,
bool on_off);
764 bool scopeLayerInternal(
CH_Channel *chp,
bool on_off);
766 bool scopeLayerInternal(const
CH_ChannelRef &chref,
bool on_off);
774 bool isLayerSelected( const
char *full_chan_path ) const;
776 void clearSelectedLayers(
bool propagate = true );
778 void selectAllScopedLayers(
bool propagate = true );
781 void selectLayer( const
CH_ChannelRef &chref,
bool propagate = true );
783 void selectLayer( const
char *full_chan_path,
bool propagate = true );
785 void deselectLayer( const
CH_ChannelRef &chref,
bool propagate = true );
787 void deselectLayer( const
char *full_chan_path,
bool propagate = true );
793 void togglePinAllScopedLayers();
797 void pinAllScopedLayers(
bool propagate = true );
799 void unpinAllScopedLayers(
bool propagate = true );
801 void pinSelectedLayers(
bool propagate = true,
int operate_on =
CH_LAYER_SELECTED );
803 void unpinSelectedLayers(
bool propagate = true,
int operate_on = CH_LAYER_SELECTED );
816 bool isLayerDisplayed( const
char *full_chan_path ) const;
818 void clearDisplayedLayers(
bool propagate = true );
820 void displayAllScopedLayers(
bool propagate = true );
822 void displaySelectedScopedLayers(
bool propagate = true );
826 bool propagate = true );
828 void displayLayer( const
char *full_chan_path,
829 bool propagate = true );
832 bool propagate = true );
834 void undisplayLayer( const
char *full_chan_path,
835 bool propagate = true );
841 bool propagate = true );
843 unsigned getChannelFlags( const
CH_ChannelRef &chref ) const;
851 int expandString(const
char *
string,
UT_String &expanded,
854 int expansion_type = CH_EXPANSION_TYPE_DEFAULT,
856 context_options_stack =
nullptr,
860 void buildStringOpDependencies( const
char *str,
void *ref_id,
867 bool scanForVariableInString(const
char *variable,
868 const
char *
string) const;
870 const
char *new_fullpath,
871 const
char *old_fullpath,
873 const
char *chan_name,
874 const
char *old_chan_name,
885 context_options_stack =
nullptr,
886 DEP_ContextOptionsReadHandle context_options =
887 DEP_ContextOptionsReadHandle());
893 context_options_stack =
nullptr,
894 DEP_ContextOptionsReadHandle context_options =
895 DEP_ContextOptionsReadHandle());
899 static
void evaluationError(
int err,
int thread, const
char *
path);
910 bool getIsSettingGlobalParam()
const
911 {
return (mySettingGlobalParam > 0); }
912 void getGlobalParamF(
const char *token,
CH_Collection *scope,
914 bool add_dependencies );
915 void getGlobalParamS(
const char *token,
CH_Collection *scope,
917 int thread,
bool add_dependencies );
922 void getGlobalParamAnyScopeF(
const char *token,
CH_Collection *scope,
924 bool add_dependencies );
925 void getGlobalParamAnyScopeS(
const char *token,
CH_Collection *scope,
927 int thread,
bool add_dependencies );
929 int setGlobalFloatParam(
const char *token,
932 int setGlobalStringParam(
const char *token,
937 void dumpGlobalParams(std::ostream &out)
const;
941 void dirtyOrphanGlobalParamDependents(
const char *token,
949 {
return (mySettingGuideParam > 0); }
957 CH_Group *findGroup(
const char *const_path,
bool create =
false,
960 const char *
pattern,
bool minimal );
972 bool propagate =
true);
973 void updateGroupSelectionFromScoped(
void *by,
974 bool propagate =
true);
975 void updateCurrentGroup(
CH_Group *group,
977 bool propagate =
true);
978 void enforceLeafOnlyChannels(
CH_Group *group,
979 const char *
name=
"new_group");
982 CH_Group *createGroup(
const char *const_path,
983 bool do_rename =
true,
985 void renameGroup(
CH_Group *group,
const char *newname);
989 void extractGroup(
CH_Group *group, CollisionBehaviour cb );
992 void collapseChildren(
CH_Group *parent );
998 CollisionBehaviour cb,
999 const char *new_name =
nullptr );
1001 CollisionBehaviour cb,
1002 const char *new_name =
nullptr );
1004 CollisionBehaviour cb );
1006 CollisionBehaviour cb );
1011 void channelCreated(
const CH_Channel *chp );
1012 void channelDeleted(
const CH_Channel *chp );
1019 bool include_temporary=
false);
1023 bool remove_existing =
true);
1029 static bool couldExpandString(
const char *str);
1033 {
return myDefaultExprLanguage; }
1035 { myDefaultExprLanguage = language; }
1039 {
return p == &myScopedChannels; }
1043 {
return myScopedChannels; }
1045 {
return myScopedChannels; }
1050 bool include_global,
bool include_pinned);
1052 bool include_global,
bool include_pinned)
const;
1054 bool hasExternalCollection(
const CH_Collection *collection)
const;
1059 void scopeExternalCollection(
CH_Collection *collection,
bool on_off=
true);
1072 CH_Channel *getExternalChannel(
const char *collection,
1073 const char *
name)
const;
1084 exint globExternalChannels(
1090 {
return myExternalCollections; }
1093 void timeGroupsChanged();
1095 bool do_rename=
true,
1098 void destroyTimeGroup(
int i);
1100 const char *newname,
1107 int getTimeGroupIdx(
const char *
name )
const;
1111 void bookmarksChanged(
1116 {
return myBookmarksMicroNode; }
1119 bool create_undo =
true);
1128 bool notify =
true);
1130 void destroyBookmark(
int index,
bool create_undo =
true,
1131 bool notify =
true);
1132 void destroyBookmarks(
1134 bool create_undo =
true,
1135 bool notify =
true);
1138 bool create_undo =
true,
1139 bool notify =
true);
1144 void frameBookmark(
int index,
1145 bool store_previous_range =
true);
1148 bool store_previous_range =
true);
1150 void clearBookmarks();
1156 void setMostRecentBookmark(
CH_Bookmark *bookmark);
1159 void setLeastRecentBookmark(
CH_Bookmark *bookmark);
1165 int getFramedBookmarkIndex()
const;
1172 {
return myBookmarks(i).get(); }
1183 {
return myRecentBookmarks; }
1188 static inline fpreal niceNumber(
fpreal num,
int digits=6);
1193 int niceFrameSeparation(
fpreal initial_sep,
1194 int minimum_sep = 1)
const;
1209 static fpreal getDefaultFPS();
1212 static int getDefaultChopMotionSamples();
1215 void setRawNumSamples(
int n,
bool notify =
true);
1217 void setSamplesPerSec(
fpreal fps,
bool notify =
true);
1219 void setRawSamplesPerSec(
fpreal fps,
bool notify =
true);
1221 void setChopMotionSamples(
int n,
bool notify =
true);
1226 {
return getFrame( myStart ); }
1228 {
return getFrame( myEnd ); }
1233 void setGlobalStart(
fpreal start,
bool notify =
true);
1244 return ((sample-1.0)/myFPS);
1254 return niceNumber(getSampleRaw(t));
1259 return (
int)
SYSfloor(getSampleRaw(t+getTolerance()));
1264 return sample_delta/myFPS;
1269 return time_delta*myFPS;
1274 return getTime(
SYSrint( getSampleRaw(t) ) );
1280 return getTime(getSnapSubsample(getSampleRaw(t)));
1295 return SYSrint((frame - getGlobalStartFrame())
1296 * (1.0 / mySampleStep))
1297 * mySampleStep + getGlobalStartFrame();
1311 snaptime = getSnapToFrameTime( t );
1312 return SYSisEqual(t, snaptime, getTolerance());
1324 void setIntegerFrameFlag(
int flag,
bool notify =
true);
1327 void setRestrictRangeFlag(
int flag,
bool notify =
true);
1330 void setShowRangeFlag(
int flag,
bool notify =
true);
1333 void setShowTicksFlag(
int flag,
bool notify =
true);
1336 void setShowAudioFlag(
int flag,
bool notify =
true);
1339 void setShowKeysFlag(
int flag,
bool notify =
true);
1342 void setShowBookmarksFlag(
int flag,
bool notify =
true);
1345 void setShowSimCacheFlag(
int flag,
bool notify =
true);
1348 void setShowAnimBarFlag(
int flag,
bool notify =
true);
1357 void parseUnitsString(
const char *
units,
1360 fpreal scaleToMKS(
const char *fromunits)
const;
1361 fpreal scaleFromMKS(
const char *tounits)
const;
1364 void setRealTimeFlag(
int flag,
bool notify =
true);
1366 void setRealTimeFactor(
fpreal f,
bool notify =
true);
1368 void setRealTimeDisableSkip(
bool b,
bool notify =
true);
1370 void setSampleStep(
fpreal s,
bool notify =
true);
1374 start = myRangeStart;
1383 int saveChannels(
const char *
filename,
bool binary,
bool compiled,
1385 bool displayed =
false)
const;
1386 int loadChannels(
const char *
filename,
1387 const char *src_pattern,
1388 const char *dest_pattern,
1393 bool delete_keys =
false,
1395 static bool readCHNFileHeader(
UT_IStream &is,
bool quiet,
1399 static bool skipCHNFileHeaderForCollection(
UT_IStream &is,
bool &is_fp64);
1400 static bool getFileType(
const char *
filename,
int &raw,
int &
binary );
1401 static bool printFileInfo(std::ostream &os,
const char *
filename,
1403 bool print_segments=
true );
1424 evalContext(thread).myCollection =
g;
1426 evalContext(thread).myChannel =
nullptr;
1427 evalContext(thread).mySegment =
nullptr;
1428 evalContext(thread).myChannelName =
nullptr;
1439 return evalContext(thread).myCollection;
1446 { myRootCollection = root; }
1448 {
return myRootCollection; }
1455 {
return myEvalContext.getValueForThread(thread); }
1459 {
return myEvalContext.getValueForThread(thread); }
1462 {
return evalContext(thread).myChannel; }
1464 {
return evalContext(thread).mySegment; }
1466 {
return evalContext(thread).myChannelName; }
1469 {
return evalContext(thread).myContextOptionsStack; }
1472 {
return evalContext(thread).myContextOptions; }
1477 {
return evalContext(thread).time(); }
1479 { evalContext(thread).setTime(time); }
1481 { evalContext(thread).setFlicks(fl); }
1497 bool getVariableValue(
UT_String &str,
int i,
1499 bool getVariableValue(
fpreal &
val,
int i,
1503 bool getVariableValue(
int &
val,
int i,
int thread)
const;
1506 virtual bool getVariableString(
const char *
name,
1519 static void lookupVariableNoThread(
const char *
name,
1523 static void lookupExpressionNoThread(
const char *
name,
1544 const char *
path)
const;
1565 bool use_alias=
false)
const;
1567 virtual bool isChanRefValid(
const CH_ChannelRef &chref)
const;
1569 void changeReferencesToNodeId(
int old_id,
int new_id);
1575 void removeReferencesToNodeId(
int node_id);
1577 void displayScope()
const;
1591 {
return myAutoKeyTuples; }
1593 { myAutoKeyTuples=
b; }
1598 {
return mySetAutoScopeOnChannelCreate; }
1600 { mySetAutoScopeOnChannelCreate=
b; }
1605 {
return myAutoScopeIncludeAnimated; }
1607 { myAutoScopeIncludeAnimated=
b; }
1611 {
return myFollowScopedChannelReferences; }
1613 { myFollowScopedChannelReferences=
b; }
1626 fpreal evalCycleOffsetFunc(
1628 fpreal evalCycleOffsettFunc(
1655 {
return myAutoScopeIncludeChild; }
1657 { myAutoScopeIncludeChild=
b; }
1662 {
return myAutoScopeIncludeConstraints; }
1664 { myAutoScopeIncludeConstraints=
b; }
1672 {
return myDefaultContextOptions; }
1675 bool shouldSetGlobalContextOptionDependency(
1678 void addContextOptionDependency(
1680 bool set_dependency_on_global,
1682 void setDefaultContextOption(
1686 void setDefaultContextOption(
1692 void setDefaultContextOptionUiConfig(
1695 void removeDefaultContextOption(
1698 void clearDefaultContextOptions(
bool create_undo);
1699 bool saveDefaultContextOptions(std::ostream &os)
const;
1700 bool loadDefaultContextOptions(
UT_IStream &is);
1701 int addDefaultContextOptionCallback(
1703 void removeDefaultContextOptionCallback(
int id);
1704 bool isAutomaticContextOption(
1706 bool isAutomaticContextOptionOverridden(
1708 void pushRopCookContextOptions();
1709 void pushRopCookContextOptions(
bool ropcook,
1715 void resetRopCookContextOptions();
1716 void updateRopCookContextOptions(
bool ropcook,
1722 void popRopCookContextOptions();
1727 void setChannelChanged( CH_ChannelChanged *mgr );
1728 CH_ChannelChanged *getChannelChanged();
1729 void triggerChannelChanged();
1742 {
return myIgnoreUpdateScopeFlag; }
1744 { myIgnoreUpdateScopeFlag = onoff; }
1746 static int getSimpleSegmentTypeFromExpression(
const char *expr);
1758 void setTolerance(
fpreal tol);
1760 void initExpressionLibrary();
1764 void initLibraryGlue();
1773 void destroyExternalCollection(
1780 void internalScopeChanged(
unsigned flags,
1781 bool propagate=
true,
1782 const int &reason = CH_SCOPE_REPLACED);
1784 void playbackChanged();
1786 void handleGroupCollision(
CH_Group *new_group,
1788 CollisionBehaviour cb );
1790 void destroyContents();
1791 int internalSetGlobalParam(
const char *token,
1794 int setSingleGlobalParam(
const char *token,
1797 void internalDirtyOrphanGlobalParamDependents(
1802 void propagateDefaultContextOptionDirtied(
1805 static char *chExprExpander(
const char *str,
int thread);
1811 bool operator==(
const chParamKey &key)
const;
1823 {
return key.hash(); }
1872 chParamData *findGlobalParam(
const char *token,
1874 chParamData *findOrCreateGlobalParam(
1876 fpreal fval,
const char *sval);
1878 chParamData *myLastGlobalParam;
1879 int mySettingGlobalParam;
1881 int mySettingGuideParam;
1883 int myChopMotionSamples;
1885 unsigned myGroupsSorted:1,
1888 myRealTimeDisableSkip:1,
1899 mySetAutoScopeOnChannelCreate:1,
1900 myAutoScopeIncludeAnimated:1,
1901 myFollowScopedChannelReferences:1,
1902 myAutoScopeIncludeChild:1,
1903 myAutoScopeIncludeConstraints:1;
1905 short myRawInterpFlag;
1908 bool myShouldShowFakeAccelHandles;
1912 SlopeMode myAutoSlope;
1916 bool myAlwaysCommitKey;
1929 int myBlockModifyScope;
1930 unsigned myPendingScopeChange;
1931 bool myPendingChannelChanged;
1934 CH_ChannelChanged *myChannelChanged;
1939 myDefaultContextOptionCallbacks;
1940 int myNextDefaultContextOptionCallbackId;
1942 bool myIgnoreUpdateScopeFlag;
1944 mutable UT_Lock myPendingChannelsLock;
1946 static CH_Manager *theManager;
1951 static constexpr
exint CH_SAMPLES_PER_FRAME = 1000;
1955 friend class CH_UndoScopeChannels;
1970 : myContext(chman.evalContext(thread))
1971 , myCollection(nullptr)
1972 , myPopCollection(false)
1973 , myPopContextOptions(false)
1975 #if defined(CH_USE_FLICKS)
1976 myFlicks = myContext.flicks();
1978 mySeconds = myContext.time();
1980 myContext.setTime(time);
1983 myPopCollection =
true;
1984 myCollection = myContext.myCollection;
1985 myContext.myCollection = ch;
1987 if (!context_options.isNull())
1989 myPopContextOptions =
true;
1990 myContextOptionsStack = myContext.myContextOptionsStack;
1991 myContext.myContextOptionsStack = context_options_stack;
1992 myContextOptions = myContext.myContextOptions;
1993 myContext.myContextOptions = context_options;
1999 #if defined(CH_USE_FLICKS)
2000 myContext.setFlicks(myFlicks);
2002 myContext.setTime(mySeconds);
2004 if (myPopCollection)
2005 myContext.myCollection = myCollection;
2006 if (myPopContextOptions)
2008 myContext.myContextOptionsStack = myContextOptionsStack;
2009 myContext.myContextOptions = myContextOptions;
2020 #if defined(CH_USE_FLICKS)
2025 bool myPopCollection;
2026 bool myPopContextOptions;
2037 : myContext(
CH_Manager::getContext()->evalContext(thread))
2039 myCollection = myContext.myCollection;
2041 myContext.myCollection = collection;
2045 return myContext.myCollection;
2050 myContext.myCollection = collection;
2054 myContext.myCollection = myCollection;
2071 CH_ActiveLayerContrib();
2072 ~CH_ActiveLayerContrib();
2104 : myOwner(owner), myChanRef(ref), myFlags(flags)
2152 return (
SYSrint(num * scale) / scale);
fpreal getSampleDelta(fpreal time_delta) const
CH_ScopedChannelsBase(CH_Manager *mgr)
fpreal getRealTimeFactor() const
void setFilterRotates(bool b)
CH_API void CHsortChannelRefs(CH_ChannelRefList &channels)
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)
#define checkPtr(ptr, msg)
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)
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)
bool getKeepChannelListSelection() const
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)
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
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
SYS_API fpreal32 SYSfloor(fpreal32 val)
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)
fpreal32 SYSrint(fpreal32 val)
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
void setKeepChannelListSelection(bool b)
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)
bool getAlwaysCommitKeyChange() const
void set(CH_Collection *collection)
virtual bool channelsBeingChanged()
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()
bool SYSisEqual(const UT_Vector2T< T > &a, const UT_Vector2T< T > &b, S tol=SYS_FTOLERANCE)
Componentwise equality.
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