Skip to content

Commit

Permalink
GetFeatureIDCount -> GetCount
Browse files Browse the repository at this point in the history
  • Loading branch information
j9liu committed Dec 23, 2024
1 parent 8d5f7a4 commit 4eacdc0
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Config/Engine.ini
Original file line number Diff line number Diff line change
Expand Up @@ -162,4 +162,4 @@ AspectRatioAxisConstraint=AspectRatio_MaintainXFOV

+FunctionRedirects=(OldName="CesiumFeatureIdAttributeBlueprintLibrary.GetFeatureIDForVertex", NewName="CesiumFeatureIdAttributeBlueprintLibrary.GetFeatureID")
+PropertyRedirects=(OldName="CesiumFeatureIdAttributeBlueprintLibrary.GetFeatureIDForVertex.VertexIndex", NewName="CesiumFeatureIdAttributeBlueprintLibrary.GetFeatureID.Index")
+FunctionRedirects=(OldName="CesiumFeatureIdAttributeBlueprintLibrary.GetVertexCount", NewName="CesiumFeatureIdAttributeBlueprintLibrary.GetFeatureIDCount")
+FunctionRedirects=(OldName="CesiumFeatureIdAttributeBlueprintLibrary.GetVertexCount", NewName="CesiumFeatureIdAttributeBlueprintLibrary.GetCount")
2 changes: 1 addition & 1 deletion Source/CesiumRuntime/Private/CesiumFeatureIdAttribute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ UCesiumFeatureIdAttributeBlueprintLibrary::GetFeatureIDAttributeStatus(
return FeatureIDAttribute._status;
}

int64 UCesiumFeatureIdAttributeBlueprintLibrary::GetFeatureIDCount(
int64 UCesiumFeatureIdAttributeBlueprintLibrary::GetCount(
UPARAM(ref) const FCesiumFeatureIdAttribute& FeatureIDAttribute) {
return std::visit(
CesiumGltf::CountFromAccessor{},
Expand Down
14 changes: 8 additions & 6 deletions Source/CesiumRuntime/Private/CesiumGltfComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -719,9 +719,10 @@ static void updateTextureCoordinatesForFeaturesMetadata(
UCesiumFeatureIdSetBlueprintLibrary::GetAsFeatureIDAttribute(
featureIDSet);

int64 vertexCount =
UCesiumFeatureIdAttributeBlueprintLibrary::GetFeatureIDCount(
featureIDAttribute);
// Each feature ID corresponds to a vertex, so the vertex count is just
// the length of the attribute.
int64 vertexCount = UCesiumFeatureIdAttributeBlueprintLibrary::GetCount(
featureIDAttribute);

// We encode unsigned integer feature ids as floats in the u-channel of
// a texture coordinate slot.
Expand Down Expand Up @@ -878,9 +879,10 @@ static void updateTextureCoordinatesForMetadata_DEPRECATED(
encodedFeatureIdAttribute.name,
textureCoordinateIndex);

int64 vertexCount =
UCesiumFeatureIdAttributeBlueprintLibrary::GetFeatureIDCount(
featureIdAttribute);
// Each feature ID corresponds to a vertex, so the vertex count is just
// the length of the attribute.
int64 vertexCount = UCesiumFeatureIdAttributeBlueprintLibrary::GetCount(
featureIdAttribute);

// We encode unsigned integer feature ids as floats in the u-channel of
// a texture coordinate slot.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ void FCesiumFeatureIdAttributeSpec::Define() {
});
});

Describe("GetFeatureIDCount", [this]() {
Describe("GetCount", [this]() {
BeforeEach([this]() {
model = CesiumGltf::Model();
CesiumGltf::Mesh& mesh = model.meshes.emplace_back();
Expand All @@ -149,7 +149,7 @@ void FCesiumFeatureIdAttributeSpec::Define() {
ECesiumFeatureIdAttributeStatus::ErrorInvalidAccessor);
TestEqual(
"VertexCount",
UCesiumFeatureIdAttributeBlueprintLibrary::GetFeatureIDCount(
UCesiumFeatureIdAttributeBlueprintLibrary::GetCount(
featureIDAttribute),
0);
});
Expand Down Expand Up @@ -177,7 +177,7 @@ void FCesiumFeatureIdAttributeSpec::Define() {
ECesiumFeatureIdAttributeStatus::Valid);
TestEqual(
"VertexCount",
UCesiumFeatureIdAttributeBlueprintLibrary::GetFeatureIDCount(
UCesiumFeatureIdAttributeBlueprintLibrary::GetCount(
featureIDAttribute),
vertexCount);
});
Expand Down
10 changes: 5 additions & 5 deletions Source/CesiumRuntime/Public/CesiumFeatureIdAttribute.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ class CESIUMRUNTIME_API UCesiumFeatureIdAttributeBlueprintLibrary
UFUNCTION(
BlueprintCallable,
BlueprintPure,
Category = "Cesium|Metadata|FeatureIdAttribute",
Meta =
(DeprecatedFunction,
DeprecationMessage =
Expand All @@ -131,16 +130,17 @@ class CESIUMRUNTIME_API UCesiumFeatureIdAttributeBlueprintLibrary
UPARAM(ref) const FCesiumFeatureIdAttribute& FeatureIDAttribute);

/**
* Get the number of feature IDs in this attribute. If the feature ID
* attribute is invalid, this returns 0.
* Gets the number of elements in the attribute. This is distinct from the
* number of unique feature IDs within the attribute.
*
* If the feature ID attribute is invalid, this returns 0.
*/
UFUNCTION(
BlueprintCallable,
BlueprintPure,
Category = "Cesium|Features|FeatureIDAttribute")
static int64
GetFeatureIDCount(UPARAM(ref)
const FCesiumFeatureIdAttribute& FeatureIDAttribute);
GetCount(UPARAM(ref) const FCesiumFeatureIdAttribute& FeatureIDAttribute);

/**
* Gets the feature ID at the given index. A feature ID can be used with a
Expand Down

0 comments on commit 4eacdc0

Please sign in to comment.