Skip to content

Commit 5ece3c0

Browse files
committed
More implementation, use feature-overlay branch of native
1 parent 5911836 commit 5ece3c0

File tree

3 files changed

+110
-41
lines changed

3 files changed

+110
-41
lines changed

Source/CesiumRuntime/Private/CesiumITwinAPIBlueprintLibrary.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ void UCesiumITwinAPIAuthorizeAsyncAction::Activate() {
2323
std::vector<std::string>{"itwin-platform", "offline_access"},
2424
[&Callback = this->OnAuthorizationEvent](const std::string& url) {
2525
Callback.Broadcast(
26-
ECesiumITwinDelegateType::OpenUrl,
26+
ECesiumITwinAuthorizationDelegateType::OpenUrl,
2727
UTF8_TO_TCHAR(url.c_str()),
2828
nullptr,
2929
TArray<FString>());
@@ -50,7 +50,7 @@ void UCesiumITwinAPIAuthorizeAsyncAction::Activate() {
5050
}
5151

5252
this->OnAuthorizationEvent.Broadcast(
53-
ECesiumITwinDelegateType::Failure,
53+
ECesiumITwinAuthorizationDelegateType::Failure,
5454
FString(),
5555
nullptr,
5656
Errors);
@@ -62,7 +62,7 @@ void UCesiumITwinAPIAuthorizeAsyncAction::Activate() {
6262
NewObject<UCesiumITwinConnection>();
6363
pConnection->SetConnection(pInternalConnection);
6464
this->OnAuthorizationEvent.Broadcast(
65-
ECesiumITwinDelegateType::Success,
65+
ECesiumITwinAuthorizationDelegateType::Success,
6666
FString(),
6767
pConnection,
6868
TArray<FString>());

Source/CesiumRuntime/Public/CesiumITwinAPIBlueprintLibrary.h

Lines changed: 106 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -15,40 +15,6 @@ THIRD_PARTY_INCLUDES_END
1515

1616
#include "CesiumITwinAPIBlueprintLibrary.generated.h"
1717

18-
UCLASS(BlueprintType)
19-
class UCesiumITwinUserProfile : public UObject {
20-
GENERATED_BODY()
21-
public:
22-
UCesiumITwinUserProfile() : UObject(), _profile() {}
23-
24-
UCesiumITwinUserProfile(CesiumITwinClient::UserProfile&& profile)
25-
: UObject(), _profile(std::move(profile)) {}
26-
27-
UFUNCTION(BlueprintCallable, BlueprintPure, Category = "Cesium|iTwin")
28-
FString GetID() { return UTF8_TO_TCHAR(_profile.id.c_str()); }
29-
30-
UFUNCTION(BlueprintCallable, BlueprintPure, Category = "Cesium|iTwin")
31-
FString GetDisplayName() {
32-
return UTF8_TO_TCHAR(_profile.displayName.c_str());
33-
}
34-
35-
UFUNCTION(BlueprintCallable, BlueprintPure, Category = "Cesium|iTwin")
36-
FString GetGivenName() { return UTF8_TO_TCHAR(_profile.givenName.c_str()); }
37-
38-
UFUNCTION(BlueprintCallable, BlueprintPure, Category = "Cesium|iTwin")
39-
FString GetSurname() { return UTF8_TO_TCHAR(_profile.surname.c_str()); }
40-
41-
UFUNCTION(BlueprintCallable, BlueprintPure, Category = "Cesium|iTwin")
42-
FString GetEmail() { return UTF8_TO_TCHAR(_profile.email.c_str()); }
43-
44-
void SetProfile(CesiumITwinClient::UserProfile&& profile) {
45-
this->_profile = std::move(profile);
46-
}
47-
48-
private:
49-
CesiumITwinClient::UserProfile _profile;
50-
};
51-
5218
UCLASS(BlueprintType)
5319
class UCesiumITwinConnection : public UObject {
5420
GENERATED_BODY()
@@ -79,7 +45,7 @@ class UCesiumITwinConnection : public UObject {
7945
};
8046

8147
UENUM(BlueprintType)
82-
enum class ECesiumITwinDelegateType : uint8 {
48+
enum class ECesiumITwinAuthorizationDelegateType : uint8 {
8349
Invalid = 0,
8450
OpenUrl = 1,
8551
Failure = 2,
@@ -88,7 +54,7 @@ enum class ECesiumITwinDelegateType : uint8 {
8854

8955
DECLARE_DYNAMIC_MULTICAST_DELEGATE_FourParams(
9056
FCesiumITwinAuthorizationDelegate,
91-
ECesiumITwinDelegateType,
57+
ECesiumITwinAuthorizationDelegateType,
9258
Type,
9359
const FString&,
9460
Url,
@@ -119,6 +85,40 @@ class CESIUMRUNTIME_API UCesiumITwinAPIAuthorizeAsyncAction
11985
FString _clientId;
12086
};
12187

88+
UCLASS(BlueprintType)
89+
class UCesiumITwinUserProfile : public UObject {
90+
GENERATED_BODY()
91+
public:
92+
UCesiumITwinUserProfile() : UObject(), _profile() {}
93+
94+
UCesiumITwinUserProfile(CesiumITwinClient::UserProfile&& profile)
95+
: UObject(), _profile(std::move(profile)) {}
96+
97+
UFUNCTION(BlueprintCallable, BlueprintPure, Category = "Cesium|iTwin")
98+
FString GetID() { return UTF8_TO_TCHAR(_profile.id.c_str()); }
99+
100+
UFUNCTION(BlueprintCallable, BlueprintPure, Category = "Cesium|iTwin")
101+
FString GetDisplayName() {
102+
return UTF8_TO_TCHAR(_profile.displayName.c_str());
103+
}
104+
105+
UFUNCTION(BlueprintCallable, BlueprintPure, Category = "Cesium|iTwin")
106+
FString GetGivenName() { return UTF8_TO_TCHAR(_profile.givenName.c_str()); }
107+
108+
UFUNCTION(BlueprintCallable, BlueprintPure, Category = "Cesium|iTwin")
109+
FString GetSurname() { return UTF8_TO_TCHAR(_profile.surname.c_str()); }
110+
111+
UFUNCTION(BlueprintCallable, BlueprintPure, Category = "Cesium|iTwin")
112+
FString GetEmail() { return UTF8_TO_TCHAR(_profile.email.c_str()); }
113+
114+
void SetProfile(CesiumITwinClient::UserProfile&& profile) {
115+
this->_profile = std::move(profile);
116+
}
117+
118+
private:
119+
CesiumITwinClient::UserProfile _profile;
120+
};
121+
122122
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(
123123
FCesiumITwinGetProfileDelegate,
124124
UCesiumITwinUserProfile*,
@@ -147,4 +147,73 @@ class CESIUMRUNTIME_API UCesiumITwinAPIGetProfileAsyncAction
147147
};
148148

149149
UENUM(BlueprintType)
150-
enum class EGetResourcesCallbackType : uint8 { Status, Success, Failure };
150+
enum class ECesiumITwinStatus : uint8 {
151+
Unknown = 0,
152+
Active = 1,
153+
Inactive = 2,
154+
Trial = 3
155+
};
156+
157+
UCLASS(BlueprintType)
158+
class UCesiumITwin : public UObject {
159+
GENERATED_BODY()
160+
public:
161+
UCesiumITwin() : UObject(), _iTwin() {}
162+
163+
UFUNCTION(BlueprintCallable, BlueprintPure, Category = "Cesium|iTwin")
164+
FString GetID() { return UTF8_TO_TCHAR(_iTwin.id.c_str()); }
165+
166+
UFUNCTION(BlueprintCallable, BlueprintPure, Category = "Cesium|iTwin")
167+
FString GetClass() { return UTF8_TO_TCHAR(_iTwin.iTwinClass.c_str()); }
168+
169+
UFUNCTION(BlueprintCallable, BlueprintPure, Category = "Cesium|iTwin")
170+
FString GetSubClass() { return UTF8_TO_TCHAR(_iTwin.subClass.c_str()); }
171+
172+
UFUNCTION(BlueprintCallable, BlueprintPure, Category = "Cesium|iTwin")
173+
FString GetType() { return UTF8_TO_TCHAR(_iTwin.type.c_str()); }
174+
175+
UFUNCTION(BlueprintCallable, BlueprintPure, Category = "Cesium|iTwin")
176+
FString GetNumber() { return UTF8_TO_TCHAR(_iTwin.number.c_str()); }
177+
178+
UFUNCTION(BlueprintCallable, BlueprintPure, Category = "Cesium|iTwin")
179+
FString GetDisplayName() { return UTF8_TO_TCHAR(_iTwin.displayName.c_str()); }
180+
181+
UFUNCTION(BlueprintCallable, BlueprintPure, Category = "Cesium|iTwin")
182+
ECesiumITwinStatus GetStatus() { return (ECesiumITwinStatus)_iTwin.status; }
183+
184+
void SetITwin(CesiumITwinClient::ITwin&& iTwin) {
185+
this->_iTwin = std::move(iTwin);
186+
}
187+
188+
private:
189+
CesiumITwinClient::ITwin _iTwin;
190+
};
191+
192+
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(
193+
FCesiumITwinListITwinsDelegate,
194+
TArray<UCesiumITwin*>,
195+
ITwins,
196+
bool,
197+
HasAnotherPage,
198+
const TArray<FString>&,
199+
Errors);
200+
201+
UCLASS()
202+
class CESIUMRUNTIME_API UCesiumITwinAPIGetITwinsAsyncAction
203+
: public UBlueprintAsyncActionBase {
204+
GENERATED_BODY()
205+
public:
206+
UFUNCTION(
207+
BlueprintCallable,
208+
Category = "Cesium|iTwin",
209+
meta = (BlueprintInternalUseOnly = true))
210+
static UCesiumITwinAPIGetITwinsAsyncAction*
211+
GetITwins(UCesiumITwinConnection* pConnection);
212+
213+
UPROPERTY(BlueprintAssignable)
214+
FCesiumITwinListITwinsDelegate OnITwinsResult;
215+
216+
virtual void Activate() override;
217+
218+
TSharedPtr<CesiumITwinClient::Connection> pConnection;
219+
};

extern/cesium-native

Submodule cesium-native updated 57 files

0 commit comments

Comments
 (0)