本文整理汇总了C++中TRange::IsEmpty方法的典型用法代码示例。如果您正苦于以下问题:C++ TRange::IsEmpty方法的具体用法?C++ TRange::IsEmpty怎么用?C++ TRange::IsEmpty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TRange
的用法示例。
在下文中一共展示了TRange::IsEmpty方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: print
void print(TRange range)
{
for(int i = 0; !range.IsEmpty() && i < 77; range.Pop(), ++i)
{
putchar(48 + range.Front());
}
puts("");
}
示例2: OnStepToBeginning
FReply FSequencer::OnStepToBeginning()
{
PlaybackState = EMovieScenePlayerStatus::Stopped;
TRange<float> TimeBounds = GetTimeBounds();
if (!TimeBounds.IsEmpty())
{
SetGlobalTime(TimeBounds.GetLowerBoundValue());
}
return FReply::Handled();
}
示例3: ZoomToSelectedSections
void FSequencer::ZoomToSelectedSections()
{
TArray< TRange<float> > Bounds;
for (TWeakObjectPtr<UMovieSceneSection> SelectedSection : *Selection.GetSelectedSections())
{
Bounds.Add(SelectedSection->GetRange());
}
TRange<float> BoundsHull = TRange<float>::Hull(Bounds);
if (BoundsHull.IsEmpty())
{
BoundsHull = GetTimeBounds();
}
if (!BoundsHull.IsEmpty() && !BoundsHull.IsDegenerate())
{
OnViewRangeChanged(BoundsHull, true);
}
}
示例4: Tick
void FSequencer::Tick(float InDeltaTime)
{
if (bNeedTreeRefresh)
{
// @todo - Sequencer Will be called too often
UpdateRuntimeInstances();
SequencerWidget->UpdateLayoutTree();
bNeedTreeRefresh = false;
}
float NewTime = GetGlobalTime() + InDeltaTime;
if (PlaybackState == EMovieScenePlayerStatus::Playing ||
PlaybackState == EMovieScenePlayerStatus::Recording)
{
TRange<float> TimeBounds = GetTimeBounds();
if (!TimeBounds.IsEmpty())
{
if (NewTime > TimeBounds.GetUpperBoundValue())
{
if (bLoopingEnabled)
{
NewTime -= TimeBounds.Size<float>();
}
else
{
NewTime = TimeBounds.GetUpperBoundValue();
PlaybackState = EMovieScenePlayerStatus::Stopped;
}
}
if (NewTime < TimeBounds.GetLowerBoundValue())
{
NewTime = TimeBounds.GetLowerBoundValue();
}
SetGlobalTime(NewTime);
}
else
{
// no bounds at all, stop playing
PlaybackState = EMovieScenePlayerStatus::Stopped;
}
}
// Tick all the tools we own as well
for (int32 EditorIndex = 0; EditorIndex < TrackEditors.Num(); ++EditorIndex)
{
TrackEditors[EditorIndex]->Tick(InDeltaTime);
}
}
示例5: GetFocusedMovieScene
TRange<float> FSequencer::GetTimeBounds() const
{
// When recording, we never want to constrain the time bound range. You might not even have any sections or keys yet
// but we need to be able to move the time cursor during playback so you can capture data in real-time
if( PlaybackState == EMovieScenePlayerStatus::Recording )
{
return TRange<float>( -100000.0f, 100000.0f );
}
const UMovieScene* MovieScene = GetFocusedMovieScene();
const UMovieSceneTrack* AnimatableShot = MovieScene->FindMasterTrack( UMovieSceneDirectorTrack::StaticClass() );
if (AnimatableShot)
{
// try getting filtered shot boundaries
TRange<float> Bounds = GetFilteringShotsTimeBounds();
if (!Bounds.IsEmpty()) {return Bounds;}
// try getting the bounds of all shots
Bounds = AnimatableShot->GetSectionBoundaries();
if (!Bounds.IsEmpty()) {return Bounds;}
}
return MovieScene->GetTimeRange();
}
示例6: OnViewRangeChanged
void FSequencer::OnViewRangeChanged( TRange<float> NewViewRange, bool bSmoothZoom )
{
if (!NewViewRange.IsEmpty())
{
if (bSmoothZoom)
{
if (!ZoomAnimation.IsPlaying())
{
LastViewRange = TargetViewRange;
ZoomAnimation.Play( SequencerWidget.ToSharedRef() );
}
TargetViewRange = NewViewRange;
}
else
{
TargetViewRange = LastViewRange = NewViewRange;
ZoomAnimation.JumpToEnd();
}
}
}