Represents the position, size, and absolute position of a Widget in Slate. 更多...
#include <Geometry.h>
Public 成员函数 | |
| FORCEINLINE_DEBUGGABLE FVector2D | AbsoluteToLocal (FVector2D AbsoluteCoordinate) const |
| Absolute coordinates could be either desktop or window space depending on what space the root of the widget hierarchy is in. 更多... | |
| FORCEINLINE_DEBUGGABLE void | AppendTransform (const FSlateLayoutTransform &LayoutTransform) |
| Special case method to append a layout transform to a geometry. 更多... | |
| FGeometry () | |
| Default constructor. 更多... | |
| FGeometry (const FVector2D &OffsetFromParent, const FVector2D &ParentAbsolutePosition, const FVector2D &InLocalSize, float InScale) | |
| !!! DEPRECATED FUNCTION !!! Use MakeChild taking a layout transform instead! Construct a new geometry given the following parameters: 更多... | |
| FORCEINLINE FVector2D | GetAbsolutePosition () const |
| Get the absolute position in render space. | |
| FORCEINLINE FVector2D | GetAbsolutePositionAtCoordinates (const FVector2D &NormalCoordinates) const |
| Get the absolute position on the surface of the geometry using normalized coordinates. 更多... | |
| FORCEINLINE FVector2D | GetAbsoluteSize () const |
| Get the absolute size of the geometry in render space. | |
| FORCEINLINE FSlateLayoutTransform | GetAccumulatedLayoutTransform () const |
| FORCEINLINE const FSlateRenderTransform & | GetAccumulatedRenderTransform () const |
| FORCEINLINE_DEBUGGABLE FSlateRect | GetClippingRect () const |
| !!! DEPRECATED !!! This legacy function does not account for render transforms. 更多... | |
| FORCEINLINE_DEBUGGABLE FVector2D | GetDrawSize () const |
| !!! DEPRECATED !!! This legacy function does not account for render transforms. 更多... | |
| FORCEINLINE FVector2D | GetLocalPositionAtCoordinates (const FVector2D &NormalCoordinates) const |
| Get the local position on the surface of the geometry using normalized coordinates. 更多... | |
| FORCEINLINE const FVector2D & | GetLocalSize () const |
| FORCEINLINE_DEBUGGABLE bool | IsUnderLocation (const FVector2D &AbsoluteCoordinate) const |
| Absolute coordinates could be either desktop or window space depending on what space the root of the widget hierarchy is in. 更多... | |
| FORCEINLINE_DEBUGGABLE FVector2D | LocalToAbsolute (FVector2D LocalCoordinate) const |
| Translates local coordinates into absolute coordinates 更多... | |
| FORCEINLINE_DEBUGGABLE FVector2D | LocalToRoundedLocal (FVector2D LocalCoordinate) const |
| Translates the local coordinates into local coordinates that after being transformed into absolute space will be rounded to a whole number or approximately a whole number. 更多... | |
| FORCEINLINE_DEBUGGABLE FGeometry | MakeChild (const FVector2D &ChildOffset, const FVector2D &InLocalSize, float ChildScale=1.0f) const |
| !!! DEPRECATED FUNCTION !!! Use MakeChild taking a layout transform instead! Create a child geometry relative to this one with a given local space size and layout transform given by a scale+offset. 更多... | |
| FORCEINLINE_DEBUGGABLE FGeometry | MakeChild (const FVector2D &InLocalSize, const FSlateLayoutTransform &LayoutTransform) const |
| Create a child geometry relative to this one with a given local space size, layout transform, and identity render transform. 更多... | |
| FORCEINLINE_DEBUGGABLE FGeometry | MakeChild (const FVector2D &InLocalSize, const FSlateLayoutTransform &LayoutTransform, const FSlateRenderTransform &RenderTransform, const FVector2D &RenderTransformPivot) const |
| Create a child geometry relative to this one with a given local space size, layout transform, and render transform. 更多... | |
| FArrangedWidget | MakeChild (const TSharedRef< SWidget > &ChildWidget, const FLayoutGeometry &LayoutGeometry) const |
| Create a child geometry+widget relative to this one using the given LayoutGeometry. 更多... | |
| FArrangedWidget | MakeChild (const TSharedRef< SWidget > &ChildWidget, const FVector2D &ChildOffset, const FVector2D &InLocalSize, float ChildScale=1.0f) const |
| !!! DEPRECATED FUNCTION !!! Use MakeChild taking a layout transform instead! Create a child geometry+widget relative to this one with a given local space size and layout transform given by a scale+offset. 更多... | |
| FArrangedWidget | MakeChild (const TSharedRef< SWidget > &ChildWidget, const FVector2D &InLocalSize, const FSlateLayoutTransform &LayoutTransform) const |
| Create a child geometry+widget relative to this one with a given local space size and layout transform. 更多... | |
| bool | operator!= (const FGeometry &Other) const |
| Test geometries for strict inequality (i.e. 更多... | |
| FGeometry & | operator= (const FGeometry &RHS) |
| !!! HACK!!! We're keeping members of FGeometry const to prevent mutability without making them private, for backward compatibility. 更多... | |
| bool | operator== (const FGeometry &Other) const |
| Test geometries for strict equality (i.e. 更多... | |
| FORCEINLINE_DEBUGGABLE FPaintGeometry | ToInflatedPaintGeometry (const FVector2D &InflateAmount) const |
| Create a paint geometry relative to this one that whose local space is "inflated" by the specified amount in each direction. 更多... | |
| FORCEINLINE_DEBUGGABLE FPaintGeometry | ToOffsetPaintGeometry (const FVector2D &LocalOffset) const |
| !!! DEPRECATED FUNCTION !!! Use ToPaintGeometry taking a layout transform instead! Create a paint geometry relative to this one with the same size size and a given local space offset. 更多... | |
| FORCEINLINE_DEBUGGABLE FPaintGeometry | ToPaintGeometry () const |
| Create a paint geometry that represents this geometry. 更多... | |
| FORCEINLINE_DEBUGGABLE FPaintGeometry | ToPaintGeometry (const FSlateLayoutTransform &LayoutTransform) const |
| Create a paint geometry with the same size as this geometry with a given layout transform. 更多... | |
| FORCEINLINE_DEBUGGABLE FPaintGeometry | ToPaintGeometry (const FVector2D &InLocalOffset, const FVector2D &InLocalSize, float InLocalScale=1.0f) const |
| !!! DEPRECATED FUNCTION !!! Use ToPaintGeometry taking a layout transform instead! Create a paint geometry relative to this one with a given local space size and layout transform given as a scale+offset. 更多... | |
| FORCEINLINE_DEBUGGABLE FPaintGeometry | ToPaintGeometry (const FVector2D &InLocalSize, const FSlateLayoutTransform &InLayoutTransform) const |
| Create a paint geometry relative to this one with a given local space size and layout transform. 更多... | |
| FORCEINLINE_DEBUGGABLE FPaintGeometry | ToPaintGeometry (const FVector2D &InLocalSize, const FSlateLayoutTransform &InLayoutTransform, const FSlateRenderTransform &RenderTransform, const FVector2D &RenderTransformPivot=FVector2D(0.5f, 0.5)) const |
| Create a paint geometry relative to this one with a given local space size and layout transform. 更多... | |
| FString | ToString () const |
静态 Public 成员函数 | |
| static FORCEINLINE_DEBUGGABLE FGeometry | MakeRoot (const FVector2D &InLocalSize, const FSlateLayoutTransform &LayoutTransform) |
| Makes a new geometry that is essentially the root of a hierarchy (has no parent transforms to inherit). 更多... | |
| static FORCEINLINE_DEBUGGABLE FGeometry | MakeRoot (const FVector2D &InLocalSize, const FSlateLayoutTransform &LayoutTransform, const FSlateRenderTransform &RenderTransform) |
| Makes a new geometry that is essentially the root of a hierarchy (has no parent transforms to inherit). 更多... | |
Public 属性 | |
| const FVector2D | AbsolutePosition |
| !!! DEPRECATED !!! These legacy public members should ideally not be referenced, as they do not account for the render transform. 更多... | |
| const FVector2D | Position |
| !!! DEPRECATED !!! 更多... | |
| const float | Scale |
| !!! DEPRECATED !!! These legacy public members should ideally not be referenced, as they do not account for the render transform. 更多... | |
| const FVector2D | Size |
| !!! DEPRECATED !!! Use GetLocalSize() accessor instead of directly accessing public members. 更多... | |
Represents the position, size, and absolute position of a Widget in Slate.
The absolute location of a geometry is usually screen space or window space depending on where the geometry originated. Geometries are usually paired with a SWidget pointer in order to provide information about a specific widget (see FArrangedWidget). A Geometry's parent is generally thought to be the Geometry of the the corresponding parent widget.
| FGeometry::FGeometry | ( | ) |
Default constructor.
Creates a geometry with identity transforms.
|
inline |
!!! DEPRECATED FUNCTION !!! Use MakeChild taking a layout transform instead! Construct a new geometry given the following parameters:
| OffsetFromParent | Local position of this geometry within its parent geometry. |
| ParentAbsolutePosition | The absolute position of the parent geometry containing this geometry. |
| InSize | The size of this geometry. |
| InScale | The scale of this geometry with respect to Normal Slate Coordinates. |
|
inline |
Absolute coordinates could be either desktop or window space depending on what space the root of the widget hierarchy is in.
|
inline |
Special case method to append a layout transform to a geometry.
This is used in cases where the FGeometry was arranged in window space and we need to add the root desktop translation. If you find yourself wanting to use this function, ask someone if there's a better way.
| LayoutTransform | An additional layout transform to append to this geometry. |
|
inline |
Get the absolute position on the surface of the geometry using normalized coordinates.
(0,0) - upper left (1,1) - bottom right
Example: Say you wanted to know the center of the widget in absolute space, GetAbsolutePositionAtCoordinates(FVector2D(0.5f, 0.5f));
|
inline |
|
inline |
|
inline |
!!! DEPRECATED !!! This legacy function does not account for render transforms.
Returns a clipping rectangle corresponding to the allocated geometry's absolute position and size. Note that the clipping rectangle starts 1 pixel above and left of the geometry because clipping is not inclusive on the lower bound.
Absolute coordinates could be either desktop or window space depending on what space the root of the widget hierarchy is in.
|
inline |
!!! DEPRECATED !!! This legacy function does not account for render transforms.
Absolute coordinates could be either desktop or window space depending on what space the root of the widget hierarchy is in.
|
inline |
Get the local position on the surface of the geometry using normalized coordinates.
(0,0) - upper left (1,1) - bottom right
Example: Say you wanted to know the center of the widget in local space, GetLocalPositionAtCoordinates(FVector2D(0.5f, 0.5f));
|
inline |
|
inline |
Absolute coordinates could be either desktop or window space depending on what space the root of the widget hierarchy is in.
|
inline |
Translates local coordinates into absolute coordinates
Absolute coordinates could be either desktop or window space depending on what space the root of the widget hierarchy is in.
|
inline |
Translates the local coordinates into local coordinates that after being transformed into absolute space will be rounded to a whole number or approximately a whole number.
This is important for cases where you want to show a popup or a tooltip and not have the window start on a half pixel, which can cause the contents to jitter in relation to eachother as the tooltip or popup moves around.
|
inline |
!!! DEPRECATED FUNCTION !!! Use MakeChild taking a layout transform instead! Create a child geometry relative to this one with a given local space size and layout transform given by a scale+offset.
The Render Transform is identity.
| ChildOffset | Offset of the child relative to the parent. Scale+Offset effectively define the layout transform. |
| LocalSize | The size of the child geometry in local space. |
| ChildScale | Scale of the child relative to the parent. Scale+Offset effectively define the layout transform. |
|
inline |
Create a child geometry relative to this one with a given local space size, layout transform, and identity render transform.
For example, a widget with a 5x5 margin will create a geometry for it's child contents having a LayoutTransform of Translate(5,5) and a LocalSize 10 units smaller than it's own.
| LocalSize | The size of the child geometry in local space. |
| LayoutTransform | Layout transform of the new child relative to this Geometry. Goes from the child's layout space to the this widget's layout space. |
|
inline |
Create a child geometry relative to this one with a given local space size, layout transform, and render transform.
For example, a widget with a 5x5 margin will create a geometry for it's child contents having a LayoutTransform of Translate(5,5) and a LocalSize 10 units smaller than it's own.
| LocalSize | The size of the child geometry in local space. |
| LayoutTransform | Layout transform of the new child relative to this Geometry. Goes from the child's layout space to the this widget's layout space. |
| RenderTransform | Render-only transform of the new child that is applied before the layout transform for rendering purposes only. |
| RenderTransformPivot | Pivot in normalized local space of the Render transform. |
| FORCEINLINE_DEBUGGABLE FArrangedWidget FGeometry::MakeChild | ( | const TSharedRef< SWidget > & | ChildWidget, |
| const FLayoutGeometry & | LayoutGeometry | ||
| ) | const |
Create a child geometry+widget relative to this one using the given LayoutGeometry.
| ChildWidget | The child widget this geometry is being created for. |
| LayoutGeometry | Layout geometry of the child. |
| FORCEINLINE_DEBUGGABLE FArrangedWidget FGeometry::MakeChild | ( | const TSharedRef< SWidget > & | ChildWidget, |
| const FVector2D & | ChildOffset, | ||
| const FVector2D & | InLocalSize, | ||
| float | ChildScale = 1.0f |
||
| ) | const |
!!! DEPRECATED FUNCTION !!! Use MakeChild taking a layout transform instead! Create a child geometry+widget relative to this one with a given local space size and layout transform given by a scale+offset.
The Geometry inherits the child widget's render transform.
| ChildWidget | The child widget this geometry is being created for. |
| ChildOffset | Offset of the child relative to the parent. Scale+Offset effectively define the layout transform. |
| LocalSize | The size of the child geometry in local space. |
| ChildScale | Scale of the child relative to the parent. Scale+Offset effectively define the layout transform. |
| FORCEINLINE_DEBUGGABLE FArrangedWidget FGeometry::MakeChild | ( | const TSharedRef< SWidget > & | ChildWidget, |
| const FVector2D & | InLocalSize, | ||
| const FSlateLayoutTransform & | LayoutTransform | ||
| ) | const |
Create a child geometry+widget relative to this one with a given local space size and layout transform.
The Geometry inherits the child widget's render transform. For example, a widget with a 5x5 margin will create a geometry for it's child contents having a LayoutTransform of Translate(5,5) and a LocalSize 10 units smaller than it's own.
| ChildWidget | The child widget this geometry is being created for. |
| LocalSize | The size of the child geometry in local space. |
| LayoutTransform | Layout transform of the new child relative to this Geometry. |
|
inlinestatic |
Makes a new geometry that is essentially the root of a hierarchy (has no parent transforms to inherit).
For a root Widget, the LayoutTransform is often the window DPI scale + window offset.
| LocalSize | Size of the geometry in Local Space. |
| LayoutTransform | Layout transform of the geometry. |
|
inlinestatic |
Makes a new geometry that is essentially the root of a hierarchy (has no parent transforms to inherit).
For a root Widget, the LayoutTransform is often the window DPI scale + window offset.
| LocalSize | Size of the geometry in Local Space. |
| LayoutTransform | Layout transform of the geometry. |
|
inline |
Test geometries for strict inequality (i.e.
exact float equality negated).
| Other | A geometry to compare to. |
!!! HACK!!! We're keeping members of FGeometry const to prevent mutability without making them private, for backward compatibility.
But this means the assignment operator no longer works. We implement one ourselves now and force a memcpy.
|
inline |
Test geometries for strict equality (i.e.
exact float equality).
| Other | A geometry to compare to. |
|
inline |
Create a paint geometry relative to this one that whose local space is "inflated" by the specified amount in each direction.
The paint geometry inherits the widget's render transform.
| InflateAmount | Amount by which to "inflate" the geometry in each direction around the center point. Effectively defines a layout transform offset and an inflation of the LocalSize. |
|
inline |
!!! DEPRECATED FUNCTION !!! Use ToPaintGeometry taking a layout transform instead! Create a paint geometry relative to this one with the same size size and a given local space offset.
The paint geometry inherits the widget's render transform.
| LocalOffset | Offset of the paint geometry relative to the parent. Effectively defines the layout transform. |
|
inline |
Create a paint geometry that represents this geometry.
|
inline |
Create a paint geometry with the same size as this geometry with a given layout transform.
The paint geometry inherits the widget's render transform.
| LayoutTransform | Layout transform of the paint geometry relative to this Geometry. |
|
inline |
!!! DEPRECATED FUNCTION !!! Use ToPaintGeometry taking a layout transform instead! Create a paint geometry relative to this one with a given local space size and layout transform given as a scale+offset.
The paint geometry inherits the widget's render transform.
| LocalOffset | Offset of the paint geometry relative to the parent. Scale+Offset effectively define the layout transform. |
| LocalSize | The size of the paint geometry in local space. |
| LocalScale | Scale of the paint geometry relative to the parent. Scale+Offset effectively define the layout transform. |
|
inline |
Create a paint geometry relative to this one with a given local space size and layout transform.
The paint geometry inherits the widget's render transform.
| LocalSize | The size of the child geometry in local space. |
| LayoutTransform | Layout transform of the paint geometry relative to this Geometry. |
|
inline |
Create a paint geometry relative to this one with a given local space size and layout transform.
The paint geometry inherits the widget's render transform.
| LocalSize | The size of the child geometry in local space. |
| LayoutTransform | Layout transform of the paint geometry relative to this Geometry. |
| FString FGeometry::ToString | ( | ) | const |
| const FVector2D FGeometry::AbsolutePosition |
!!! DEPRECATED !!! These legacy public members should ideally not be referenced, as they do not account for the render transform.
FGeometry manipulation should be done in local space as much as possible so logic can be done in aligned local space, but still support arbitrary render transforms.
This member has been made const to prevent mutation, which would also break render transforms, which are computed during construction. There is no way to easily detect mutation of public members, thus no way to update the render transforms when they are modified.
Position in absolute space. Equivalent to the translation of the accumulated layout transform.
Absolute coordinates could be either desktop or window space depending on what space the root of the widget hierarchy is in.
| const FVector2D FGeometry::Position |
!!! DEPRECATED !!!
Position of the geometry with respect to its parent in local space. Equivalent to the translation portion of the Local->Parent layout transform. If you know your children have no additional scale applied to them, you can use this as the Local->Parent layout transform. If your children DO have additional scale applied, there is no way to determine the actual Local->Parent layout transform, since the scale is accumulated.
| const float FGeometry::Scale |
!!! DEPRECATED !!! These legacy public members should ideally not be referenced, as they do not account for the render transform.
FGeometry manipulation should be done in local space as much as possible so logic can be done in aligned local space, but still support arbitrary render transforms.
This member has been made const to prevent mutation, which would also break render transforms, which are computed during construction. There is no way to easily detect mutation of public members, thus no way to update the render transforms when they are modified.
Scale in absolute space. Equivalent to the scale of the accumulated layout transform.
Absolute coordinates could be either desktop or window space depending on what space the root of the widget hierarchy is in.
| const FVector2D FGeometry::Size |
!!! DEPRECATED !!! Use GetLocalSize() accessor instead of directly accessing public members.
This member has been made const to prevent mutation. There is no way to easily detect mutation of public members, thus no way to update the render transforms when they are modified.
Size of the geometry in local space.