本文整理汇总了C++中TOptional::Reset方法的典型用法代码示例。如果您正苦于以下问题:C++ TOptional::Reset方法的具体用法?C++ TOptional::Reset怎么用?C++ TOptional::Reset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TOptional
的用法示例。
在下文中一共展示了TOptional::Reset方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetInteractionType
ETransformGizmoInteractionType ABaseTransformGizmo::GetInteractionType( UActorComponent* DraggedComponent, TOptional<FTransformGizmoHandlePlacement>& OutHandlePlacement )
{
OutHandlePlacement.Reset();
if ( DraggedComponent != nullptr )
{
UStaticMeshComponent* DraggedMesh = Cast<UStaticMeshComponent>( DraggedComponent );
if ( DraggedMesh != nullptr )
{
ETransformGizmoInteractionType ResultInteractionType;
for ( UGizmoHandleGroup* HandleGroup : AllHandleGroups )
{
if ( HandleGroup != nullptr )
{
int32 HandIndex = HandleGroup->GetDraggedHandleIndex( DraggedMesh );
if ( HandIndex != INDEX_NONE )
{
HandleGroup->GetHandleIndexInteractionType( HandIndex, ResultInteractionType, OutHandlePlacement );
return ResultInteractionType;
}
}
}
}
}
OutHandlePlacement.Reset();
return ETransformGizmoInteractionType::Translate;
}
示例2: OnPaintSection
//.........这里部分代码省略.........
{
for ( UParticleEmitter* Emitter : ParticleSystemComponent->Template->Emitters )
{
UParticleModuleRequired* RequiredModule = Emitter->GetLODLevel( 0 )->RequiredModule;
bIsLooping |= RequiredModule->EmitterLoops == 0;
LastEmitterEndTime = FMath::Max( LastEmitterEndTime, RequiredModule->EmitterDelay + RequiredModule->EmitterDuration );
}
}
}
}
}
// @todo Sequencer - This should only draw the visible ranges.
TArray<TRange<float>> DrawRanges;
TOptional<float> CurrentRangeStart;
for ( auto KeyIterator = ParticleSection->GetParticleCurve().GetKeyIterator(); KeyIterator; ++KeyIterator )
{
FIntegralKey Key = *KeyIterator;
if ( (EParticleKey::Type)Key.Value == EParticleKey::Activate )
{
if ( CurrentRangeStart.IsSet() == false )
{
CurrentRangeStart = Key.Time;
}
else
{
if ( bIsLooping == false )
{
if ( Key.Time > CurrentRangeStart.GetValue() + LastEmitterEndTime )
{
DrawRanges.Add( TRange<float>( CurrentRangeStart.GetValue(), CurrentRangeStart.GetValue() + LastEmitterEndTime ) );
}
else
{
DrawRanges.Add( TRange<float>( CurrentRangeStart.GetValue(), Key.Time ) );
}
CurrentRangeStart = Key.Time;
}
}
}
if ( (EParticleKey::Type)Key.Value == EParticleKey::Deactivate )
{
if ( CurrentRangeStart.IsSet() )
{
if (bIsLooping)
{
DrawRanges.Add( TRange<float>( CurrentRangeStart.GetValue(), Key.Time ) );
}
else
{
if ( Key.Time > CurrentRangeStart.GetValue() + LastEmitterEndTime )
{
DrawRanges.Add( TRange<float>( CurrentRangeStart.GetValue(), CurrentRangeStart.GetValue() + LastEmitterEndTime ) );
}
else
{
DrawRanges.Add( TRange<float>( CurrentRangeStart.GetValue(), Key.Time ) );
}
}
CurrentRangeStart.Reset();
}
}
}
if ( CurrentRangeStart.IsSet() )
{
if ( bIsLooping )
{
DrawRanges.Add( TRange<float>( CurrentRangeStart.GetValue(), OwningSequencer->GetViewRange().GetUpperBoundValue() ) );
}
else
{
DrawRanges.Add( TRange<float>( CurrentRangeStart.GetValue(), CurrentRangeStart.GetValue() + LastEmitterEndTime ) );
}
}
for ( const TRange<float>& DrawRange : DrawRanges )
{
float XOffset = TimeToPixelConverter.TimeToPixel(DrawRange.GetLowerBoundValue());
float XSize = TimeToPixelConverter.TimeToPixel(DrawRange.GetUpperBoundValue()) - XOffset;
FSlateDrawElement::MakeBox(
InPainter.DrawElements,
InPainter.LayerId,
InPainter.SectionGeometry.ToPaintGeometry( FVector2D( XOffset, (InPainter.SectionGeometry.GetLocalSize().Y - SequencerSectionConstants::KeySize.Y) / 2 ), FVector2D( XSize, SequencerSectionConstants::KeySize.Y ) ),
FEditorStyle::GetBrush( "Sequencer.Section.Background" ),
InPainter.SectionClippingRect,
DrawEffects
);
FSlateDrawElement::MakeBox(
InPainter.DrawElements,
InPainter.LayerId,
InPainter.SectionGeometry.ToPaintGeometry( FVector2D( XOffset, (InPainter.SectionGeometry.GetLocalSize().Y - SequencerSectionConstants::KeySize.Y) / 2 ), FVector2D( XSize, SequencerSectionConstants::KeySize.Y ) ),
FEditorStyle::GetBrush( "Sequencer.Section.BackgroundTint" ),
InPainter.SectionClippingRect,
DrawEffects,
TrackColor
);
}
return InPainter.LayerId+1;
}