virtual void OnArrangeChildren( const FGeometry& AllottedGeometry, FArrangedChildren& ArrangedChildren ) const override { if (Children.Num() == 0) { return; } const float Alpha = 1.f - SlideCurve.GetLerp(); float PositionSoFar = AllottedGeometry.GetLocalSize().Y + StartSlideOffset*Alpha; for (int32 Index = 0; Index < NumSlots(); ++Index) { const SBoxPanel::FSlot& CurChild = Children[Index]; const EVisibility ChildVisibility = CurChild.GetWidget()->GetVisibility(); if (ChildVisibility != EVisibility::Collapsed) { const FVector2D ChildDesiredSize = CurChild.GetWidget()->GetDesiredSize(); const FMargin SlotPadding(CurChild.SlotPadding.Get()); const FVector2D SlotSize(AllottedGeometry.Size.X, ChildDesiredSize.Y + SlotPadding.GetTotalSpaceAlong<Orient_Vertical>()); const AlignmentArrangeResult XAlignmentResult = AlignChild<Orient_Horizontal>( SlotSize.X, CurChild, SlotPadding ); const AlignmentArrangeResult YAlignmentResult = AlignChild<Orient_Vertical>( SlotSize.Y, CurChild, SlotPadding ); ArrangedChildren.AddWidget( ChildVisibility, AllottedGeometry.MakeChild( CurChild.GetWidget(), FVector2D( XAlignmentResult.Offset, PositionSoFar - SlotSize.Y + YAlignmentResult.Offset ), FVector2D( XAlignmentResult.Size, YAlignmentResult.Size ) )); PositionSoFar -= SlotSize.Y; } } }
FVector2D ComputeTotalSize() const { FVector2D Size(ForceInitToZero); for (int32 Index = 0; Index < FMath::Min(NumSlots(), MaxNumVisible); ++Index) { const FVector2D& ChildSize = Children[Index].GetWidget()->GetDesiredSize(); if (ChildSize.X > Size.X) { Size.X = ChildSize.X; } Size.Y += ChildSize.Y + Children[Index].SlotPadding.Get().GetTotalSpaceAlong<Orient_Vertical>(); } return Size; }
void FBOSourceTextureFilter::updateOuputSlots(void) { bool AttachedFiltersNeedUpdate(false); //Update the number of slots UInt8 NumSlots(0); if(getFBO() != NullFC) { NumSlots = getFBO()->getTextures().size(); } if(NumSlots != getOutputSlots().size()) { //Need to resize the number of slots getOutputSlots().resize(NumSlots); } UInt32 FormatClasses(OSG_TEXTURE_INTERNAL_FORMAT_NONE); UInt32 DataTypeClasses(OSG_TEXTURE_DATA_TYPE_NONE); //Update the definitions of each of the slots for(UInt8 i(0) ; i<NumSlots ; ++i) { FormatClasses = determinTextureFormatClasses(getFBO()->getTextures(i)); DataTypeClasses = determinTextureDataTypeClasses(getFBO()->getTextures(i)); //Update the Format Class if(FormatClasses != getOutputSlots(i).getTextureFormatClasses()) { editOutputSlots(i).setTextureFormatClasses(FormatClasses); } //Update the Data Type Class if(DataTypeClasses != getOutputSlots(i).getTextureDataTypeClasses()) { editOutputSlots(i).setTextureDataTypeClasses(DataTypeClasses); } //Update the Description //TODO: Implement } }
virtual void Tick(const FGeometry& AllottedGeometry, const double InCurrentTime, const float InDeltaTime) override { if (!SlideCurve.IsPlaying()) { StartSlideOffset = 0; } // Delete any widgets that are now offscreen if (Children.Num() != 0) { const float Alpha = 1.f - SlideCurve.GetLerp(); float PositionSoFar = AllottedGeometry.GetLocalSize().Y + Alpha * StartSlideOffset; for (int32 Index = 0; PositionSoFar > 0 && Index < NumSlots(); ++Index) { const SBoxPanel::FSlot& CurChild = Children[Index]; const EVisibility ChildVisibility = CurChild.GetWidget()->GetVisibility(); if (ChildVisibility != EVisibility::Collapsed) { const FVector2D ChildDesiredSize = CurChild.GetWidget()->GetDesiredSize(); PositionSoFar -= ChildDesiredSize.Y + CurChild.SlotPadding.Get().GetTotalSpaceAlong<Orient_Vertical>(); } } for (int32 Index = MaxNumVisible; Index < Children.Num(); ) { if (StaticCastSharedRef<SWidgetStackItem>(Children[Index].GetWidget())->bIsFinished) { Children.RemoveAt(Index); } else { ++Index; } } } }