From: seungho Date: Thu, 25 Aug 2022 07:05:07 +0000 (+0900) Subject: Binds Dali::Scene3D::SceneView X-Git-Tag: dali_2.1.38~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=49fdcd96b29b6dd5a26ea41dffb8094ba5d5579a;p=platform%2Fcore%2Fuifw%2Fdali-csharp-binder.git Binds Dali::Scene3D::SceneView Change-Id: I2c7a3c048fb3e0e005f416d776969b88069a927e Signed-off-by: seungho --- diff --git a/dali-csharp-binder/file.list b/dali-csharp-binder/file.list index 037b685c..06651aab 100755 --- a/dali-csharp-binder/file.list +++ b/dali-csharp-binder/file.list @@ -84,6 +84,7 @@ SET( dali_csharp_binder_tizen_wearable_src_files # module: scene3d SET( dali_csharp_binder_scene3d_src_files ${dali_csharp_binder_dir}/src/model-view-wrap.cpp + ${dali_csharp_binder_dir}/src/scene-view-wrap.cpp ) SET( dali_csharp_binder_header_files diff --git a/dali-csharp-binder/src/scene-view-wrap.cpp b/dali-csharp-binder/src/scene-view-wrap.cpp new file mode 100755 index 00000000..8b9acb92 --- /dev/null +++ b/dali-csharp-binder/src/scene-view-wrap.cpp @@ -0,0 +1,359 @@ +/* + * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// EXTERNAL INCLUDES +#include + +// INTERNAL INCLUDES +#include "common.h" + +#ifdef __cplusplus +extern "C" +{ +#endif + + SWIGEXPORT void *SWIGSTDCALL CSharp_Dali_SceneView_New_SWIG_1() + { + Dali::Scene3D::SceneView result; + { + try + { + result = Dali::Scene3D::SceneView::New(); + } + CALL_CATCH_EXCEPTION(0); + } + + return new Dali::Scene3D::SceneView((const Dali::Scene3D::SceneView &)result); + } + + SWIGEXPORT void *SWIGSTDCALL CSharp_Dali_new_SceneView_SWIG_0() + { + Dali::Scene3D::SceneView *result = 0; + + { + try + { + result = (Dali::Scene3D::SceneView *)new Dali::Scene3D::SceneView(); + } + CALL_CATCH_EXCEPTION(0); + } + + return (void *)result; + } + + SWIGEXPORT void *SWIGSTDCALL CSharp_Dali_new_SceneView_SWIG_1(void *csSceneView) + { + Dali::Scene3D::SceneView *sceneView = (Dali::Scene3D::SceneView *)csSceneView; + Dali::Scene3D::SceneView *result = 0; + + if (!sceneView) + { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Dali::Scene3D::SceneView const & type is null", 0); + return 0; + } + { + try + { + result = (Dali::Scene3D::SceneView *)new Dali::Scene3D::SceneView((Dali::Scene3D::SceneView const &)*sceneView); + } + CALL_CATCH_EXCEPTION(0); + } + + return (void *)result; + } + + SWIGEXPORT void SWIGSTDCALL CSharp_Dali_delete_SceneView(void *csSceneView) + { + Dali::Scene3D::SceneView *sceneView = (Dali::Scene3D::SceneView *)csSceneView; + { + try + { + delete sceneView; + } + CALL_CATCH_EXCEPTION(); + } + } + + SWIGEXPORT void *SWIGSTDCALL CSharp_Dali_SceneView_Assign(void *csDestination, void *csSource) + { + Dali::Scene3D::SceneView *destination = (Dali::Scene3D::SceneView *)csDestination; + Dali::Scene3D::SceneView *source = (Dali::Scene3D::SceneView *)csSource; + Dali::Scene3D::SceneView *result = 0; + + if (!source) + { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Dali::Scene3D::SceneView const & type is null", 0); + return 0; + } + { + try + { + result = (Dali::Scene3D::SceneView *)&(destination)->operator=((Dali::Scene3D::SceneView const &)*source); + } + CALL_CATCH_EXCEPTION(0); + } + + return (void *)result; + } + + SWIGEXPORT void *SWIGSTDCALL CSharp_Dali_SceneView_DownCast(void *csHandle) + { + Dali::BaseHandle *handle = (Dali::BaseHandle *)csHandle; + Dali::Scene3D::SceneView result; + + if (!handle) + { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Scene3D::SceneView", 0); + return 0; + } + { + try + { + result = Dali::Scene3D::SceneView::DownCast(*handle); + } + CALL_CATCH_EXCEPTION(0); + } + + return new Dali::Scene3D::SceneView((const Dali::Scene3D::SceneView &)result); + } + + SWIGEXPORT void SWIGSTDCALL CSharp_Dali_SceneView_AddCamera(void *csSceneView, void *csCamera) + { + Dali::Scene3D::SceneView *sceneView = (Dali::Scene3D::SceneView *)csSceneView; + Dali::CameraActor *cameraActor = (Dali::CameraActor *)csCamera; + + if (!sceneView) + { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Scene3D::SceneView", 0); + return; + } + if (!cameraActor) + { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::CameraActor", 0); + return; + } + { + try + { + sceneView->AddCamera(*cameraActor); + } + CALL_CATCH_EXCEPTION(); + } + } + + SWIGEXPORT void SWIGSTDCALL CSharp_Dali_SceneView_RemoveCamera(void *csSceneView, void *csCamera) + { + Dali::Scene3D::SceneView *sceneView = (Dali::Scene3D::SceneView *)csSceneView; + Dali::CameraActor *cameraActor = (Dali::CameraActor *)csCamera; + + if (!sceneView) + { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Scene3D::SceneView", 0); + return; + } + if (!cameraActor) + { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::CameraActor", 0); + return; + } + { + try + { + sceneView->RemoveCamera(*cameraActor); + } + CALL_CATCH_EXCEPTION(); + } + } + + SWIGEXPORT uint32_t SWIGSTDCALL CSharp_Dali_SceneView_GetCameraCount(void *csSceneView) + { + Dali::Scene3D::SceneView *sceneView = (Dali::Scene3D::SceneView *)csSceneView; + uint32_t result = 0; + + if (!sceneView) + { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Scene3D::SceneView", 0); + return 0; + } + { + try + { + result = sceneView->GetCameraCount(); + } + CALL_CATCH_EXCEPTION(0); + } + return result; + } + + SWIGEXPORT void *SWIGSTDCALL CSharp_Dali_SceneView_GetSelectedCamera(void *csSceneView) + { + Dali::Scene3D::SceneView *sceneView = (Dali::Scene3D::SceneView *)csSceneView; + Dali::CameraActor cameraActor; + + if (!sceneView) + { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Scene3D::SceneView", 0); + return 0; + } + { + try + { + cameraActor = sceneView->GetSelectedCamera(); + } + CALL_CATCH_EXCEPTION(0); + } + Dali::CameraActor *result = new Dali::CameraActor((const Dali::CameraActor &)cameraActor); + return result; + } + + SWIGEXPORT void *SWIGSTDCALL CSharp_Dali_SceneView_GetCamera_0(void *csSceneView, uint32_t index) + { + Dali::Scene3D::SceneView *sceneView = (Dali::Scene3D::SceneView *)csSceneView; + Dali::CameraActor cameraActor; + + if (!sceneView) + { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Scene3D::SceneView", 0); + return 0; + } + { + try + { + cameraActor = sceneView->GetCamera(index); + } + CALL_CATCH_EXCEPTION(0); + } + Dali::CameraActor *result = new Dali::CameraActor((const Dali::CameraActor &)cameraActor); + return result; + } + + SWIGEXPORT void *SWIGSTDCALL CSharp_Dali_SceneView_GetCamera_1(void *csSceneView, char *name) + { + Dali::Scene3D::SceneView *sceneView = (Dali::Scene3D::SceneView *)csSceneView; + Dali::CameraActor cameraActor; + + if (!sceneView) + { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Scene3D::SceneView", 0); + return 0; + } + { + try + { + cameraActor = sceneView->GetCamera(std::string(name)); + } + CALL_CATCH_EXCEPTION(0); + } + Dali::CameraActor *result = new Dali::CameraActor((const Dali::CameraActor &)cameraActor); + return result; + } + + SWIGEXPORT void SWIGSTDCALL CSharp_Dali_SceneView_SelectCamera_0(void *csSceneView, uint32_t index) + { + Dali::Scene3D::SceneView *sceneView = (Dali::Scene3D::SceneView *)csSceneView; + + if (!sceneView) + { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Scene3D::SceneView", 0); + return; + } + { + try + { + sceneView->SelectCamera(index); + } + CALL_CATCH_EXCEPTION(); + } + } + + SWIGEXPORT void SWIGSTDCALL CSharp_Dali_SceneView_SelectCamera_1(void *csSceneView, char *name) + { + Dali::Scene3D::SceneView *sceneView = (Dali::Scene3D::SceneView *)csSceneView; + + if (!sceneView) + { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Scene3D::SceneView", 0); + return; + } + { + try + { + sceneView->SelectCamera(std::string(name)); + } + CALL_CATCH_EXCEPTION(); + } + } + + SWIGEXPORT void SWIGSTDCALL CSharp_Dali_SceneView_SetImageBasedLightSource(void *csSceneView, char *diffuseUrl, char *specularUrl, float scaleFactor) + { + Dali::Scene3D::SceneView *sceneView = (Dali::Scene3D::SceneView *)csSceneView; + + if (!sceneView) + { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Scene3D::SceneView", 0); + return; + } + { + try + { + sceneView->SetImageBasedLightSource(std::string(diffuseUrl), std::string(specularUrl), scaleFactor); + } + CALL_CATCH_EXCEPTION(); + } + } + + SWIGEXPORT void SWIGSTDCALL CSharp_Dali_SceneView_UseFramebuffer(void *csSceneView, bool useFramebuffer) + { + Dali::Scene3D::SceneView *sceneView = (Dali::Scene3D::SceneView *)csSceneView; + + if (!sceneView) + { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Scene3D::SceneView", 0); + return; + } + { + try + { + sceneView->UseFramebuffer(useFramebuffer); + } + CALL_CATCH_EXCEPTION(); + } + } + + SWIGEXPORT bool SWIGSTDCALL CSharp_Dali_SceneView_IsUsingFramebuffer(void *csSceneView) + { + Dali::Scene3D::SceneView *sceneView = (Dali::Scene3D::SceneView *)csSceneView; + bool result = false; + + if (!sceneView) + { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Scene3D::SceneView", 0); + return false; + } + { + try + { + result = sceneView->IsUsingFramebuffer(); + } + CALL_CATCH_EXCEPTION(0); + } + return result; + } + +#ifdef __cplusplus +} +#endif